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