wxOSX_SYSTEM_FONT_MINI,
wxOSX_SYSTEM_FONT_MINI_BOLD,
wxOSX_SYSTEM_FONT_LABELS,
- wxOSX_SYSTEM_FONT_VIEWS
+ wxOSX_SYSTEM_FONT_VIEWS,
};
public:
// ctors and such
wxFont() { }
+
+ wxFont( wxOSXSystemFont systemFont );
#if wxOSX_USE_COCOA
wxFont(WX_NSFont nsfont);
bool Create(const wxNativeFontInfo& info);
- bool CreateSystemFont(wxOSXSystemFont font);
-
virtual ~wxFont();
// implement base class pure virtuals
);
#if defined( __WXMAC__ )
- wxFont font;
- font.CreateSystemFont( wxOSX_SYSTEM_FONT_SMALL );
+ static wxFont font( wxOSX_SYSTEM_FONT_SMALL );
m_headerWin->SetFont( font );
#endif
m_lastOnSame = false;
#if defined( __WXMAC__ )
- m_normalFont.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS);
+ m_normalFont = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
#else
m_normalFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
#endif
return true;
}
+wxFont::wxFont(wxOSXSystemFont font)
+{
+ m_refData = new wxFontRefData( font, 0 );
+}
+
wxFont::wxFont(const wxString& fontdesc)
{
wxNativeFontInfo info;
return true;
}
-bool wxFont::CreateSystemFont(wxOSXSystemFont font)
-{
- UnRef();
-
- m_refData = new wxFontRefData( font, 0 );
-
- return true;
-}
-
wxFont::~wxFont()
{
}
switch (item)
{
case FONT_NORMAL:
- font = new wxFont;
- font->CreateSystemFont(wxOSX_SYSTEM_FONT_NORMAL);
+ font = new wxFont(wxOSX_SYSTEM_FONT_NORMAL);
break;
case FONT_SMALL:
- font = new wxFont;
- font->CreateSystemFont(wxOSX_SYSTEM_FONT_SMALL);
+ font = new wxFont(wxOSX_SYSTEM_FONT_SMALL);
break;
default:
font = const_cast<wxFont*>(super::GetFont(item));
attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX );
- attr.font.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS);
+ static wxFont font = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
+ attr.font = font;
return attr;
}
attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX );
- attr.font.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS);
+ static wxFont font = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
+ attr.font = font;
return attr;
}
attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX );
- attr.font.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS);
+ static wxFont font = wxFont(wxOSX_SYSTEM_FONT_VIEWS);
+ attr.font = font;
return attr;
}
m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
#endif
- wxFont font ;
-
- wxOSXSystemFont systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
-
+
switch ( variant )
{
case wxWINDOW_VARIANT_NORMAL :
- systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
+ static wxFont sysNormal(wxOSX_SYSTEM_FONT_NORMAL);
+ SetFont(sysNormal) ;
break ;
case wxWINDOW_VARIANT_SMALL :
- systemFont = wxOSX_SYSTEM_FONT_SMALL ;
+ static wxFont sysSmall(wxOSX_SYSTEM_FONT_SMALL);
+ SetFont(sysSmall) ;
break ;
case wxWINDOW_VARIANT_MINI :
- systemFont = wxOSX_SYSTEM_FONT_MINI ;
+ static wxFont sysMini(wxOSX_SYSTEM_FONT_MINI);
+ SetFont(sysMini) ;
break ;
case wxWINDOW_VARIANT_LARGE :
- systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
+ static wxFont sysLarge(wxOSX_SYSTEM_FONT_NORMAL);
+ SetFont(sysLarge) ;
break ;
default:
wxFAIL_MSG(wxT("unexpected window variant"));
break ;
}
-
- font.CreateSystemFont( systemFont ) ;
-
- SetFont( font ) ;
}
void wxWindowMac::MacUpdateControlFont()