From 6606ecac87d8704628d7e62f13936f04b91cc5e0 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 17 May 2002 12:18:19 +0000 Subject: [PATCH] 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 --- src/mac/carbon/dc.cpp | 10 ++++++++-- src/mac/dc.cpp | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 60b239df45..55312eb06f 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -1462,9 +1462,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) long xx = XLOG2DEVMAC(x); long yy = YLOG2DEVMAC(y); - +#if TARGET_CARBON bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; - +#endif MacInstallFont() ; if ( 0 ) { @@ -1476,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) FontInfo fi ; ::GetFontInfo( &fi ) ; +#if TARGET_CARBON if ( !useDrawThemeText ) +#endif yy += fi.ascent ; ::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 TARGET_CARBON if ( useDrawThemeText ) { 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++ ; } else +#endif { ::DrawText( text , laststop , i - laststop ) ; line++ ; @@ -1539,6 +1543,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) } i++ ; } +#if TARGET_CARBON if ( useDrawThemeText ) { 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 ) ; } else +#endif { ::DrawText( text , laststop , i - laststop ) ; } diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 60b239df45..55312eb06f 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -1462,9 +1462,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) long xx = XLOG2DEVMAC(x); long yy = YLOG2DEVMAC(y); - +#if TARGET_CARBON bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ; - +#endif MacInstallFont() ; if ( 0 ) { @@ -1476,7 +1476,9 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) FontInfo fi ; ::GetFontInfo( &fi ) ; +#if TARGET_CARBON if ( !useDrawThemeText ) +#endif yy += fi.ascent ; ::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 TARGET_CARBON if ( useDrawThemeText ) { 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++ ; } else +#endif { ::DrawText( text , laststop , i - laststop ) ; line++ ; @@ -1539,6 +1543,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) } i++ ; } +#if TARGET_CARBON if ( useDrawThemeText ) { 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 ) ; } else +#endif { ::DrawText( text , laststop , i - laststop ) ; } -- 2.45.2