X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba87f54c0da98e069348612a9f4bef92c6798091..5974c3cf0664c2db575ee956a731a0ae7c96d074:/src/mac/carbon/window.cpp diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index e426ed86b9..e75ae84a2f 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -100,10 +100,6 @@ END_EVENT_TABLE() void wxWindowMac::Init() { - // generic - InitBase(); - - m_isBeingDeleted = FALSE; m_backgroundTransparent = FALSE; // as all windows are created with WS_VISIBLE style... @@ -116,8 +112,6 @@ void wxWindowMac::Init() m_hScrollBar = NULL ; m_vScrollBar = NULL ; - - m_label = wxEmptyString; } // Destructor @@ -174,15 +168,8 @@ wxWindowMac::~wxWindowMac() gFocusWindow = NULL ; } - // CS: copied from MSW : - // VS: destroy children first and _then_ detach *this from its parent. - // If we'd do it the other way around, children wouldn't be able - // find their parent frame (see above). DestroyChildren(); - if ( m_parent ) - m_parent->RemoveChild(this); - // delete our drop target if we've got one #if wxUSE_DRAG_AND_DROP if ( m_dropTarget != NULL ) @@ -231,6 +218,10 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id, MacCreateScrollBars( style ) ; } #endif + + wxWindowCreateEvent event(this); + GetEventHandler()->ProcessEvent(event); + return TRUE; } @@ -634,7 +625,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height) bool partialRepaint = false ; - if ( HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) ) + if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) ) { wxPoint oldPos( m_x , m_y ) ; wxPoint newPos( actualX , actualY ) ; @@ -1192,10 +1183,11 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) if( dx == 0 && dy ==0 ) return ; - wxClientDC dc(this) ; - wxMacPortSetter helper(&dc) ; { + wxClientDC dc(this) ; + wxMacPortSetter helper(&dc) ; + int width , height ; GetClientSize( &width , &height ) ; @@ -1218,7 +1210,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) GetWindowUpdateRgn( rootWindow , formerUpdateRgn ) ; Point pt = {0,0} ; LocalToGlobal( &pt ) ; - OffsetRgn( updateRgn , -pt.h , -pt.v ) ; + OffsetRgn( formerUpdateRgn , -pt.h , -pt.v ) ; SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ; if ( !EmptyRgn( formerUpdateRgn ) ) { @@ -1559,7 +1551,6 @@ void wxWindowMac::Update() ::SetPort( UMAGetWindowPort( rootWindow ) ) ; Point pt = {0,0} ; LocalToGlobal( &pt ) ; - ::GlobalToLocal( &pt ) ; ::SetPort( port ) ; OffsetRgn( updateRgn , -pt.h , -pt.v ) ; // translate to window local coordinates @@ -1733,10 +1724,32 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase) DisposeRgn( ownUpdateRgn ) ; if ( !m_updateRegion.Empty() ) { + wxWindowList hiddenWindows ; + for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext()) + { + wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; + + if ( child && child->MacGetRootWindow() == window && child->IsShown() && child->GetMacControl() ) + { + SetControlVisibility( (ControlHandle) child->GetMacControl() , false , false ) ; + hiddenWindows.Append( child ) ; + } + } + wxPaintEvent event; event.m_timeStamp = time ; event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); + + for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext()) + { + wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ; + + if ( child && child->GetMacControl() ) + { + SetControlVisibility( (ControlHandle) child->GetMacControl() , true , false ) ; + } + } } }