]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
always return length of the string, *not* size of the buffer from wxMBConv_win32...
[wxWidgets.git] / 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();
                 }