because some sash code draws whether the window is visible or not, the easiest thing is to make the MacGetVisibleRegion return an empty region for this case, so the wxDC is always entirely clipped

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-02-10 17:29:48 +00:00
parent d833907230
commit 21f9e95380
2 changed files with 156 additions and 138 deletions

View File

@@ -1638,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 ) ;
}
if ( !IsTopLevel() )
{
wxWindow* parent = GetParent() ;
while( parent )
//TODO : as soon as the new scheme has proven to work correctly, move this to wxStaticBox
if ( IsKindOf( CLASSINFO( wxStaticBox ) ) )
{
wxSize size = parent->GetSize() ;
int x , y ;
x = y = 0 ;
parent->MacWindowToRootWindow( &x, &y ) ;
MacRootWindowToWindow( &x , &y ) ;
int borderTop = 14 ;
int borderOther = 4 ;
if ( UMAGetSystemVersion() >= 0x1030 )
borderTop += 2 ;
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() ;
SetRectRgn( tempStaticBoxRgn , borderOther , borderTop , m_width - borderOther , m_height - borderOther ) ;
DiffRgn( visRgn , tempStaticBoxRgn , visRgn ) ;
}
}
if ( respectChildrenAndSiblings )
{
if ( GetWindowStyle() & wxCLIP_CHILDREN )
if ( !IsTopLevel() )
{
for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext())
wxWindow* parent = GetParent() ;
while( parent )
{
wxWindowMac *child = node->GetData();
wxSize size = parent->GetSize() ;
int x , y ;
x = y = 0 ;
parent->MacWindowToRootWindow( &x, &y ) ;
MacRootWindowToWindow( &x , &y ) ;
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 ;
SetRectRgn( tempRgn ,
x + parent->MacGetLeftBorderSize() , y + parent->MacGetTopBorderSize() ,
x + size.x - parent->MacGetRightBorderSize(),
y + size.y - parent->MacGetBottomBorderSize()) ;
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 ) ;
}
SectRgn( visRgn , tempRgn , visRgn ) ;
if ( parent->IsTopLevel() )
break ;
parent = parent->GetParent() ;
}
}
if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() )
if ( respectChildrenAndSiblings )
{
bool thisWindowThrough = false ;
for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext())
if ( GetWindowStyle() & wxCLIP_CHILDREN )
{
wxWindowMac *sibling = node->GetData();
if ( sibling == this )
for (wxWindowListNode *node = GetChildren().GetFirst(); node; node = node->GetNext())
{
thisWindowThrough = true ;
continue ;
}
if( !thisWindowThrough )
{
continue ;
}
wxWindowMac *child = node->GetData();
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 ) ) )
if ( !child->IsTopLevel() && child->IsShown() )
{
int borderTop = 14 ;
int borderOther = 4 ;
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 ) ;
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 ) ;
}
}
}
if ( (GetWindowStyle() & wxCLIP_SIBLINGS) && GetParent() )
{
bool thisWindowThrough = false ;
for (wxWindowListNode *node = GetParent()->GetChildren().GetFirst(); node; node = node->GetNext())
{
wxWindowMac *sibling = node->GetData();
if ( sibling == this )
{
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 ) ) )
{
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 ) ;
}
}
}