Implement all of the getters to return the fields from the wxNativeFontInfo
contained in the wxFontRefData.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49146
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+ wxFontRefData(const wxNativeFontInfo& info)
+ : wxGDIRefData()
+ , m_fontId(0)
+ , m_info(info)
+ {}
+
wxFontRefData(int size,
int family,
int style,
wxFontRefData(int size,
int family,
int style,
#define M_FONTDATA ((wxFontRefData*)m_refData)
#define M_FONTDATA ((wxFontRefData*)m_refData)
-bool wxFont::Create(const wxNativeFontInfo&)
+bool wxFont::Create(const wxNativeFontInfo& nativeFontInfo)
+ UnRef();
+ m_refData = new wxFontRefData(nativeFontInfo);
+
+ return true;
}
void wxFont::SetEncoding(wxFontEncoding)
}
void wxFont::SetEncoding(wxFontEncoding)
int wxFont::GetPointSize() const
{
int wxFont::GetPointSize() const
{
+ wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ return M_FONTDATA->m_info.pointSize;
}
bool wxFont::GetUnderlined() const
}
bool wxFont::GetUnderlined() const
int wxFont::GetStyle() const
{
int wxFont::GetStyle() const
{
+ wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ return M_FONTDATA->m_info.style;
}
int wxFont::GetFamily() const
{
}
int wxFont::GetFamily() const
{
+ wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ return M_FONTDATA->m_info.family;
}
int wxFont::GetWeight() const
{
}
int wxFont::GetWeight() const
{
+ wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ return M_FONTDATA->m_info.weight;
}
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
}
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const