]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix off-by-1 error in wxChoice and wxComboBox (OSX reports 1 as 0)
authorRobert Roebling <robert@roebling.de>
Tue, 14 Oct 2008 09:31:10 +0000 (09:31 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 14 Oct 2008 09:31:10 +0000 (09:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/choice_osx.cpp

index 1481b1419cf06f34c5524fb2345895295116e2e7..4bc08e371bfb81f05d3bf851384f33b1093f12b7 100644 (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() )