From 0c36b36e98a7bc9cc23f050363eeeed7f83be9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 10 Jul 2006 22:27:36 +0000 Subject: [PATCH] test changing of selected item's icon in DoToggleIcon as well git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/treectrl/treetest.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 40705972a7..1b5625b224 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -878,10 +878,15 @@ void MyTreeCtrl::GetItemsRecursively(const wxTreeItemId& idParent, void MyTreeCtrl::DoToggleIcon(const wxTreeItemId& item) { - int image = GetItemImage(item) == TreeCtrlIcon_Folder ? TreeCtrlIcon_File - : TreeCtrlIcon_Folder; + int image = (GetItemImage(item) == TreeCtrlIcon_Folder) + ? TreeCtrlIcon_File + : TreeCtrlIcon_Folder; + SetItemImage(item, image, wxTreeItemIcon_Normal); - SetItemImage(item, image); + image = (GetItemImage(item) == TreeCtrlIcon_FolderSelected) + ? TreeCtrlIcon_FileSelected + : TreeCtrlIcon_FolderSelected; + SetItemImage(item, image, wxTreeItemIcon_Selected); }