m_dc->MacCleanupPort(&m_ph) ;
}
+wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
+{
+ m_formerClip = NewRgn() ;
+ m_newClip = NewRgn() ;
+ GetClip( m_formerClip ) ;
+
+ if ( win )
+ {
+ RgnHandle insidergn = NewRgn() ;
+ int x = 0 , y = 0;
+ wxWindow *parent = win->GetParent() ;
+ parent->MacWindowToRootWindow( &x,&y ) ;
+
+ wxSize size = parent->GetSize() ;
+ SetRectRgn( insidergn , parent->MacGetLeftBorderSize() , parent->MacGetTopBorderSize() ,
+ size.x - parent->MacGetLeftBorderSize() - parent->MacGetRightBorderSize(),
+ size.y - parent->MacGetTopBorderSize() - parent->MacGetBottomBorderSize()) ;
+
+ CopyRgn( (RgnHandle) parent->MacGetVisibleRegion(false).GetWXHRGN() , m_newClip ) ;
+ SectRgn( m_newClip , insidergn , m_newClip ) ;
+ OffsetRgn( m_newClip , x , y ) ;
+ SetClip( m_newClip ) ;
+ DisposeRgn( insidergn ) ;
+ }
+}
+
+wxMacWindowClipper::~wxMacWindowClipper()
+{
+ SetClip( m_formerClip ) ;
+ DisposeRgn( m_newClip ) ;
+ DisposeRgn( m_formerClip ) ;
+}
+
//-----------------------------------------------------------------------------
// Local functions
//-----------------------------------------------------------------------------
void wxDC::DoCrossHair( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") );
+ wxMacPortSetter helper(this) ;
if (m_pen.GetStyle() != wxTRANSPARENT)
{
wxCoord xc, wxCoord yc )
{
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawArc Invalid DC"));
+ wxMacPortSetter helper(this) ;
wxCoord xx1 = XLOG2DEVMAC(x1);
wxCoord yy1 = YLOG2DEVMAC(y1);
double sa, double ea )
{
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawEllepticArc Invalid DC"));
+ wxMacPortSetter helper(this) ;
Rect r;
double angle = sa - ea; // Order important Mac in opposite direction to wx
long yy = YLOG2DEVMAC(y);
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
+ useDrawThemeText = false ;
#endif
MacInstallFont() ;
if ( 0 )
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&frame,
teJustLeft,
nil );
::DrawThemeTextBox( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&frame,
teJustLeft,
nil );
::GetFontInfo( &fi ) ;
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
+ useGetThemeText = false ;
#endif
if ( height )
if ( useGetThemeText )
{
Point bounds={0,0} ;
+ SInt16 baseline ;
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&bounds,
- nil );
+ &baseline );
CFRelease( mString ) ;
curwidth = bounds.h ;
}
if ( useGetThemeText )
{
Point bounds={0,0} ;
+ SInt16 baseline ;
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
::GetThemeTextDimensions( mString,
kThemeCurrentPortFont,
kThemeStateActive,
- true,
+ false,
&bounds,
- nil );
+ &baseline );
CFRelease( mString ) ;
curwidth = bounds.h ;
}