X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8cc5e8cff459a829ffd1bdea33ab25717b77bebd..f74a73b36509260f612770de2caeb084f1857e08:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 2283515d56..e6e3af1bd4 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -87,7 +87,7 @@ wxBEGIN_FLAGS( wxComboBoxStyle ) wxEND_FLAGS( wxComboBoxStyle ) -IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h") +IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxChoice,"wx/combobox.h") wxBEGIN_PROPERTIES_TABLE(wxComboBox) wxEVENT_PROPERTY( Select , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent ) @@ -108,7 +108,7 @@ wxCONSTRUCTOR_5( wxComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , #else -IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxChoice) #endif @@ -265,7 +265,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) { if (SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0)) return false; - + wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); const int sel = GetSelection(); @@ -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