X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/339e9747d26ed4cef83de1e50b5313c2aed8d443..fb8d7eb7a880f1f2e32d8830f9c5e12b2536e05f:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index d738b49f7c..9d4118eaa2 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -180,7 +180,7 @@ void wxComboListBox::OnLeftUp(wxMouseEvent& event) m_combo->SetValue(wxListBox::GetStringSelection()); // next let the user code have the event - wxCommandEvent evt(wxEVT_COMMAND_COMBOBOX_SELECTED,m_combo->GetId()); + wxCommandEvent evt(wxEVT_COMBOBOX,m_combo->GetId()); evt.SetInt(wxListBox::GetSelection()); evt.SetEventObject(m_combo); m_combo->ProcessWindowEvent(evt); @@ -273,12 +273,15 @@ wxComboBox::~wxComboBox() wxString wxComboBox::DoGetValue() const { - return wxComboCtrl::GetValue(); + return GetTextCtrl() ? GetTextCtrl()->GetValue() : m_valueString; } void wxComboBox::SetValue(const wxString& value) { - wxComboCtrl::SetValue(value); + if ( GetTextCtrl() ) + GetTextCtrl()->SetValue(value); + else + m_valueString = value; } void wxComboBox::WriteText(const wxString& value) @@ -357,7 +360,7 @@ void wxComboBox::SetEditable(bool editable) void wxComboBox::DoClear() { GetLBox()->Clear(); - if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString); + SetValue(wxEmptyString); } void wxComboBox::DoDeleteOneItem(unsigned int n) @@ -365,7 +368,7 @@ void wxComboBox::DoDeleteOneItem(unsigned int n) wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") ); if (GetSelection() == (int)n) - if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString); + SetValue(wxEmptyString); GetLBox()->Delete(n); } @@ -409,7 +412,7 @@ void wxComboBox::SetSelection(int n) int wxComboBox::GetSelection() const { -#if 1 // FIXME:: What is the correct behavior? +#if 1 // FIXME:: What is the correct behaviour? // if the current value isn't one of the listbox strings, return -1 return GetLBox()->GetSelection(); #else