added option for getting visible region w/o children clipped, added to redrawing of control code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-08-03 21:05:43 +00:00
parent d835f05e11
commit 7372fd0a3c
4 changed files with 98 additions and 86 deletions

View File

@@ -42,6 +42,7 @@ END_EVENT_TABLE()
#endif
#include "wx/mac/uma.h"
#include "wx/mac/private.h"
// Item members
@@ -695,12 +696,13 @@ void wxControl::MacRedrawControl()
wxClientDC dc(this) ;
wxMacPortSetter helper(&dc) ;
// the controls sometimes draw outside their boundaries, this
// should be resolved differently but is not trivial (e.g. drop shadows)
// since adding them to the border would yield in enormous gaps between
// the controls
Rect r = { 0 , 0 , 32000 , 32000 } ;
ClipRect( &r ) ;
int x = 0 , y = 0;
GetParent()->MacWindowToRootWindow( &x,&y ) ;
RgnHandle clrgn = NewRgn() ;
CopyRgn( (RgnHandle) GetParent()->MacGetVisibleRegion().GetWXHRGN() , clrgn ) ;
OffsetRgn( clrgn , x , y ) ;
SetClip( clrgn ) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
UMADrawControl( (ControlHandle) m_macControl ) ;
}
@@ -712,12 +714,13 @@ void wxControl::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this) ;
wxMacPortSetter helper(&dc) ;
// the controls sometimes draw outside their boundaries, this
// should be resolved differently but is not trivial (e.g. drop shadows)
// since adding them to the border would yield in enormous gaps between
// the controls
Rect r = { 0 , 0 , 32000 , 32000 } ;
ClipRect( &r ) ;
int x = 0 , y = 0;
GetParent()->MacWindowToRootWindow( &x,&y ) ;
RgnHandle clrgn = NewRgn() ;
CopyRgn( (RgnHandle) GetParent()->MacGetVisibleRegion().GetWXHRGN() , clrgn ) ;
OffsetRgn( clrgn , x , y ) ;
SetClip( clrgn ) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
UMADrawControl( (ControlHandle) m_macControl ) ;

View File

@@ -1542,7 +1542,7 @@ wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const
return win ;
}
const wxRegion& wxWindowMac::MacGetVisibleRegion()
const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSiblings )
{
RgnHandle visRgn = NewRgn() ;
RgnHandle tempRgn = NewRgn() ;
@@ -1576,6 +1576,8 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion()
parent = parent->GetParent() ;
}
}
if ( respectChildrenAndSiblings )
{
if ( GetWindowStyle() & wxCLIP_CHILDREN )
{
for (wxNode *node = GetChildren().First(); node; node = node->Next())
@@ -1613,6 +1615,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion()
}
}
}
}
m_macVisibleRegion = visRgn ;
DisposeRgn( visRgn ) ;
DisposeRgn( tempRgn ) ;

View File

@@ -42,6 +42,7 @@ END_EVENT_TABLE()
#endif
#include "wx/mac/uma.h"
#include "wx/mac/private.h"
// Item members
@@ -695,12 +696,13 @@ void wxControl::MacRedrawControl()
wxClientDC dc(this) ;
wxMacPortSetter helper(&dc) ;
// the controls sometimes draw outside their boundaries, this
// should be resolved differently but is not trivial (e.g. drop shadows)
// since adding them to the border would yield in enormous gaps between
// the controls
Rect r = { 0 , 0 , 32000 , 32000 } ;
ClipRect( &r ) ;
int x = 0 , y = 0;
GetParent()->MacWindowToRootWindow( &x,&y ) ;
RgnHandle clrgn = NewRgn() ;
CopyRgn( (RgnHandle) GetParent()->MacGetVisibleRegion().GetWXHRGN() , clrgn ) ;
OffsetRgn( clrgn , x , y ) ;
SetClip( clrgn ) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
UMADrawControl( (ControlHandle) m_macControl ) ;
}
@@ -712,12 +714,13 @@ void wxControl::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this) ;
wxMacPortSetter helper(&dc) ;
// the controls sometimes draw outside their boundaries, this
// should be resolved differently but is not trivial (e.g. drop shadows)
// since adding them to the border would yield in enormous gaps between
// the controls
Rect r = { 0 , 0 , 32000 , 32000 } ;
ClipRect( &r ) ;
int x = 0 , y = 0;
GetParent()->MacWindowToRootWindow( &x,&y ) ;
RgnHandle clrgn = NewRgn() ;
CopyRgn( (RgnHandle) GetParent()->MacGetVisibleRegion().GetWXHRGN() , clrgn ) ;
OffsetRgn( clrgn , x , y ) ;
SetClip( clrgn ) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
UMADrawControl( (ControlHandle) m_macControl ) ;

View File

@@ -1542,7 +1542,7 @@ wxTopLevelWindowMac* wxWindowMac::MacGetTopLevelWindow() const
return win ;
}
const wxRegion& wxWindowMac::MacGetVisibleRegion()
const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSiblings )
{
RgnHandle visRgn = NewRgn() ;
RgnHandle tempRgn = NewRgn() ;
@@ -1576,6 +1576,8 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion()
parent = parent->GetParent() ;
}
}
if ( respectChildrenAndSiblings )
{
if ( GetWindowStyle() & wxCLIP_CHILDREN )
{
for (wxNode *node = GetChildren().First(); node; node = node->Next())
@@ -1613,6 +1615,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion()
}
}
}
}
m_macVisibleRegion = visRgn ;
DisposeRgn( visRgn ) ;
DisposeRgn( tempRgn ) ;