Page 1 of 1

So much in there ...

Posted: Tue Aug 17, 2010 2:35 pm
by Tom
I was looking for a simple method to draw a colored box around some objects in a few dialogs, and I played around with the SUBCLASS clause, which works fine, but caused a bigger code review (besides, painting text statics with gradient backgrounds and stuff like this based on the DCSAY/DCSTATIC-commands is really simple with this!). Anyway, I remembered the HILITEGETS clause of DCGET OPTIONS, which almost does exactly this: painting a colored frame around objects. So, I looked through Roger's code and found the (not documented) function DC_HiliteGets(). Painting a blue frame around a text static works this way:

Code: Select all

DC_HiliteGets(oStatic,1,GRA_CLR_BLUE)
Just add it to the EVAL clause of the object - or somewhere else.

This is no magic and nothing changing the world. I frequently look through Roger's code and find that kind of functions. What I want to say is: If you try to do something - take a look at the eXpress++-source first. You may find out that Roger already did this. ;)

Re: So much in there ...

Posted: Wed Aug 18, 2010 10:30 am
by rdonnay
Tom -

The HILITEGETS clause of DCGETOPTIONS uses this function, but it never occurred to me to document the function.
Maybe I'll do that.

Roger

Re: So much in there ...

Posted: Wed Aug 18, 2010 3:46 pm
by Cliff Wiernik
Also, Roger added the ability to override this function with a set/get function so it uses your own code. With visual style enable, the undrawing of the hilite left a light image trace remaining because it used a solid color instead of restoring the underlying image used in the visual style.

Cliff