From ac99838a171787c6511cd3e7342ad93d7e9ea75b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 3 Jul 2004 15:50:10 +0000 Subject: [PATCH] SetFont implementation moved to peer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 40 +-------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 53e18bdc7b..8bdcc9b906 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -858,45 +858,7 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) void wxWindowMac::MacUpdateControlFont() { - ControlFontStyleRec fontStyle; - wxFont myfont = GetFont(); - if ( myfont.MacGetThemeFontID() != kThemeCurrentPortFont ) - { - switch( myfont.MacGetThemeFontID() ) - { - case kThemeSmallSystemFont : fontStyle.font = kControlFontSmallSystemFont ; break ; - case 109 /*mini font */ : fontStyle.font = -5 ; break ; - case kThemeSystemFont : fontStyle.font = kControlFontBigSystemFont ; break ; - default : fontStyle.font = kControlFontBigSystemFont ; break ; - } - fontStyle.flags = kControlUseFontMask ; - } - else - { - fontStyle.font = myfont.MacGetFontNum() ; - fontStyle.style = myfont.MacGetFontStyle() ; - fontStyle.size = myfont.MacGetFontSize() ; - fontStyle.flags = kControlUseFontMask | kControlUseFaceMask | kControlUseSizeMask ; - } - - fontStyle.just = teJustLeft ; - fontStyle.flags |= kControlUseJustMask ; - if ( ( GetWindowStyle() & wxALIGN_MASK ) & wxALIGN_CENTER_HORIZONTAL ) - fontStyle.just = teJustCenter ; - else if ( ( GetWindowStyle() & wxALIGN_MASK ) & wxALIGN_RIGHT ) - fontStyle.just = teJustRight ; - - - // we only should do this in case of a non-standard color, as otherwise 'disabled' controls - // won't get grayed out by the system anymore - - if ( GetForegroundColour() != *wxBLACK ) - { - fontStyle.foreColor = MAC_WXCOLORREF(GetForegroundColour().GetPixel() ) ; - fontStyle.flags |= kControlUseForeColorMask ; - } - - ::SetControlFontStyle( *m_peer , &fontStyle ); + m_peer->SetFont( GetFont() , GetForegroundColour() , GetWindowStyle() ) ; Refresh() ; } -- 2.47.2