X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f11220943f14b4bb5190db0dfd0054304f5015c..d1d7cdff87c64552187e1984d86c8f7a8b94fdb7:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index ab5eb3ef41..f7eff22ed6 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -41,21 +41,22 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, m_windowId); event.SetInt(GetSelection()); event.SetEventObject(this); - event.SetString(copystring(GetStringSelection())); + event.SetString(GetStringSelection()); ProcessCommand(event); - delete[] event.GetString(); + return TRUE; } else if (param == CBN_EDITCHANGE) { wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, m_windowId); - event.SetString(copystring(GetValue())); + event.SetString(GetValue()); event.SetEventObject(this); ProcessCommand(event); - delete[] event.GetString(); + return TRUE; } - else return FALSE; + else + return FALSE; } bool wxComboBox::Create(wxWindow *parent, wxWindowID id, @@ -72,7 +73,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if (parent) parent->AddChild(this); SetBackgroundColour(parent->GetBackgroundColour()) ; SetForegroundColour(parent->GetForegroundColour()) ; - m_noStrings = n; + m_noStrings = 0; m_windowStyle = style; @@ -107,12 +108,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if ( want3D || wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - m_hWnd = (WXHWND)::CreateWindowEx(exStyle, "COMBOBOX", NULL, + m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("COMBOBOX"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, "Failed to create combobox" ); + wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create combobox") ); /* #if wxUSE_CTL3D @@ -163,7 +164,7 @@ void wxComboBox::SetValue(const wxString& value) } if (singletons > 0) { - char *tmp = new char[len + singletons + 1]; + wxChar *tmp = new wxChar[len + singletons + 1]; int j = 0; for (i = 0; i < len; i ++) { @@ -180,7 +181,7 @@ void wxComboBox::SetValue(const wxString& value) delete[] tmp; } else - SetWindowText((HWND) GetHWND(), (const char *)value); + SetWindowText((HWND) GetHWND(), (const wxChar *)value); } // Clipboard operations @@ -277,7 +278,7 @@ void wxComboBox::Replace(long from, long to, const wxString& value) SendMessage(hWnd, WM_CUT, (WPARAM)0, (LPARAM)0); // Now replace with 'value', by pasting. - wxSetClipboardData(wxDF_TEXT, (wxObject *)(const char *)value, 0, 0); + wxSetClipboardData(wxDF_TEXT, (wxObject *)(const wxChar *)value, 0, 0); // Paste into edit control SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L);