X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/427ff66291af2d8dd34ff5ee68c81436997144a1..f9007c324c9b4f6288156dcf0b865090ee0c0c38:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 9f7a20f4e7..d68b00c5bd 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -104,17 +104,7 @@ void wxWindowMac::Init() // generic InitBase(); - // MSW specific - m_doubleClickAllowed = 0; - m_winCaptured = FALSE; - m_isBeingDeleted = FALSE; - - m_useCtl3D = FALSE; - m_mouseInWindow = FALSE; - - m_xThumbSize = 0; - m_yThumbSize = 0; m_backgroundTransparent = FALSE; // as all windows are created with WS_VISIBLE style... @@ -151,7 +141,7 @@ wxWindowMac::~wxWindowMac() } m_isBeingDeleted = TRUE; - + #ifndef __WXUNIVERSAL__ // VS: make sure there's no wxFrame with last focus set to us: for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) @@ -800,25 +790,9 @@ bool wxWindowMac::Show(bool show) if ( !wxWindowBase::Show(show) ) return FALSE; -/* - WindowRef window = (WindowRef) MacGetRootWindow() ; - wxWindowMac* win = wxFindWinFromMacWindow( window ) ; - if ( win == NULL && win->m_isBeingDeleted ) - return FALSE ; -*/ MacSuperShown( show ) ; Refresh() ; -/* - if ( !show ) - { - if ( win && !win->m_isBeingDeleted ) - Refresh() ; - } - else - { - Refresh() ; - } -*/ + return TRUE; } @@ -827,7 +801,7 @@ void wxWindowMac::MacSuperShown( bool show ) wxWindowListNode *node = GetChildren().GetFirst(); while ( node ) { - wxWindowMac *child = (wxWindowMac *)node->GetData(); + wxWindowMac *child = node->GetData(); if ( child->m_isShown ) child->MacSuperShown( show ) ; node = node->GetNext(); @@ -1278,7 +1252,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) { - wxWindowMac *child = (wxWindowMac*)node->GetData(); + wxWindowMac *child = node->GetData(); if (child == m_vScrollBar) continue; if (child == m_hScrollBar) continue; if (child->IsTopLevel()) continue; @@ -1397,21 +1371,6 @@ void wxWindowMac::SetupColours() void wxWindowMac::OnIdle(wxIdleEvent& event) { -/* - // Check if we need to send a LEAVE event - if (m_mouseInWindow) - { - POINT pt; - ::GetCursorPos(&pt); - if (::WindowFromPoint(pt) != (HWND) GetHWND()) - { - // Generate a LEAVE event - m_mouseInWindow = FALSE; - MSWOnMouseLeave(pt.x, pt.y, 0); - } - } -*/ - // This calls the UI-update mechanism (querying windows for // menu/toolbar/control state information) UpdateWindowUI(); @@ -1474,7 +1433,7 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) { - wxWindowMac *child = (wxWindowMac*)node->GetData(); + wxWindowMac *child = node->GetData(); // added the m_isShown test --dmazzoni if ( child->MacGetRootWindow() == window && child->m_isShown ) { @@ -1579,7 +1538,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event) for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) { - wxWindowMac *child = (wxWindowMac*)node->GetData(); + wxWindowMac *child = node->GetData(); if ( child->MacGetRootWindow() == window && child->IsShown() && child->IsEnabled() ) { if (child->MacDispatchMouseEvent(event)) @@ -1717,7 +1676,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSibling { for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) { - wxWindowMac *child = (wxWindowMac*)node->GetData(); + wxWindowMac *child = node->GetData(); if ( !child->IsTopLevel() && child->IsShown() ) { @@ -1740,7 +1699,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSibling bool thisWindowThrough = false ; for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext()) { - wxWindowMac *sibling = (wxWindowMac*)node->GetData(); + wxWindowMac *sibling = node->GetData(); if ( sibling == this ) { thisWindowThrough = true ; @@ -1829,7 +1788,7 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) { // calculate the update region for the child windows by intersecting the window rectangle with our own // passed in update region and then offset it to be client-wise window coordinates again - wxWindowMac *child = (wxWindowMac*)node->GetData(); + wxWindowMac *child = node->GetData(); SetRectRgn( childupdate , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; SectRgn( childupdate , updatergn , childupdate ) ; OffsetRgn( childupdate , -child->m_x , -child->m_y ) ; @@ -1989,7 +1948,7 @@ void wxWindowMac::MacSuperChangedPosition() wxWindowListNode *node = GetChildren().GetFirst(); while ( node ) { - wxWindowMac *child = (wxWindowMac *)node->GetData(); + wxWindowMac *child = node->GetData(); child->MacSuperChangedPosition() ; node = node->GetNext(); } @@ -2002,7 +1961,7 @@ void wxWindowMac::MacTopLevelWindowChangedPosition() wxWindowListNode *node = GetChildren().GetFirst(); while ( node ) { - wxWindowMac *child = (wxWindowMac *)node->GetData(); + wxWindowMac *child = node->GetData(); child->MacTopLevelWindowChangedPosition() ; node = node->GetNext(); } @@ -2084,7 +2043,7 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) if ( event.GetEventType() == wxEVT_RIGHT_DOWN ) { // copied from wxGTK : CS - // generate a "context menu" event: this is similar to wxEVT_RIGHT_UP + // generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN // except that: // // (a) it's a command event and so is propagated to the parent @@ -2093,7 +2052,8 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, this->GetId(), this->ClientToScreen(event.GetPosition())); - this->GetEventHandler()->ProcessEvent(evtCtx); + if ( ! GetEventHandler()->ProcessEvent(evtCtx) ) + event.Skip() ; } else {