X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/08422003083270640e23c2563a5fa72d131add96..7d8268a1d64de58aab194e4d8ae800c755990aad:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 313f6f0b19..ae3ead93cb 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2018,6 +2018,9 @@ void wxWindowMac::MacEnabledStateChanged() 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(); @@ -2509,29 +2512,29 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) void wxWindowMac::MacOnScroll(wxScrollEvent &event ) { - if ( event.m_eventObject == m_vScrollBar || event.m_eventObject == m_hScrollBar ) + if ( event.GetEventObject() == m_vScrollBar || event.GetEventObject() == m_hScrollBar ) { wxScrollWinEvent wevent; wevent.SetPosition(event.GetPosition()); wevent.SetOrientation(event.GetOrientation()); - wevent.m_eventObject = this; - - if (event.m_eventType == wxEVT_SCROLL_TOP) - wevent.m_eventType = wxEVT_SCROLLWIN_TOP; - else if (event.m_eventType == wxEVT_SCROLL_BOTTOM) - wevent.m_eventType = wxEVT_SCROLLWIN_BOTTOM; - else if (event.m_eventType == wxEVT_SCROLL_LINEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEUP; - else if (event.m_eventType == wxEVT_SCROLL_LINEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_PAGEUP) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEUP; - else if (event.m_eventType == wxEVT_SCROLL_PAGEDOWN) - wevent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN; - else if (event.m_eventType == wxEVT_SCROLL_THUMBTRACK) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK; - else if (event.m_eventType == wxEVT_SCROLL_THUMBRELEASE) - wevent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE; + wevent.SetEventObject(this); + + if (event.GetEventType() == wxEVT_SCROLL_TOP) + wevent.SetEventType( wxEVT_SCROLLWIN_TOP ); + else if (event.GetEventType() == wxEVT_SCROLL_BOTTOM) + wevent.SetEventType( wxEVT_SCROLLWIN_BOTTOM ); + else if (event.GetEventType() == wxEVT_SCROLL_LINEUP) + wevent.SetEventType( wxEVT_SCROLLWIN_LINEUP ); + else if (event.GetEventType() == wxEVT_SCROLL_LINEDOWN) + wevent.SetEventType( wxEVT_SCROLLWIN_LINEDOWN ); + else if (event.GetEventType() == wxEVT_SCROLL_PAGEUP) + wevent.SetEventType( wxEVT_SCROLLWIN_PAGEUP ); + else if (event.GetEventType() == wxEVT_SCROLL_PAGEDOWN) + wevent.SetEventType( wxEVT_SCROLLWIN_PAGEDOWN ); + else if (event.GetEventType() == wxEVT_SCROLL_THUMBTRACK) + wevent.SetEventType( wxEVT_SCROLLWIN_THUMBTRACK ); + else if (event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE) + wevent.SetEventType( wxEVT_SCROLLWIN_THUMBRELEASE ); GetEventHandler()->ProcessEvent(wevent); } @@ -2731,7 +2734,7 @@ wxRegion wxWindowMac::MacGetVisibleRegion( bool includeOuterStructures ) Rect r ; RgnHandle visRgn = NewRgn() ; RgnHandle tempRgn = NewRgn() ; - if ( m_peer->IsVisible()) + if ( !m_isBeingDeleted && m_peer->IsVisible()) { m_peer->GetRect( &r ) ; r.left -= MacGetLeftBorderSize() ; @@ -2842,7 +2845,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time ) { // paint the window itself wxPaintEvent event; - event.m_timeStamp = time ; + event.SetTimestamp(time); event.SetEventObject(this); handled = GetEventHandler()->ProcessEvent(event);