From: Vadim Zeitlin Date: Sat, 23 Feb 2008 00:19:18 +0000 (+0000) Subject: remove MacIsReallyShown() as we now have public IsShownOnScreen() doing exactly the... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/841e47cfd74743bc6bf9f44e729badc3f8051872 remove MacIsReallyShown() as we now have public IsShownOnScreen() doing exactly the same thing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/carbon/window.h b/include/wx/mac/carbon/window.h index 081877162b..d2f9a85ca1 100644 --- a/include/wx/mac/carbon/window.h +++ b/include/wx/mac/carbon/window.h @@ -195,7 +195,6 @@ public: virtual void MacHiliteChanged() ; virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ; - bool MacIsReallyShown() ; bool MacIsReallyEnabled() ; bool MacIsReallyHilited() ; diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index 07fda36591..5fe1661ddd 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -415,7 +415,7 @@ void wxGLCanvas::MacTopLevelWindowChangedPosition() void wxGLCanvas::MacVisibilityChanged() { - if ( MacIsReallyShown() != m_macCanvasIsShown ) + if ( IsShownOnScreen() != m_macCanvasIsShown ) { m_macCanvasIsShown = !m_macCanvasIsShown; MacUpdateView(); diff --git a/src/mac/carbon/mediactrl.cpp b/src/mac/carbon/mediactrl.cpp index 639114a1f1..9d525f5b59 100644 --- a/src/mac/carbon/mediactrl.cpp +++ b/src/mac/carbon/mediactrl.cpp @@ -1101,7 +1101,7 @@ void wxQTMediaBackend::MacVisibilityChanged() if(!m_mc || !m_ctrl->m_bLoaded) return; //not initialized yet - if(m_ctrl->MacIsReallyShown()) + if(m_ctrl->IsShownOnScreen()) { //The window is being shown again, so set the GWorld of the //controller back to the port of the parent WindowRef diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index a8bcfbdef9..2d443c09b2 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -486,7 +486,7 @@ void wxTextCtrl::MacSuperChangedPosition() void wxTextCtrl::MacVisibilityChanged() { - GetPeer()->VisibilityChanged( MacIsReallyShown() ) ; + GetPeer()->VisibilityChanged( IsShownOnScreen() ) ; } void wxTextCtrl::MacCheckSpelling(bool check) @@ -2562,7 +2562,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 WXUNUSED(thePar if ( textctrl == NULL ) return ; - if ( textctrl->MacIsReallyShown() ) + if ( textctrl->IsShownOnScreen() ) { wxMacWindowClipper clipper( textctrl ) ; TXNDraw( m_txn , NULL ) ; @@ -2575,7 +2575,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt1 ControlPartCode result = kControlNoPart; wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef ); - if ( (textctrl != NULL) && textctrl->MacIsReallyShown() ) + if ( (textctrl != NULL) && textctrl->IsShownOnScreen() ) { if (PtInRect( where, &m_txnControlBounds )) { @@ -2602,7 +2602,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxIn ControlPartCode result = kControlNoPart; wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference( m_controlRef ); - if ( (textctrl != NULL) && textctrl->MacIsReallyShown() ) + if ( (textctrl != NULL) && textctrl->IsShownOnScreen() ) { Point startPt = { y , x } ; @@ -2638,7 +2638,7 @@ void wxMacMLTEClassicControl::MacControlUserPaneIdleProc() if ( textctrl == NULL ) return ; - if (textctrl->MacIsReallyShown()) + if (textctrl->IsShownOnScreen()) { if (IsControlActive(m_controlRef)) { @@ -2744,7 +2744,7 @@ wxMacMLTEClassicControl::wxMacMLTEClassicControl( wxTextCtrl *wxPeer, AdjustCreationAttributes( *wxWHITE , true ) ; - MacSetObjectVisibility( wxPeer->MacIsReallyShown() ) ; + MacSetObjectVisibility( wxPeer->IsShownOnScreen() ) ; { wxString st = str ; diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 9e1334d4ce..76ad793476 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -1108,7 +1108,7 @@ void wxWindowMac::MacUpdateControlFont() { m_peer->SetFont( GetFont() , GetForegroundColour() , GetWindowStyle() ) ; // do not trigger refreshes upon invisible and possible partly created objects - if ( MacIsReallyShown() ) + if ( IsShownOnScreen() ) Refresh() ; } @@ -1673,7 +1673,7 @@ void wxWindowMac::MacInvalidateBorders() if ( m_peer == NULL ) return ; - bool vis = MacIsReallyShown() ; + bool vis = IsShownOnScreen() ; if ( !vis ) return ; @@ -1942,7 +1942,7 @@ void wxWindowMac::SetLabel(const wxString& title) m_peer->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics) ) ; // do not trigger refreshes upon invisible and possible partly created objects - if ( MacIsReallyShown() ) + if ( IsShownOnScreen() ) Refresh() ; } @@ -1988,31 +1988,6 @@ void wxWindowMac::MacEnabledStateChanged() // status queries on the inherited window's state // -bool wxWindowMac::MacIsReallyShown() -{ - // only under OSX the visibility of the TLW is taken into account - if ( m_isBeingDeleted ) - return false ; - -#if TARGET_API_MAC_OSX - if ( m_peer && m_peer->Ok() ) - return m_peer->IsVisible(); -#endif - - wxWindow* win = this ; - while ( win->IsShown() ) - { - if ( win->IsTopLevel() ) - return true ; - - win = win->GetParent() ; - if ( win == NULL ) - return true ; - } - - return false ; -} - bool wxWindowMac::MacIsReallyEnabled() { return m_peer->IsEnabled() ; @@ -2074,7 +2049,7 @@ void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect) if ( m_peer == NULL ) return ; - if ( !MacIsReallyShown() ) + if ( !IsShownOnScreen() ) return ; if ( rect ) @@ -2614,7 +2589,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool includeOuterStructures ) { static wxRegion emptyrgn ; - if ( !m_isBeingDeleted && MacIsReallyShown() /*m_peer->IsVisible() */ ) + if ( !m_isBeingDeleted && IsShownOnScreen() ) { MacUpdateClippedRects() ; if ( includeOuterStructures ) @@ -3222,5 +3197,10 @@ wxByte wxWindowMac::GetTransparent() const bool wxWindowMac::IsShownOnScreen() const { - return ((wxWindowMac*)this)->MacIsReallyShown(); +#if TARGET_API_MAC_OSX + if ( m_peer && m_peer->Ok() ) + return m_peer->IsVisible(); +#endif + + return wxWindowBase::IsShownOnScreen(); }