Page 1 of 1

Responding to theme changes

Posted: Thu Feb 23, 2006 8:18 am
by AlexSchaft
Hi,

I've added the following to HandleEvent in control.prg

case nMsg == WM_THEMECHANGED
::ThemeChanged()
return ::Display()


with a virtual ThemeChanged in control.prg

I'm testing with TBar at the moment, but can't get the new colour:

I've tried resetting the brush, but it came out black...

METHOD ThemeChanged() CLASS TBar

::nClrPane = If( ::l3D, GetSysColor( COLOR_BTNFACE ), CLR_GRAY )

::Refresh()

return nil

What am I missing?

Ok, next question

Posted: Thu Feb 23, 2006 8:40 am
by AlexSchaft
Sorted out for controls

METHOD ThemeChanged() CLASS TControl

::nClrPane = GetSysColor( COLOR_BTNFACE )
::SetColor( ::nClrText, ::nClrPane )

::Refresh()

return nil

But there are controls like msgbar which inherit from twindow, which uses extern wndhandleevent.

Should I just create my own handleevent, which calls wndhandleevent if nothing matches?

Alex