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)
|
void wxComboBox::SetSelection (int n)
|
||||||
{
|
{
|
||||||
#ifdef LESSTIF_VERSION
|
#if wxCHECK_LESSTIF()
|
||||||
XmListSelectPos (GetXmList(this), n + 1, false);
|
XmListSelectPos (GetXmList(this), n + 1, false);
|
||||||
SetValue(GetString(n));
|
SetValue(GetString(n));
|
||||||
#else
|
#else
|
||||||
|
#if 0
|
||||||
wxXmString str( GetString(n).c_str() );
|
wxXmString str( GetString(n).c_str() );
|
||||||
XmComboBoxSelectItem((Widget) m_mainWidget, str());
|
XmComboBoxSelectItem((Widget) m_mainWidget, str());
|
||||||
#if 0
|
|
||||||
// does it work for Motif
|
|
||||||
XtVaSetValues( (Widget)m_mainWidget,
|
|
||||||
XmNselectedPosition, n + 1,
|
|
||||||
NULL );
|
|
||||||
#endif
|
#endif
|
||||||
|
XtVaSetValues( (Widget)m_mainWidget,
|
||||||
|
XmNselectedPosition, n,
|
||||||
|
NULL );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +459,7 @@ wxString wxDoGetStringInList( Widget listBox, int n )
|
|||||||
XmNitemCount, &count,
|
XmNitemCount, &count,
|
||||||
XmNitems, &strlist,
|
XmNitems, &strlist,
|
||||||
NULL );
|
NULL );
|
||||||
if( n <= count && n >= 0 )
|
if( n < count && n >= 0 )
|
||||||
return wxXmStringToString( strlist[n] );
|
return wxXmStringToString( strlist[n] );
|
||||||
else
|
else
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
|
Loading…
Reference in New Issue
Block a user