From 7b6126aa3adb67be63054dedc86d5ed90c65de22 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 26 Nov 2009 03:29:27 +0000 Subject: [PATCH] Explicitly set the cursor when showing popup menu on text control in wxMSW. 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 6839a70425..90e8c472d6 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -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; -- 2.45.2