]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
Fixed presumed typo - crash when frame is NULL
[wxWidgets.git] / src / msw / treectrl.cpp
index b065b3157200afe1172c0a1f817dc3bacea585cc..10d4f48857a416c337f742110e6cab6f24fae78e 100644 (file)
@@ -2550,6 +2550,22 @@ wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
     if ( nMsg == WM_RBUTTONDOWN )
         return 0;
 
+    // but because of the above we don't get NM_RCLICK which is normally
+    // generated by tree window proc when the modal loop mentioned above ends
+    // because the mouse is released -- synthesize it ourselves instead
+    if ( nMsg == WM_RBUTTONUP )
+    {
+        NMHDR hdr;
+        hdr.hwndFrom = GetHwnd();
+        hdr.idFrom = GetId();
+        hdr.code = NM_RCLICK;
+
+        WXLPARAM rc;
+        MSWOnNotify(GetId(), (LPARAM)&hdr, &rc);
+
+        // continue as usual
+    }
+
     if ( nMsg == WM_CHAR )
     {
         // also don't let the control process Space and Return keys because it