+ {
+ 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 + 10000 } ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ if ( m_backgroundMode != wxTRANSPARENT )
+ {
+ Point bounds={0,0} ;
+ Rect background = frame ;
+ SInt16 baseline ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ background.right = background.left + bounds.h ;
+ background.bottom = background.top + bounds.v ;
+ ::EraseRect( &background ) ;
+ }
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &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 + 10000 } ;
+ CFStringRef mString = CFStringCreateWithCString( NULL , text + laststop , kCFStringEncodingMacRoman ) ;
+ if ( m_backgroundMode != wxTRANSPARENT )
+ {
+ Point bounds={0,0} ;
+ Rect background = frame ;
+ SInt16 baseline ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ background.right = background.left + bounds.h ;
+ background.bottom = background.top + bounds.v ;
+ ::EraseRect( &background ) ;
+ }
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ }
+ else
+#endif
+ {
+ ::DrawText( text , laststop , i - laststop ) ;
+ }