]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug with wxTR_EDIT_LABELS not working with xwTR_MULTIPLE (bug 622089)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Jan 2003 20:21:41 +0000 (20:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Jan 2003 20:21:41 +0000 (20:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/treectrl.cpp

index 02352e56f8619eef475efbb72cbdd65f6b4c36db..17d24adda770bf050dfda4443b166fc978c513e4 100644 (file)
@@ -26,6 +26,7 @@ wxMSW:
 - support for accelerator keys in the owner drawn menus (Derry Bryson)
 - wxCaret::SetSize() doesn't hide the caret any longer as it used to
 - wxCheckListBox::Check() doesn't send CHECKLISTBOX_TOGGLE event any more
+- fixed bug with wxTR_EDIT_LABELS not workign with wxTR_MULTIPLE
 
 All:
 
index 8727b16fa10f6e85e4b6c8932eb8f3918ccd38c6..f8e18e26d0303fc4b4a53c2c8dfee28972353660 100644 (file)
@@ -2092,13 +2092,23 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
                     }
                     else // normal click
                     {
-                        // clear the selection and then let the default handler
-                        // do the job
-                        UnselectAll();
-
-                        // prevent the click from starting in-place editing
-                        // when there was no selection in the control
-                        TreeView_SelectItem(GetHwnd(), 0);
+                        // avoid doing anything if we click on the only
+                        // currently selected item
+                        wxArrayTreeItemIds selections;
+                        size_t count = GetSelections(selections);
+                        if ( count == 0 ||
+                                count > 1 ||
+                                    HITEM(selections[0]) != htItem )
+                        {
+                            // clear the previously selected items
+                            UnselectAll();
+
+                            // prevent the click from starting in-place editing
+                            // which should only happen if we click on the
+                            // already selected item (and nothing else is
+                            // selected)
+                            TreeView_SelectItem(GetHwnd(), 0);
+                        }
 
                         // reset on any click without Shift
                         m_htSelStart = 0;