how do I get native settings to use in a custom control? Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
Peri
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Nov 09, 2011 10:06 pm
Location: Seattle, USA

how do I get native settings to use in a custom control?

Post by Peri »

Does wxWidgets provide any api for getting native settings? I've looked but haven't found anything. I'm making a custom control - more or less - and would like it to have a native look and feel. That is, it should use background and foreground colors typical for other controls, simlilarly for fonts, and so on. In my particular case, I want to get the bitmaps used for a tree control's collapse and expand buttons.

(I did figure out a way to get to determine the font used for text controls, by the way.)

Thanks.
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: how do I get native settings to use in a custom control?

Post by doublemax »

wxSystemSettings for colors and fonts:
http://docs.wxwidgets.org/stable/wx_wxs ... emsettings

Theoretically wxArtProvider would be the one for bitmaps, but AFAIK it uses build-in images on most platforms.
http://docs.wxwidgets.org/stable/wx_wxa ... rtprovider

And i don't think there is a way to get the native collapse and expand buttons on Windows anyway.
Use the source, Luke!
Peri
Experienced Solver
Experienced Solver
Posts: 91
Joined: Wed Nov 09, 2011 10:06 pm
Location: Seattle, USA

Re: how do I get native settings to use in a custom control?

Post by Peri »

This is great info. Thanks! Don't know how I missed it.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: how do I get native settings to use in a custom control?

Post by PB »

I haven't used it myself and it's a long shot, but can't you use wxDelegateRendererNative::DrawTreeItemButton? It seems the method is overridden for Windows XP at least.
Post Reply