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
This commit is contained in:
parent
b1ef882100
commit
d40708e2fd
@ -229,18 +229,17 @@ 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
|
||||
XtVaSetValues( (Widget)m_mainWidget,
|
||||
XmNselectedPosition, n + 1,
|
||||
NULL );
|
||||
#endif
|
||||
XtVaSetValues( (Widget)m_mainWidget,
|
||||
XmNselectedPosition, n,
|
||||
NULL );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user