conditials for TARGET_CARBON when drawing using appearance text box

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-05-17 12:18:19 +00:00
parent 35a8698b65
commit 6606ecac87
2 changed files with 16 additions and 4 deletions

View File

@@ -1462,9 +1462,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
long xx = XLOG2DEVMAC(x); long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y); long yy = YLOG2DEVMAC(y);
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
#endif
MacInstallFont() ; MacInstallFont() ;
if ( 0 ) if ( 0 )
{ {
@@ -1476,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
FontInfo fi ; FontInfo fi ;
::GetFontInfo( &fi ) ; ::GetFontInfo( &fi ) ;
#if TARGET_CARBON
if ( !useDrawThemeText ) if ( !useDrawThemeText )
#endif
yy += fi.ascent ; yy += fi.ascent ;
::MoveTo( xx , yy ); ::MoveTo( xx , yy );
@@ -1515,6 +1517,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{ {
if( text[i] == 13 || text[i] == 10) if( text[i] == 13 || text[i] == 10)
{ {
#if TARGET_CARBON
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
@@ -1530,6 +1533,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
line++ ; line++ ;
} }
else else
#endif
{ {
::DrawText( text , laststop , i - laststop ) ; ::DrawText( text , laststop , i - laststop ) ;
line++ ; line++ ;
@@ -1539,6 +1543,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
} }
i++ ; i++ ;
} }
#if TARGET_CARBON
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
@@ -1553,6 +1558,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
CFRelease( mString ) ; CFRelease( mString ) ;
} }
else else
#endif
{ {
::DrawText( text , laststop , i - laststop ) ; ::DrawText( text , laststop , i - laststop ) ;
} }

View File

@@ -1462,9 +1462,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
long xx = XLOG2DEVMAC(x); long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y); long yy = YLOG2DEVMAC(y);
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
#endif
MacInstallFont() ; MacInstallFont() ;
if ( 0 ) if ( 0 )
{ {
@@ -1476,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
FontInfo fi ; FontInfo fi ;
::GetFontInfo( &fi ) ; ::GetFontInfo( &fi ) ;
#if TARGET_CARBON
if ( !useDrawThemeText ) if ( !useDrawThemeText )
#endif
yy += fi.ascent ; yy += fi.ascent ;
::MoveTo( xx , yy ); ::MoveTo( xx , yy );
@@ -1515,6 +1517,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{ {
if( text[i] == 13 || text[i] == 10) if( text[i] == 13 || text[i] == 10)
{ {
#if TARGET_CARBON
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
@@ -1530,6 +1533,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
line++ ; line++ ;
} }
else else
#endif
{ {
::DrawText( text , laststop , i - laststop ) ; ::DrawText( text , laststop , i - laststop ) ;
line++ ; line++ ;
@@ -1539,6 +1543,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
} }
i++ ; i++ ;
} }
#if TARGET_CARBON
if ( useDrawThemeText ) if ( useDrawThemeText )
{ {
Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ; Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 1000 } ;
@@ -1553,6 +1558,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
CFRelease( mString ) ; CFRelease( mString ) ;
} }
else else
#endif
{ {
::DrawText( text , laststop , i - laststop ) ; ::DrawText( text , laststop , i - laststop ) ;
} }