X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38a5c64e29ab1d081af309a73c7af94069cf799f..8e372bbe071de49935a1a7a910a1b268231de69e:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index dc948b01de..41b73b4478 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -34,16 +34,16 @@ // for wxEVT_COMMAND_TEXT_ENTER #include "wx/textctrl.h" #include "wx/app.h" + #include "wx/brush.h" #endif -#include "wx/brush.h" #include "wx/clipbrd.h" #include "wx/msw/private.h" +// include "properly" +#include "wx/msw/wrapcctl.h" + #if wxUSE_TOOLTIPS - #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__) - #include - #endif #include "wx/tooltip.h" #endif // wxUSE_TOOLTIPS @@ -207,6 +207,13 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, } } break; + + case WM_CUT: + case WM_COPY: + case WM_PASTE: + if( win->HandleClipboardEvent( message ) ) + return 0; + break; } return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam); @@ -259,9 +266,12 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) if ( wParam == VK_RETURN ) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); - InitCommandEvent(event); + + const int sel = GetSelection(); + event.SetInt(sel); event.SetString(GetValue()); - event.SetInt(GetSelection()); + InitCommandEventWithItems(event, sel); + if ( ProcessCommand(event) ) { // don't let the event through to the native control @@ -313,9 +323,10 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id) value = GetStringSelection(); { wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId()); - event.SetEventObject(this); event.SetInt(sel); event.SetString(value); + InitCommandEventWithItems(event, sel); + ProcessCommand(event); } @@ -326,7 +337,6 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id) case CBN_EDITCHANGE: { wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); - event.SetEventObject(this); // if sel != -1, value was already initialized above if ( sel == -1 ) @@ -335,6 +345,8 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id) } event.SetString(value); + InitCommandEventWithItems(event, sel); + ProcessCommand(event); } break;