X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3bce55ac0616ee67dbf92e932a0eb6d4ed074b56..4fe41ce6250fd9ba3632f532574e671839afb595:/src/msw/combobox.cpp?ds=sidebyside diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 520e547064..d85ef7e887 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "combobox.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -328,7 +324,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) return false; } -bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) +bool wxComboBox::MSWCommand(WXUINT param, WXWORD id) { wxString value; int sel = -1; @@ -398,10 +394,14 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) ProcessCommand(event); } break; + + default: + return wxChoice::MSWCommand(param, id); } - // there is no return value for the CBN_ notifications, so always return - // false from here to pass the message to DefWindowProc() + // let the def window proc have it by returning false, but do not pass the + // message we've already handled here (notably CBN_SELCHANGE) to the base + // class as it would generate another event for them return false; } @@ -574,7 +574,7 @@ bool wxComboBox::CanUndo() const { if (!IsEditable()) return false; - + HWND hEditWnd = (HWND) GetEditHWND() ; if ( hEditWnd ) return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0; @@ -586,7 +586,7 @@ bool wxComboBox::CanRedo() const { if (!IsEditable()) return false; - + HWND hEditWnd = (HWND) GetEditHWND() ; if ( hEditWnd ) return ::SendMessage(hEditWnd, EM_CANUNDO, 0, 0) != 0; @@ -697,6 +697,10 @@ void wxComboBox::Replace(long from, long to, const wxString& value) // Paste into edit control SendMessage(GetHwnd(), WM_PASTE, (WPARAM)0, (LPARAM)0L); +#else + wxUnusedVar(from); + wxUnusedVar(to); + wxUnusedVar(value); #endif } @@ -744,6 +748,13 @@ int wxComboBox::GetSelection() const return wxChoice::GetSelection(); } +void wxComboBox::Clear() +{ + wxChoice::Clear(); + m_selectionOld = -1; + m_value.clear(); +} + // ---------------------------------------------------------------------------- // standard event handling // ----------------------------------------------------------------------------