- MoveTo(drawRect->left + 4 , drawRect->top + 10 );
- ::TextFont( kFontIDMonaco ) ;
- ::TextSize( 9 );
- ::TextFace( 0 ) ;
-
- DrawText(text, 0 , text.Length());
+ wxFontRefData * font = (wxFontRefData*) list->GetFont().GetRefData() ;
+
+ if ( font )
+ {
+ ::TextFont( font->m_macFontNum ) ;
+ ::TextSize( short(font->m_macFontSize) ) ;
+ ::TextFace( font->m_macFontStyle ) ;
+ }
+ else
+ {
+ ::TextFont( kFontIDMonaco ) ;
+ ::TextSize( 9 );
+ ::TextFace( 0 ) ;
+ }
+
+#if TARGET_CARBON
+ bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
+
+ if ( useDrawThemeText )
+ {
+ Rect frame = { drawRect->top, drawRect->left + 4,
+ drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
+ CFStringRef sString = CFStringCreateWithBytes( NULL , (UInt8*) text.c_str(), text.Length(), CFStringGetSystemEncoding(), false ) ;
+ CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , sString ) ;
+ CFRelease( sString ) ;
+ ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
+ ::DrawThemeTextBox( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &frame,
+ teJustLeft,
+ nil );
+ CFRelease( mString ) ;
+ }
+ else
+#endif
+ {
+ MoveTo(drawRect->left + 4 , drawRect->top + 10 );
+ DrawText(text, 0 , text.Length());
+ }
+