IonicWind Software

IWBasic => GUI Central => Topic started by: LarryMc on October 07, 2009, 02:03:48 PM

Title: Detect color change in static control.
Post by: LarryMc on October 07, 2009, 02:03:48 PM
I have a static control whose background is changed to various colors from various locations in the program.

Is there a message that is sent when a static control's background changes?

I can't seem to find one.

Larry
Title: Re: Detect color change in static control.
Post by: ZeroDog on October 07, 2009, 06:17:01 PM
if the control is not read only, it will send a WM_CTLCOLOREDIT message to the parent window when it is about to be drawn

if the control is read only, it will send a WM_CTLCOLORSTATIC message to the parent window when it is about to be drawn.
Title: Re: Detect color change in static control.
Post by: LarryMc on October 07, 2009, 07:47:38 PM
Found those; they tell me before it is updated

I needed something to tell me it just finished updating.

If I used what you suggested I would always be a 1/2 lap behind.

Thanks anyway.

I've about decided to put in a timer and do a periodic getpixel command.
I know that will do what I want.

Larry
Title: Re: Detect color change in static control.
Post by: sapero on October 07, 2009, 09:26:01 PM
Larry, maybe additional subroutine will do what you need?
sub ControlSetColor(new)
   if onColorChanging(old, new) /*a message to parent window - wm_command or wm_notify*/
     SETCONTROLCOLOR(new)
     onColorChanged(old, new)
   endif
endsub

Then replace all exsisting SETCONTROLCOLOR with ControlSetColor.