Responding to theme changes

Responding to theme changes

Postby AlexSchaft » Thu Feb 23, 2006 8:18 am

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

Postby AlexSchaft » Thu Feb 23, 2006 8:40 am

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 87 guests