]> git.saurik.com Git - wxWidgets.git/commitdiff
Apply [ 1713345 ] combobox: cmd accelerators shouldn't steal editing hotkeys
authorRobert Roebling <robert@roebling.de>
Sat, 5 May 2007 13:15:47 +0000 (13:15 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 5 May 2007 13:15:47 +0000 (13:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/combobox.h
src/msw/combobox.cpp

index a99ec2fee80f9192b6faecd12c61c52f6c7826f3..214b5a4a3ce14da5540ff543aff8f210caffc86c 100644 (file)
@@ -105,7 +105,8 @@ public:
     virtual bool MSWCommand(WXUINT param, WXWORD id);
     bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
     virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
-
+    bool MSWShouldPreProcessMessage(WXMSG *pMsg);
+    
     WXHWND GetEditHWND() const;
 
     // Standard event handling
index fca1afd0cacb3b1606eb1ea7cdff5e81916cb4ae..e6e3af1bd4a75652bd792d245d929a4b68debfcf 100644 (file)
@@ -367,6 +367,30 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
     return true;
 }
 
+bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg)
+{
+    // prevent command accelerators from stealing editing
+    // hotkeys when we have the focus
+    if (wxIsCtrlDown())
+    {
+        WPARAM vkey = pMsg->wParam;
+        
+        switch (vkey)
+        {
+            case 'C':
+            case 'V':
+            case 'X':
+            case VK_INSERT:
+            case VK_DELETE:
+            case VK_HOME:
+            case VK_END:
+                return false;
+        }
+    }
+    
+    return wxChoice::MSWShouldPreProcessMessage(pMsg);
+}
+
 WXHWND wxComboBox::GetEditHWND() const
 {
     // this function should not be called for wxCB_READONLY controls, it is