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 » Tue Sep 27, 2005 2:01 pm

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 » Wed Sep 28, 2005 7:54 pm

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 » Wed Sep 28, 2005 10:53 pm

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 » Wed Oct 05, 2005 1:41 pm

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
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Wed Oct 05, 2005 2:31 pm

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 » Wed Oct 05, 2005 2:38 pm

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 » Thu Oct 06, 2005 6:08 am

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 » Mon Jul 16, 2007 2:58 am

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 » Mon Jul 16, 2007 3:21 am

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