Fix off-by-1 error in wxChoice and wxComboBox (OSX reports 1 as 0)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -169,7 +169,7 @@ void wxChoice::DoClear()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
int wxChoice::GetSelection() const
|
int wxChoice::GetSelection() const
|
||||||
{
|
{
|
||||||
return m_peer->GetValue() ;
|
return m_peer->GetValue() -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxChoice::SetSelection( int n )
|
void wxChoice::SetSelection( int n )
|
||||||
@@ -241,7 +241,7 @@ bool wxChoice::HandleClicked( double timestampsec )
|
|||||||
event.SetInt( n );
|
event.SetInt( n );
|
||||||
event.SetString( GetStringSelection() );
|
event.SetString( GetStringSelection() );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
|
|
||||||
if ( HasClientObjectData() )
|
if ( HasClientObjectData() )
|
||||||
event.SetClientObject( GetClientObject( n ) );
|
event.SetClientObject( GetClientObject( n ) );
|
||||||
else if ( HasClientUntypedData() )
|
else if ( HasClientUntypedData() )
|
||||||
|
|||||||
Reference in New Issue
Block a user