]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.cpp
correct toggling of the selected icon (closes 4029)
[wxWidgets.git] / samples / treectrl / treetest.cpp
index 307b3de5753821c8a9818225c0313aba681ac8ae..354844f08344a47d4dfd91c9537425a51c4926d1 100644 (file)
@@ -1007,12 +1007,12 @@ void MyTreeCtrl::GetItemsRecursively(const wxTreeItemId& idParent,
 
 void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item)
 {
-    int image = (GetItemImage(item) == TreeCtrlIcon_Folder)
+    int image = GetItemImage(item) == TreeCtrlIcon_Folder
                     ? TreeCtrlIcon_File
                     : TreeCtrlIcon_Folder;
     SetItemImage(item, image, wxTreeItemIcon_Normal);
 
-    image = (GetItemImage(item) == TreeCtrlIcon_FolderSelected)
+    image = GetItemImage(item, TreeCtrlIcon_FolderSelected) == TreeCtrlIcon_FolderSelected
                     ? TreeCtrlIcon_FileSelected
                     : TreeCtrlIcon_FolderSelected;
     SetItemImage(item, image, wxTreeItemIcon_Selected);