From: Mattia Barbon Date: Sun, 16 Mar 2003 20:40:35 +0000 (+0000) Subject: Fixed (native) wxComboBox::SetSelection and X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d40708e2fdd16a37851aacd50b72bc3749c8cb10 Fixed (native) wxComboBox::SetSelection and wxListBox/wxComboBox::GetString. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 9a96177941..498ce2565f 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -229,19 +229,18 @@ void wxComboBox::Clear() void wxComboBox::SetSelection (int n) { -#ifdef LESSTIF_VERSION +#if wxCHECK_LESSTIF() XmListSelectPos (GetXmList(this), n + 1, false); SetValue(GetString(n)); #else +#if 0 wxXmString str( GetString(n).c_str() ); XmComboBoxSelectItem((Widget) m_mainWidget, str()); -#if 0 - // does it work for Motif +#endif XtVaSetValues( (Widget)m_mainWidget, - XmNselectedPosition, n + 1, + XmNselectedPosition, n, NULL ); #endif -#endif } int wxComboBox::GetSelection (void) const diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index dc8cf4c10a..db682d40d4 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -459,7 +459,7 @@ wxString wxDoGetStringInList( Widget listBox, int n ) XmNitemCount, &count, XmNitems, &strlist, NULL ); - if( n <= count && n >= 0 ) + if( n < count && n >= 0 ) return wxXmStringToString( strlist[n] ); else return wxEmptyString;