From: Vadim Zeitlin Date: Fri, 23 May 2008 18:49:22 +0000 (+0000) Subject: correct toggling of the selected icon (closes 4029) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8c7da4a6b2c8c1ce8b9ad8909fc162e2a025f4e7 correct toggling of the selected icon (closes 4029) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 307b3de575..354844f083 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -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);