System focused colour Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
yukomkom
Earned a small fee
Earned a small fee
Posts: 12
Joined: Mon Nov 07, 2016 10:19 am

System focused colour

Post by yukomkom »

Hi guys,

I've been searching through the documentation and couldn't find the system colour of the focused control (let's say wxButton) on Windows. I use wxWidgets 3.0.2. Please, help.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: System focused colour

Post by doublemax »

wxSystemSettings::GetColour( wxSYS_COLOUR_BTNHIGHLIGHT ) might work.
http://docs.wxwidgets.org/trunk/classwx ... f2a19bd804

However, as Windows 7 uses gradients as background, it might not return a valid color.

Depending on what you're trying to do, wxRendererNative could be useful:
http://docs.wxwidgets.org/trunk/classwx ... ative.html
Use the source, Luke!
yukomkom
Earned a small fee
Earned a small fee
Posts: 12
Joined: Mon Nov 07, 2016 10:19 am

Re: System focused colour

Post by yukomkom »

I'm writing a custom control very similar to button and I need same behaviour as wxButton when focusing and hovering with mouse. I want to use Windows system colour for focusing control to draw borders of my custom control focused with it.
Same with hovering colour, however I haven't searched for it yet, so let's leave it in this topic.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: System focused colour

Post by doublemax »

All the colors you get through wxSystemSettings::GetColour() is the best you can get. If that's not enough, you'll have to improvise.
Use the source, Luke!
Post Reply