X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..b3031762e87338b20e682af9278731aec1d123c6:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 5c7888dab5..1b795f43e6 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -34,11 +34,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl) #endif -bool wxComboBox::MSWCommand(const WXUINT param, const WXWORD WXUNUSED(id)) +bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) { if (param == CBN_SELCHANGE) { - wxCommandEvent event(wxEVENT_TYPE_COMBOBOX_COMMAND, m_windowId); + wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId); event.SetInt(GetSelection()); event.SetEventObject(this); event.SetString(copystring(GetStringSelection())); @@ -46,15 +46,24 @@ bool wxComboBox::MSWCommand(const WXUINT param, const WXWORD WXUNUSED(id)) delete[] event.GetString(); return TRUE; } + else if (param == CBN_EDITCHANGE) + { + wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); + event.SetString(copystring(GetValue())); + event.SetEventObject(this); + ProcessCommand(event); + delete[] event.GetString(); + return TRUE; + } else return FALSE; } -bool wxComboBox::Create(wxWindow *parent, const wxWindowID id, +bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, - const int n, const wxString choices[], - const long style, + int n, const wxString choices[], + long style, const wxValidator& validator, const wxString& name) { @@ -63,7 +72,7 @@ bool wxComboBox::Create(wxWindow *parent, const wxWindowID id, if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetDefaultBackgroundColour()) ; SetForegroundColour(parent->GetDefaultForegroundColour()) ; - no_strings = n; + m_noStrings = n; m_windowStyle = style; @@ -188,14 +197,14 @@ void wxComboBox::Paste(void) SendMessage(hWnd, WM_PASTE, 0, 0L); } -void wxComboBox::SetEditable(const bool editable) +void wxComboBox::SetEditable(bool editable) { // Can't implement in MSW? // HWND hWnd = (HWND) GetHWND(); // SendMessage(hWnd, EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L); } -void wxComboBox::SetInsertionPoint(const long pos) +void wxComboBox::SetInsertionPoint(long pos) { /* HWND hWnd = (HWND) GetHWND(); @@ -247,7 +256,7 @@ long wxComboBox::GetLastPosition(void) const return 0; } -void wxComboBox::Replace(const long from, const long to, const wxString& value) +void wxComboBox::Replace(long from, long to, const wxString& value) { #if USE_CLIPBOARD HWND hWnd = (HWND) GetHWND(); @@ -263,14 +272,14 @@ void wxComboBox::Replace(const long from, const long to, const wxString& value) SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0); // Now replace with 'value', by pasting. - wxSetClipboardData(wxCF_TEXT, (wxObject *)(const char *)value, 0, 0); + wxSetClipboardData(wxDF_TEXT, (wxObject *)(const char *)value, 0, 0); // Paste into edit control SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L); #endif } -void wxComboBox::Remove(const long from, const long to) +void wxComboBox::Remove(long from, long to) { HWND hWnd = (HWND) GetHWND(); long fromChar = from; @@ -285,7 +294,7 @@ void wxComboBox::Remove(const long from, const long to) SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0); } -void wxComboBox::SetSelection(const long from, const long to) +void wxComboBox::SetSelection(long from, long to) { HWND hWnd = (HWND) GetHWND(); long fromChar = from;