]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
The UseAntiAliasing is off by default on wxMac. Add a menu item to
[wxWidgets.git] / src / mac / carbon / window.cpp
index bfff87c13d89f7ebff705ac78cfed3b18901f7e5..a5c56e42028dabb7f72c35d08e9370bf3808bb47 100644 (file)
@@ -1278,7 +1278,16 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
         child->GetPosition( &x, &y );
         int w,h;
         child->GetSize( &w, &h );
-        child->SetSize( x+dx, y+dy, w, h );
+        if (rect)
+        {
+            wxRect rc(x,y,w,h);
+            if (rect->Intersects(rc))
+                child->SetSize( x+dx, y+dy, w, h );
+        }
+        else
+        {
+            child->SetSize( x+dx, y+dy, w, h );                
+        }        
     }
     
     Update() ;
@@ -1629,92 +1638,101 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSibling
     RgnHandle tempRgn = NewRgn() ;
     RgnHandle tempStaticBoxRgn = NewRgn() ;
 
-    SetRectRgn( visRgn , 0 , 0 , m_width , m_height ) ;
-
-    //TODO : as soon as the new scheme has proven to work correctly, move this to wxStaticBox
-    if ( IsKindOf( CLASSINFO( wxStaticBox ) ) )
+    if ( MacIsReallyShown() )
     {
-        int borderTop = 14 ;
-        int borderOther = 4 ;
+        SetRectRgn( visRgn , 0 , 0 , m_width , m_height ) ;
 
-        SetRectRgn( tempStaticBoxRgn , borderOther , borderTop , m_width - borderOther , m_height - borderOther ) ;
-        DiffRgn( visRgn , tempStaticBoxRgn , visRgn ) ;
-    }
+        //TODO : as soon as the new scheme has proven to work correctly, move this to wxStaticBox
+        if ( IsKindOf( CLASSINFO( wxStaticBox ) ) )
+        {
+            int borderTop = 14 ;
+            int borderOther = 4 ;
+            if ( UMAGetSystemVersion() >= 0x1030 )
+                borderTop += 2 ;
 
-    if ( !IsTopLevel() )
-    {
-        wxWindow* parent = GetParent() ;
-        while( parent )
+            SetRectRgn( tempStaticBoxRgn , borderOther , borderTop , m_width - borderOther , m_height - borderOther ) ;
+            DiffRgn( visRgn , tempStaticBoxRgn , visRgn ) ;
+        }
+
+        if ( !IsTopLevel() )
         {
-            wxSize size = parent->GetSize() ;
-            int x , y ;
-            x = y = 0 ;
-            parent->MacWindowToRootWindow( &x, &y ) ;
-            MacRootWindowToWindow( &x , &y ) ;
-
-            SetRectRgn( tempRgn ,
-                x + parent->MacGetLeftBorderSize() , y + parent->MacGetTopBorderSize() ,
-                x + size.x - parent->MacGetRightBorderSize(),
-                y + size.y - parent->MacGetBottomBorderSize()) ;
-
-            SectRgn( visRgn , tempRgn , visRgn ) ;
-            if ( parent->IsTopLevel() )
-                break ;
-            parent = parent->GetParent() ;
+            wxWindow* parent = GetParent() ;
+            while( parent )
+            {
+                wxSize size = parent->GetSize() ;
+                int x , y ;
+                x = y = 0 ;
+                parent->MacWindowToRootWindow( &x, &y ) ;
+                MacRootWindowToWindow( &x , &y ) ;
+
+                SetRectRgn( tempRgn ,
+                    x + parent->MacGetLeftBorderSize() , y + parent->MacGetTopBorderSize() ,
+                    x + size.x - parent->MacGetRightBorderSize(),
+                    y + size.y - parent->MacGetBottomBorderSize()) ;
+
+                SectRgn( visRgn , tempRgn , visRgn ) ;
+                if ( parent->IsTopLevel() )
+                    break ;
+                parent = parent->GetParent() ;
+            }
         }
-    }
-    if ( respectChildrenAndSiblings )
-    {
-        if ( GetWindowStyle() & wxCLIP_CHILDREN )
+        if ( respectChildrenAndSiblings )
         {
-            for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext())
+            if ( GetWindowStyle() & wxCLIP_CHILDREN )
             {
-                wxWindowMac *child = node->GetData();
-
-                if ( !child->IsTopLevel() && child->IsShown() )
+                for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext())
                 {
-                    SetRectRgn( tempRgn , child->m_x , child->m_y , child->m_x + child->m_width ,  child->m_y + child->m_height ) ;
-                    if ( child->IsKindOf( CLASSINFO( wxStaticBox ) ) )
-                    {
-                        int borderTop = 14 ;
-                        int borderOther = 4 ;
+                    wxWindowMac *child = node->GetData();
 
-                        SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
-                        DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
+                    if ( !child->IsTopLevel() && child->IsShown() )
+                    {
+                        SetRectRgn( tempRgn , child->m_x , child->m_y , child->m_x + child->m_width ,  child->m_y + child->m_height ) ;
+                        if ( child->IsKindOf( CLASSINFO( wxStaticBox ) ) )
+                        {
+                            int borderTop = 14 ;
+                            int borderOther = 4 ;
+                            if ( UMAGetSystemVersion() >= 0x1030 )
+                                borderTop += 2 ;
+                            
+                            SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
+                            DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
+                        }
+                        DiffRgn( visRgn , tempRgn , visRgn ) ;
                     }
-                    DiffRgn( visRgn , tempRgn , visRgn ) ;
                 }
             }
-        }
 
