X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f885b81573978dcd087ba036f8e93e06280ee419..7ad25aed02fa53612cd94a422904667c46fafcbb:/src/mac/carbon/notebmac.cpp?ds=sidebyside diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 74e38246e6..4dc955d76e 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -325,10 +325,10 @@ bool wxNotebook::InsertPage(size_t nPage, int wxNotebook::HitTest(const wxPoint& pt, long * flags) const { - int resultV = wxNOT_FOUND; + int resultV = wxNOT_FOUND; #if TARGET_API_MAC_OSX - const size_t countPages = GetPageCount(); - + const int countPages = GetPageCount(); + HIPoint hipoint= { pt.x , pt.y } ; HIViewPartCode outPart = 0 ; OSStatus err = HIViewGetPartHit ( @@ -336,49 +336,49 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const &hipoint , &outPart ); - - int max = HIViewGetMaximum( m_peer->GetControlRef() ) ; + + int max = m_peer->GetMaximum() ; if ( outPart == 0 && max > 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 .. - int val = HIViewGetValue( m_peer->GetControlRef() ) ; + int val = m_peer->GetValue() ; int maxval = max ; if ( max == 1 ) { - HIViewSetMaximum( m_peer->GetControlRef() , 2 ) ; + m_peer->SetMaximum( 2 ) ; maxval = 2 ; } if ( val == 1 ) - HIViewSetValue(m_peer->GetControlRef() , maxval ) ; + m_peer->SetValue( maxval ) ; else - HIViewSetValue(m_peer->GetControlRef() , 1 ) ; - - err = HIViewGetPartHit ( - m_peer->GetControlRef() , - &hipoint , - &outPart - ); - - HIViewSetValue(m_peer->GetControlRef() , val ) ; + m_peer->SetValue( 1 ) ; + + err = HIViewGetPartHit ( + m_peer->GetControlRef() , + &hipoint , + &outPart + ); + + m_peer->SetValue( val ) ; if ( max == 1 ) { - HIViewSetMaximum( m_peer->GetControlRef() , 1 ) ; + m_peer->SetMaximum( 1 ) ; } } - - if ( outPart >= 1 && (size_t)outPart <= countPages ) + + if ( outPart >= 1 && outPart <= countPages ) { resultV = outPart ; - } + } #endif // TARGET_API_MAC_OSX if (flags != NULL) { *flags = 0; - + // we cannot differentiate better if (resultV >= 1) *flags |= wxNB_HITTEST_ONLABEL;