]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed spurious debug message when right clicking outside of any items area
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2003 15:03:57 +0000 (15:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2003 15:03:57 +0000 (15:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/treectrl.cpp

index baaccbd974ce9e73f2664c9dca87469756690672..f0f9fa1725a0b92178f90f578ebbb5c7406565e0 100644 (file)
@@ -2134,10 +2134,10 @@ long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
         switch ( nMsg )
         {
             case WM_RBUTTONDOWN:
-                // if the item we are about to right click on
-                // is not already select, remove the entire
-                // previous selection
-                if (!::IsItemSelected(GetHwnd(), htItem))
+                // if the item we are about to right click on is not already
+                // selected or if we click outside of any item, remove the
+                // entire previous selection
+                if ( !htItem || !::IsItemSelected(GetHwnd(), htItem) )
                 {
                     UnselectAll();
                 }