X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4807c0a8fdce8c8a21f7296cc224c08297ca54b..888dde65f43d5f57e8fb2028b27191cca1741403:/src/mac/carbon/utils.cpp diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index f97f8da6b6..b91247bfd5 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -643,7 +643,29 @@ void wxMacControl::SuperChangedPosition() void wxMacControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle ) { m_font = font; -#ifndef __LP64__ +#if wxMAC_USE_CORE_TEXT + if ( UMAGetSystemVersion() >= 0x1050 ) + { + HIViewPartCode part = 0; + HIThemeTextHorizontalFlush flush = kHIThemeTextHorizontalFlushDefault; + if ( ( windowStyle & wxALIGN_MASK ) & wxALIGN_CENTER_HORIZONTAL ) + flush = kHIThemeTextHorizontalFlushCenter; + else if ( ( windowStyle & wxALIGN_MASK ) & wxALIGN_RIGHT ) + flush = kHIThemeTextHorizontalFlushRight; + HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.MacGetCTFont() ); + HIViewSetTextHorizontalFlush( m_controlRef, part, flush ); + + if ( foreground != *wxBLACK ) + { + ControlFontStyleRec fontStyle; + foreground.GetRGBColor( &fontStyle.foreColor ); + fontStyle.flags = kControlUseForeColorMask; + ::SetControlFontStyle( m_controlRef , &fontStyle ); + } + + } +#endif +#if wxMAC_USE_ATSU_TEXT ControlFontStyleRec fontStyle; if ( font.MacGetThemeFontID() != kThemeCurrentPortFont ) { @@ -699,8 +721,7 @@ void wxMacControl::SetFont( const wxFont & font , const wxColour& foreground , l void wxMacControl::SetBackgroundColour( const wxColour &WXUNUSED(col) ) { - // TODO - // setting up a color proc is not recommended anymore +// HITextViewSetBackgroundColor( m_textView , color ); } void wxMacControl::SetRange( SInt32 minimum , SInt32 maximum ) @@ -1940,20 +1961,6 @@ CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush ) return color; } -#ifndef __LP64__ - -wxMacPortSaver::wxMacPortSaver( GrafPtr port ) -{ - ::GetPort( &m_port ); - ::SetPort( port ); -} - -wxMacPortSaver::~wxMacPortSaver() -{ - ::SetPort( m_port ); -} -#endif - #if wxMAC_USE_QUICKDRAW void wxMacGlobalToLocal( WindowRef window , Point*pt )