X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7810c95b5de52447a5c2c8aaed06f287e02fc690..71e483d39adbc1c80ef2fa998bd7f18e1704440c:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 78cbd8ca19..7d4ce35592 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -15,6 +15,7 @@ #include "wx/setup.h" #include "wx/menu.h" +#include "wx/window.h" #include "wx/dc.h" #include "wx/dcclient.h" #include "wx/utils.h" @@ -33,9 +34,6 @@ #include "wx/tabctrl.h" #include "wx/tooltip.h" #include "wx/statusbr.h" -// TODO remove the line below, just for lookup-up convenience CS -#include "wx/window.h" - #include "wx/menuitem.h" #include "wx/log.h" @@ -110,11 +108,15 @@ void wxRemoveMacWindowAssociation(wxWindow *win) // constructors and such // ---------------------------------------------------------------------------- +WindowRef wxWindow::s_macWindowInUpdate = NULL; + void wxWindow::Init() { // generic InitBase(); + m_macEraseOnRedraw = true ; + // MSW specific m_doubleClickAllowed = 0; m_winCaptured = FALSE; @@ -132,6 +134,7 @@ void wxWindow::Init() m_isShown = TRUE; m_macWindowData = NULL ; + m_macEraseOnRedraw = true ; m_x = 0; m_y = 0 ; @@ -763,6 +766,11 @@ void wxWindow::MacSuperShown( bool show ) bool wxWindow::MacIsReallyShown() const { + if ( m_isShown && (m_parent != NULL) ) { + return m_parent->MacIsReallyShown(); + } + return m_isShown; +/* bool status = m_isShown ; wxWindow * win = this ; while ( status && win->m_parent != NULL ) @@ -771,6 +779,7 @@ bool wxWindow::MacIsReallyShown() const status = win->m_isShown ; } return status ; +*/ } int wxWindow::GetCharHeight() const @@ -794,7 +803,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, wxClientDC dc( (wxWindow*) this ) ; long lx,ly,ld,le ; - dc.GetTextExtent( string , &lx , &ly , &ld, &le, fontToUse ) ; + dc.GetTextExtent( string , &lx , &ly , &ld, &le, (wxFont *)fontToUse ) ; if ( externalLeading ) *externalLeading = le ; if ( descent ) @@ -807,6 +816,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y, void wxWindow::MacEraseBackground( Rect *rect ) { +/* WindowRef window = GetMacRootWindow() ; if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE) ) { @@ -874,6 +884,7 @@ void wxWindow::MacEraseBackground( Rect *rect ) } } } +*/ } void wxWindow::Refresh(bool eraseBack, const wxRect *rect) @@ -1083,23 +1094,10 @@ void wxWindow::MacCreateRealWindow( const wxString& title, { wclass = kMovableModalWindowClass ; } - else if ( HasFlag( wxDIALOG_MODELESS ) ) + else { wclass = kDocumentWindowClass ; } - /* - else - { - if ( HasFlag( wxCAPTION ) ) - { - wclass = kDocumentWindowClass ; - } - else - { - wclass = kModalWindowClass ; - } - } - */ } else { @@ -1756,7 +1754,7 @@ void wxWindow::MacMouseMoved( EventRecord *ev , short part) } void wxWindow::MacActivate( EventRecord *ev , bool inIsActivating ) { - wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating); + wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId); event.m_timeStamp = ev->when ; event.SetEventObject(this); @@ -1836,8 +1834,10 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time) if ( GetParent() && m_backgroundColour != GetParent()->GetBackgroundColour() ) eraseBackground = true ; SetClip( updatergn ) ; - if ( eraseBackground ) + if ( eraseBackground && m_macEraseOnRedraw ) { + // todo : find a clever algorithm, which only will do this + // if really necessary EraseRgn( updatergn ) ; } }