pointer returned by GetNativeFontInfo() is now const and must not be deleted (replaces patch 810192)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-09-24 01:23:37 +00:00
parent cb0afb2662
commit 3bf5a59b5e
23 changed files with 291 additions and 170 deletions

View File

@@ -139,6 +139,28 @@ public:
// reset to the default state
void Init();
// init with the parameters of the given font
void InitFromFont(const wxFont& font)
{
// translate all font parameters
SetStyle((wxFontStyle)font.GetStyle());
SetWeight((wxFontWeight)font.GetWeight());
SetUnderlined(font.GetUnderlined());
SetPointSize(font.GetPointSize());
// set the family/facename
SetFamily((wxFontFamily)font.GetFamily());
const wxString& facename = font.GetFaceName();
if ( !facename.empty() )
{
SetFaceName(facename);
}
// deal with encoding now (it may override the font family and facename
// so do it after setting them)
SetEncoding(font.GetEncoding());
}
// accessors and modifiers for the font elements
int GetPointSize() const;
wxFontStyle GetStyle() const;