diff --git a/docs/changes.txt b/docs/changes.txt index c32ef0534c..a4cc9f2f3a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -473,6 +473,11 @@ OSX: - Provide native implementations of wxDatePickerCtrl and wxTimePickerCtrl. +Univ: + +- Fix regression with read-only wxComboBox appearance (Jason Erb). + + 2.9.3: (released 2011-12-14) ------ diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 0cfcbcdd71..e41adaa761 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -273,13 +273,15 @@ wxComboBox::~wxComboBox() wxString wxComboBox::DoGetValue() const { - return GetTextCtrl() ? GetTextCtrl()->GetValue() : wxString(); + return GetTextCtrl() ? GetTextCtrl()->GetValue() : m_valueString; } void wxComboBox::SetValue(const wxString& value) { if ( GetTextCtrl() ) GetTextCtrl()->SetValue(value); + else + m_valueString = value; } void wxComboBox::WriteText(const wxString& value) @@ -358,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) @@ -366,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); }