X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6fc052ae5c77cbf627d9d5f076ad93cd3a3e5a5..0286d08d1453506f9ff9a830d58b3b35817d0b14:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 89130b4e3c..f347cfe1b9 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -122,8 +122,8 @@ bool wxComboListBox::Create(wxWindow* parent) if ( !wxListBox::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, - wxBORDER_SIMPLE | wxLB_INT_HEIGHT | - m_combo->GetWindowStyle() & wxCB_SORT ? wxLB_SORT : 0) ) + wxBORDER_SIMPLE | + ( m_combo->GetWindowStyle() & wxCB_SORT ? wxLB_SORT : 0 ) ) ) return false; // we don't react to the mouse events outside the window at all @@ -389,8 +389,12 @@ void wxComboBox::SetSelection(int n) wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") ); GetLBox()->SetSelection(n); - if ( GetTextCtrl() ) - GetTextCtrl()->SetValue(GetLBox()->GetString(n)); + + wxString str; + if ( n != wxNOT_FOUND ) + str = GetLBox()->GetString(n); + + SetText(str); } int wxComboBox::GetSelection() const