X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af79c52df0b598b13e6be4abb8a27b5687d19022..5e6a0e831533f031463477e11fd9e2c91f56bbbc:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 71e501dbcc..d4ec3f017a 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -30,36 +30,36 @@ #include "wx/clipbrd.h" #include "wx/msw/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) -#endif bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { - if (param == CBN_SELCHANGE) - { - if (GetSelection() > -1) + switch ( param ) { - wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId); - event.SetInt(GetSelection()); - event.SetEventObject(this); - event.SetString(GetStringSelection()); - ProcessCommand(event); + case CBN_SELCHANGE: + if (GetSelection() > -1) + { + wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId()); + event.SetInt(GetSelection()); + event.SetEventObject(this); + event.SetString(GetStringSelection()); + ProcessCommand(event); + } + break; + + case CBN_EDITCHANGE: + { + wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); + event.SetString(GetValue()); + event.SetEventObject(this); + ProcessCommand(event); + } + break; } - return TRUE; - } - else if (param == CBN_EDITCHANGE) - { - wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString(GetValue()); - event.SetEventObject(this); - ProcessCommand(event); - - return TRUE; - } - else - return FALSE; + // there is no return value for the CBN_ notifications, so always return + // FALSE from here to pass the message to DefWindowProc() + return FALSE; } bool wxComboBox::Create(wxWindow *parent, wxWindowID id,