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:
Robert Roebling 2008-10-14 09:31:10 +00:00
parent 8ba80c6f83
commit e1b7677ee6

View File

@ -169,7 +169,7 @@ void wxChoice::DoClear()
// ----------------------------------------------------------------------------
int wxChoice::GetSelection() const
{
return m_peer->GetValue() ;
return m_peer->GetValue() -1;
}
void wxChoice::SetSelection( int n )
@ -241,7 +241,7 @@ bool wxChoice::HandleClicked( double timestampsec )
event.SetInt( n );
event.SetString( GetStringSelection() );
event.SetEventObject( this );
if ( HasClientObjectData() )
event.SetClientObject( GetClientObject( n ) );
else if ( HasClientUntypedData() )