From e1b7677ee67f9a2e2eb388ebd0d5a012c42cc801 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 14 Oct 2008 09:31:10 +0000 Subject: [PATCH] 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 --- src/osx/choice_osx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 1481b1419c..4bc08e371b 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -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() ) -- 2.45.2