]> git.saurik.com Git - wxWidgets.git/commitdiff
Explicitly set the cursor when showing popup menu on text control in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Nov 2009 03:29:27 +0000 (03:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 26 Nov 2009 03:29:27 +0000 (03:29 +0000)
Without this, an I-beam cursor is used when a menu is shown by a rich text
control. Set the arrow cursor explicitly to work around this apparent bug in
the native control.

Closes #11314.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textctrl.cpp

index 6839a704251e248902f9b745fe8ec7e3803017cb..90e8c472d695e69404c99822399d65ea0d39e461 100644 (file)
@@ -1928,6 +1928,21 @@ WXLRESULT wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                 }
             }
             break;
+
+#if wxUSE_MENUS
+        case WM_SETCURSOR:
+            // rich text controls seem to have a bug and don't change the
+            // cursor to the standard arrow one from the I-beam cursor usually
+            // used by them even when a popup menu is shown (this works fine
+            // for plain EDIT controls though), so explicitly work around this
+            if ( IsRich() )
+            {
+                extern wxMenu *wxCurrentPopupMenu;
+                if ( wxCurrentPopupMenu &&
+                        wxCurrentPopupMenu->GetInvokingWindow() == this )
+                    ::SetCursor(GetHcursorOf(*wxSTANDARD_CURSOR));
+            }
+#endif // wxUSE_MENUS
     }
 
     return lRc;