]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Added some const qualifiers.
[wxWidgets.git] / src / msw / treectrl.cpp
index d4a3025c38b675f582e05a8c62f544362a900a4e..cda27e031108c9993a3ad09f267c6ee49cdb1014 100644 (file)
@@ -1990,6 +1990,21 @@ 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))
+                {
+                    UnselectAll();
+                }
+
+                // select item and set the focus to the
+                // newly selected item
+                ::SelectItem(GetHwnd(), htItem);
+                ::SetFocus(GetHwnd(), htItem);
+                break;
+
 #if !wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE
             case WM_LBUTTONDOWN:
                 if ( htItem && isMultiple )