Originally Posted by
hmischel@diligentsystems.com
Hi Barry,
In a custom gadget:
I have the option of putting my CSS on the object directly, like so;
And I also have the option to specify a .CSS stylesheet for the entire gadget.
How do I reference the individual items in my CSS stylesheet.
Somehow, I am thinking something like the below should work.
Whats the correct way to do this?
Thanks.
Herb
If I understand Barry correctly, using his example you would include the line he has in the CSS stylesheet either for the app, page, or section.
You would then, for any object you wanted (and wouldn't it be nice to subclass them so that all textboxes, e.g., had this attribute set by default to .F.) with the com_mycompany_mandatory property. Setting it to .T. would cause it to have the properties set in the CSS Selector (the second part of the code).
By doing it this way, you can the dynamic aspect for nothing: you aren't having to change the setting.
The great thing is that this could all be put in a builder. Let's say you have a textfield called "myskinner". I tested in a form section, but should work everywhere.
Code:
lo = lianja.get("myskinner")
lo.addproperty("com_mycompany_mandatory",.T.)
? lo.com_mycompany_mandatory
Put Barry's code in the CSS file hierarchy, and viola!
hth,
Hank
PS: you might already know all of this, being way ahead of me in the UI game. It took me 10 times around the barn for it to sink in, frankly, so I apologize if this just repeated everything you already knew.
Bookmarks