Hi, guys.
I work at win7 pro with wxWidegets3.03.
I have a problem with wxTreeCtrl. The colour of select highlight is unconspicuous.And when the ctrl lost focus, the item turn gray.
viewtopic.php?f=27&t=7616&p=34711&hilit ... ect#p34711
I find this topic, it said that is a basic windows behaviour.
In wxTreeCtrl, I can't find any Draw/Paint/Render method to override.
So,How to change this appearance?
How to change highlight colour of wxTreeCtrl? Topic is solved
Re: How to change highlight colour of wxTreeCtrl?
Hi,
wxWidgets is known for keeping a native behaviour.
What it means is that the library is using "native" set of controls/widgets wherever and whenever possible.
You can try to use conditional compilation in your project by overriding DefWindowProc or any other Windows-specific functions, but don't expect this to be included in the main line of the library.
wx will handle different themes/different resolutions/different OSes for you but, again, it will use native controls, i.e. whatever available from the OS.
If you need such a tweaking - check other Windows-specific library.
Thank you.
wxWidgets is known for keeping a native behaviour.
What it means is that the library is using "native" set of controls/widgets wherever and whenever possible.
You can try to use conditional compilation in your project by overriding DefWindowProc or any other Windows-specific functions, but don't expect this to be included in the main line of the library.
wx will handle different themes/different resolutions/different OSes for you but, again, it will use native controls, i.e. whatever available from the OS.
If you need such a tweaking - check other Windows-specific library.
Thank you.
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: How to change highlight colour of wxTreeCtrl?
Hello,
Never used the tree control until now, but did this for some wxListCtrl's. Maybe it can drive you to a working direction. Here the wxListCtrl is called lstSessions and it belongs to a panel called ImporterPanel.
Never used the tree control until now, but did this for some wxListCtrl's. Maybe it can drive you to a working direction. Here the wxListCtrl is called lstSessions and it belongs to a panel called ImporterPanel.
Code: Select all
In ctor:
lstSessions->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(ImporterPanel::OnListLostFocus), NULL);
void ImporterPanel::OnListLostFocus(wxFocusEvent& event)
{
// Inhibite change of selected item color when a list loses focus
event.Skip(false);
}
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: How to change highlight colour of wxTreeCtrl?
Hi, ONEEYEMAN.ONEEYEMAN wrote:Hi,
wxWidgets is known for keeping a native behaviour.
What it means is that the library is using "native" set of controls/widgets wherever and whenever possible.
You can try to use conditional compilation in your project by overriding DefWindowProc or any other Windows-specific functions, but don't expect this to be included in the main line of the library.
wx will handle different themes/different resolutions/different OSes for you but, again, it will use native controls, i.e. whatever available from the OS.
If you need such a tweaking - check other Windows-specific library.
Thank you.
I will try this way. This effect not only the wxTreeCtrl. If change this can deal with then all, it should be good.
Thank you.
Re: How to change highlight colour of wxTreeCtrl?
Hi,eranon.eranon wrote:Hello,
Never used the tree control until now, but did this for some wxListCtrl's. Maybe it can drive you to a working direction. Here the wxListCtrl is called lstSessions and it belongs to a panel called ImporterPanel.
I try other way to make the item obvious when it selected. Such as change its font, add underline, etc.
For now, that is all i can do.
As ONEEYEMAN said,I should go deeper.Try to change the behaviour.
Thank you.