]> git.saurik.com Git - wxWidgets.git/commitdiff
oops... wrong patch, second try
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 2 Apr 2001 12:25:51 +0000 (12:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 2 Apr 2001 12:25:51 +0000 (12:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 61d3d2e8ab12e7bc1889aa8ca0aefc83b6f9a118..0984a23ed2639e827f273cc2b250b84fc3ae40cc 100644 (file)
@@ -2488,13 +2488,26 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
                 m_lastOnSame = FALSE;
             }
         }
-        else
+        else // !RightDown() && !LeftUp() ==> LeftDown() || LeftDClick()
         {
             if ( event.LeftDown() )
             {
                 m_lastOnSame = item == m_current;
             }
 
+            if ( flags & wxTREE_HITTEST_ONITEMBUTTON )
+            {
+                // only toggle the item for a single click, double click on
+                // the button doesn't do anything (it toggles the item twice)
+                if ( event.LeftDown() )
+                {
+                    Toggle( item );
+                }
+
+                // don't select the item if the button was clicked
+                return;
+            }
+
             // how should the selection work for this event?
             bool is_multiple, extended_select, unselect_others;
             EventFlagsToSelType(GetWindowStyleFlag(),