using backward compatible calls for HitTest hack

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2005-11-22 17:54:16 +00:00
parent 2c62259349
commit 0df4335d4d

View File

@@ -327,7 +327,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const
{ {
int resultV = wxNOT_FOUND; int resultV = wxNOT_FOUND;
#if TARGET_API_MAC_OSX #if TARGET_API_MAC_OSX
const size_t countPages = GetPageCount(); const int countPages = GetPageCount();
HIPoint hipoint= { pt.x , pt.y } ; HIPoint hipoint= { pt.x , pt.y } ;
HIViewPartCode outPart = 0 ; HIViewPartCode outPart = 0 ;
@@ -337,35 +337,35 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const
&outPart &outPart
); );
int max = HIViewGetMaximum( m_peer->GetControlRef() ) ; int max = m_peer->GetMaximum() ;
if ( outPart == 0 && max > 0 ) if ( outPart == 0 && max > 0 )
{ {
// this is a hack, as unfortunately a hit on an already selected tab returns 0, // this is a hack, as unfortunately a hit on an already selected tab returns 0,
// so we have to go some extra miles to make sure we select something different // so we have to go some extra miles to make sure we select something different
// and try again .. // and try again ..
int val = HIViewGetValue( m_peer->GetControlRef() ) ; int val = m_peer->GetValue() ;
int maxval = max ; int maxval = max ;
if ( max == 1 ) if ( max == 1 )
{ {
HIViewSetMaximum( m_peer->GetControlRef() , 2 ) ; m_peer->SetMaximum( 2 ) ;
maxval = 2 ; maxval = 2 ;
} }
if ( val == 1 ) if ( val == 1 )
HIViewSetValue(m_peer->GetControlRef() , maxval ) ; m_peer->SetValue( maxval ) ;
else else
HIViewSetValue(m_peer->GetControlRef() , 1 ) ; m_peer->SetValue( 1 ) ;
err = HIViewGetPartHit ( err = HIViewGetPartHit (
m_peer->GetControlRef() , m_peer->GetControlRef() ,
&hipoint , &hipoint ,
&outPart &outPart
); );
HIViewSetValue(m_peer->GetControlRef() , val ) ; m_peer->SetValue( val ) ;
if ( max == 1 ) if ( max == 1 )
{ {
HIViewSetMaximum( m_peer->GetControlRef() , 1 ) ; m_peer->SetMaximum( 1 ) ;
} }
} }