Selection Colour in wxListCtrl 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
Muskelkatermann
Earned some good credits
Earned some good credits
Posts: 135
Joined: Thu Apr 28, 2005 11:36 am
Location: Gie

Selection Colour in wxListCtrl

Post by Muskelkatermann »

Hi,

i have a wxListCtrl. When an Item is selected the selectioncolor is blue, that's fine, but when the listctrl looses the Focus it gets gray - I don't like gray.

How can I change this?


greetings
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

isn't this colour platform specific ?

as wxWidgets uses native controls, it may not be possible to change it.
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

wxListCtrl is only native on wxMSW, unfortunately.
For others something returned from wxSystemSettings::GetColour is probably used.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
Muskelkatermann
Earned some good credits
Earned some good credits
Posts: 135
Joined: Thu Apr 28, 2005 11:36 am
Location: Gie

Post by Muskelkatermann »

May be someone knows how to change the native's colour?
This App is for Windows only.
I guess there is a WinApi Function ?!?!?!?


Greetings
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
In fact there is (SetSysColors()), but I wouldn't recommend to use it, as it is "bad style" to change the users general UI just because you don't like gray :D
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Muskelkatermann
Earned some good credits
Earned some good credits
Posts: 135
Joined: Thu Apr 28, 2005 11:36 am
Location: Gie

Post by Muskelkatermann »

upCase:
i agree although I've already seen Apps that do, Pinnacle Liquid Edition for example changes the whole Windowx Theme ;)

Well, my users will have to life with dark blue and gray...

greetings
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

They have to live with whatever they chose to live with.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

Post by entell »

Is there any other way to change these colors other than using SetSysColors() which changes the colors for the entire GUI (not just a specific widget)?
entell
Earned some good credits
Earned some good credits
Posts: 117
Joined: Wed Apr 06, 2005 3:55 am

Post by entell »

It appears that if I hook into EVT_KILL_FOCUS (first derive a new class from wxListCtrl) and handle it without calling event.Skip(), then the selected item does not change its background color to gray...
Post Reply