- wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
-
- wxMacFastPortSetter helper(this) ;
- long xx = XLOG2DEVMAC(x);
- long yy = YLOG2DEVMAC(y);
-#if TARGET_CARBON
- bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
- if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() )
- useDrawThemeText = false ;
-#endif
- MacInstallFont() ;
- if ( 0 )
- {
- m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize);
- SetAntiAliasedTextEnabled(true, 8);
- m_macAliasWasEnabled = true ;
- }
- FontInfo fi ;
- ::GetFontInfo( &fi ) ;
-#if TARGET_CARBON
- if ( !useDrawThemeText )
-#endif
- yy += fi.ascent ;
- ::MoveTo( xx , yy );
- if ( m_backgroundMode == wxTRANSPARENT )
- {
- ::TextMode( srcOr) ;
- }
- else
- {
- ::TextMode( srcCopy ) ;
- }
- int line = 0 ;
- {
- wxString linetext = strtext ;
-#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 + 10000 } ;
- wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ;
-
- if ( m_backgroundMode != wxTRANSPARENT )
- {
- Point bounds={0,0} ;
- Rect background = frame ;
- SInt16 baseline ;
- ::GetThemeTextDimensions( mString,
- m_font.MacGetThemeFontID() ,
- kThemeStateActive,
- false,
- &bounds,
- &baseline );
- background.right = background.left + bounds.h ;
- background.bottom = background.top + bounds.v ;
- ::EraseRect( &background ) ;
- }
- ::DrawThemeTextBox( mString,
- m_font.MacGetThemeFontID() ,
- kThemeStateActive,
- false,
- &frame,
- teJustLeft,
- nil );
- }
- else
-#endif
- {
- wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
- if ( m_backgroundMode != wxTRANSPARENT )
- {
- Rect frame = { yy - fi.ascent + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy - fi.ascent + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
- short width = ::TextWidth( text , 0 , strlen(text) ) ;
- frame.right = frame.left + width ;
-
- ::EraseRect( &frame ) ;
- }
- ::DrawText( text , 0 , strlen(text) ) ;
- }
- }
- ::TextMode( srcOr ) ;