- while( i < length )
- {
- if( text[i] == 13 || text[i] == 10)
- {
- ::DrawText( text , laststop , i - laststop ) ;
- line++ ;
- ::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
- laststop = i+1 ;
- }
- i++ ;
+ {
+
+ while( i < length )
+ {
+ 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 } ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ true,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ line++ ;
+ }
+ else
+#endif
+ {
+ ::DrawText( text , laststop , i - laststop ) ;
+ line++ ;
+ ::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
+ }
+ laststop = i+1 ;
+ }
+ 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 } ;
+ CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ true,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ }
+ else
+#endif
+ {
+ ::DrawText( text , laststop , i - laststop ) ;
+ }