-        if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() )
-        {
-            bool thisWindowThrough = false ;
-            for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext())
+            if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() )
             {
-                wxWindowMac *sibling = node->GetData();
-                if ( sibling == this )
+                bool thisWindowThrough = false ;
+                for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext())
                 {
-                    thisWindowThrough = true ;
-                    continue ;
-                }
-                if( !thisWindowThrough )
-                {
-                    continue ;
-                }
-
-                if ( !sibling->IsTopLevel() && sibling->IsShown() )
-                {
-                    SetRectRgn( tempRgn , sibling->m_x - m_x , sibling->m_y - m_y , sibling->m_x + sibling->m_width - m_x ,  sibling->m_y + sibling->m_height - m_y ) ;
-                    if ( sibling->IsKindOf( CLASSINFO( wxStaticBox ) ) )
+                    wxWindowMac *sibling = node->GetData();
+                    if ( sibling == this )
                     {
-                        int borderTop = 14 ;
-                        int borderOther = 4 ;
+                        thisWindowThrough = true ;
+                        continue ;
+                    }
+                    if( !thisWindowThrough )
+                    {
+                        continue ;
+                    }
 
-                        SetRectRgn( tempStaticBoxRgn , sibling->m_x - m_x + borderOther , sibling->m_y - m_y + borderTop , sibling->m_x + sibling->m_width - m_x - borderOther , sibling->m_y + sibling->m_height - m_y - borderOther ) ;
-                        DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
+                    if ( !sibling->IsTopLevel() && sibling->IsShown() )
+                    {
+                        SetRectRgn( tempRgn , sibling->m_x - m_x , sibling->m_y - m_y , sibling->m_x + sibling->m_width - m_x ,  sibling->m_y + sibling->m_height - m_y ) ;
+                        if ( sibling->IsKindOf( CLASSINFO( wxStaticBox ) ) )
+                        {
+                            int borderTop = 14 ;
+                            int borderOther = 4 ;
+                            if ( UMAGetSystemVersion() >= 0x1030 )
+                                borderTop += 2 ;
+
+                            SetRectRgn( tempStaticBoxRgn , sibling->m_x - m_x + borderOther , sibling->m_y - m_y + borderTop , sibling->m_x + sibling->m_width - m_x - borderOther , sibling->m_y + sibling->m_height - m_y - borderOther ) ;
+                            DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
+                        }
+                        DiffRgn( visRgn , tempRgn , visRgn ) ;
                     }
-                    DiffRgn( visRgn , tempRgn , visRgn ) ;
                 }
             }
         }