]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
activate new xpm handler under Classic Mac OS after xpm handler fixes
[wxWidgets.git] / src / mac / carbon / window.cpp
index 382b71024f1d48411f461dc841eba2c322d464b7..b3b459a0d38fd0a9a003d456bac4bed766077580 100644 (file)
@@ -108,11 +108,15 @@ void wxRemoveMacWindowAssociation(wxWindow *win)
 // constructors and such
 // ----------------------------------------------------------------------------
 
 // constructors and such
 // ----------------------------------------------------------------------------
 
+WindowRef wxWindow::s_macWindowInUpdate = NULL;
+
 void wxWindow::Init()
 {
     // generic
     InitBase();
 
 void wxWindow::Init()
 {
     // generic
     InitBase();
 
+    m_macEraseOnRedraw = true ;
+
     // MSW specific
     m_doubleClickAllowed = 0;
     m_winCaptured = FALSE;
     // MSW specific
     m_doubleClickAllowed = 0;
     m_winCaptured = FALSE;
@@ -130,6 +134,7 @@ void wxWindow::Init()
     m_isShown = TRUE;
 
        m_macWindowData = NULL ;
     m_isShown = TRUE;
 
        m_macWindowData = NULL ;
+       m_macEraseOnRedraw = true ;
 
        m_x = 0;
        m_y = 0 ;       
 
        m_x = 0;
        m_y = 0 ;       
@@ -811,6 +816,7 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
 
 void wxWindow::MacEraseBackground( Rect *rect )
 {
 
 void wxWindow::MacEraseBackground( Rect *rect )
 {
+/*
        WindowRef window = GetMacRootWindow() ;
        if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE) )
        {
        WindowRef window = GetMacRootWindow() ;
        if ( m_backgroundColour == wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE) )
        {
@@ -878,6 +884,7 @@ void wxWindow::MacEraseBackground( Rect *rect )
                        }
                }
        }
                        }
                }
        }
+*/
 }
 
 void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
 }
 
 void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
@@ -1827,8 +1834,10 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time)
                        if ( GetParent() && m_backgroundColour != GetParent()->GetBackgroundColour() )
                                eraseBackground = true ;
                        SetClip( updatergn ) ;
                        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 ) ; 
                        }
                }
                                EraseRgn( updatergn ) ; 
                        }
                }
@@ -2310,37 +2319,7 @@ long wxWindow::MacRemoveBordersFromStyle( long style )
 {
        return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
 }
 {
        return style & ~( wxDOUBLE_BORDER | wxSUNKEN_BORDER | wxRAISED_BORDER | wxBORDER | wxSTATIC_BORDER ) ;
 }
-/*
-wxMacFocusHelper::wxMacFocusHelper( wxWindow * theWindow ) 
-{
-       m_ok = false ;
-       Point localOrigin ;
-       Rect clipRect ;
-       WindowRef window ;
-       wxWindow *rootwin ;
-       m_currentPort = NULL ;
-       GetPort( &m_formerPort ) ;
-       if ( theWindow )
-       {
-       
-               theWindow->MacGetPortParams( &localOrigin , &clipRect , &window , &rootwin) ;
-               m_currentPort = UMAGetWindowPort( window ) ;
-               theWindow->MacSetPortFocusParams( localOrigin, clipRect, window , rootwin ) ; 
-               m_ok = true ;
-       }
-}
-       
-wxMacFocusHelper::~wxMacFocusHelper() 
-{
-       if ( m_ok )
-       {
-               SetPort( m_currentPort ) ;
-               SetOrigin( 0 , 0 ) ;
-       }
-       if ( m_formerPort != m_currentPort )
-               SetPort( m_formerPort ) ;
-}
-*/
+
 
 wxMacDrawingHelper::wxMacDrawingHelper( wxWindow * theWindow ) 
 {
 
 wxMacDrawingHelper::wxMacDrawingHelper( wxWindow * theWindow ) 
 {
@@ -2374,7 +2353,6 @@ wxMacDrawingHelper::~wxMacDrawingHelper()
                Rect portRect ;
                GetPortBounds( m_currentPort , &portRect ) ;
                ClipRect( &portRect ) ;
                Rect portRect ;
                GetPortBounds( m_currentPort , &portRect ) ;
                ClipRect( &portRect ) ;
-               wxDC::MacInvalidateSetup() ;    
        }
                
        if ( m_formerPort != m_currentPort )
        }
                
        if ( m_formerPort != m_currentPort )