X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c51a665c649f7579fb39e62070cef4f66b3210d..4e15d1caa03346c126015019c1fdf093033ef40b:/src/univ/combobox.cpp?ds=inline diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 95df6afad4..e41adaa761 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -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); }