Responding to theme changes

Post Reply
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Responding to theme changes

Post 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?
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Ok, next question

Post 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
Post Reply