Fix choice of tree item icon for the selected state in wxMSW.

The logic for selecting the item icon was broken when selected image was
specified as it was not taken into account as fallback for selected expanded
state so selected icon was used only for collapsed items.

Fix this by using the selected icon if it is specified and selected expanded
one is not.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-11-04 12:02:07 +00:00
parent 4878fbb880
commit 6bb81c8e1a

View File

@@ -439,14 +439,18 @@ public:
switch ( which ) switch ( which )
{ {
case wxTreeItemIcon_SelectedExpanded: case wxTreeItemIcon_SelectedExpanded:
image = GetImage(wxTreeItemIcon_Expanded); // We consider that expanded icon is more important than
// selected so test for it first.
image = m_images[wxTreeItemIcon_Expanded];
if ( image == -1 )
image = m_images[wxTreeItemIcon_Selected];
if ( image != -1 ) if ( image != -1 )
break; break;
//else: fall through //else: fall through
case wxTreeItemIcon_Selected: case wxTreeItemIcon_Selected:
case wxTreeItemIcon_Expanded: case wxTreeItemIcon_Expanded:
image = GetImage(wxTreeItemIcon_Normal); image = m_images[wxTreeItemIcon_Normal];
break; break;
case wxTreeItemIcon_Normal: case wxTreeItemIcon_Normal: