X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c085e333984dc079a001cd3f581aeb1f51a1f227..9a5ccab4315dc06b4b56a57c39fbc35b21f5a9d5:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index db6801a3f3..7f2f67ad41 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; @@ -115,7 +116,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, wxCHECK_MSG( m_hWnd, FALSE, "Failed to create combobox" ); /* -#if CTL3D +#if wxUSE_CTL3D if (want3D) { Ctl3dSubclassCtl(wx_combo); @@ -127,7 +128,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, // Subclass again for purposes of dialog editing mode SubclassWin(m_hWnd); - SetFont(* parent->GetFont()); + SetFont(parent->GetFont()); int i; for (i = 0; i < n; i++) {