fix the incoherence pointed out by ifacecheck between wx docs, that documents usage of the wxFontFamily, wxFontStyle and wxFontWeight enums in wxFont setters and getters, and the actual sources, which use 'int' instead; provided the same backward-compatibility pattern already used for wxBrush,wxPen both against 'int' overloads and against the wxDeprecatedGUIConstants enum values
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -59,9 +59,9 @@ class wxFontRefData : public wxGDIRefData
|
||||
public:
|
||||
// from broken down font parameters, also default ctor
|
||||
wxFontRefData(int size = -1,
|
||||
int family = wxFONTFAMILY_DEFAULT,
|
||||
int style = wxFONTSTYLE_NORMAL,
|
||||
int weight = wxFONTWEIGHT_NORMAL,
|
||||
wxFontFamily family = wxFONTFAMILY_DEFAULT,
|
||||
wxFontStyle style = wxFONTSTYLE_NORMAL,
|
||||
wxFontWeight weight = wxFONTWEIGHT_NORMAL,
|
||||
bool underlined = false,
|
||||
const wxString& faceName = wxEmptyString,
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
|
||||
@@ -84,9 +84,9 @@ public:
|
||||
// setters: all of them also take care to modify m_nativeFontInfo if we
|
||||
// have it so as to not lose the information not carried by our fields
|
||||
void SetPointSize(int pointSize);
|
||||
void SetFamily(int family);
|
||||
void SetStyle(int style);
|
||||
void SetWeight(int weight);
|
||||
void SetFamily(wxFontFamily family);
|
||||
void SetStyle(wxFontStyle style);
|
||||
void SetWeight(wxFontWeight weight);
|
||||
void SetUnderlined(bool underlined);
|
||||
bool SetFaceName(const wxString& facename);
|
||||
void SetEncoding(wxFontEncoding encoding);
|
||||
@@ -120,9 +120,9 @@ public:
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init(int pointSize,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding);
|
||||
@@ -138,9 +138,9 @@ private:
|
||||
wxScaledFontList m_scaled_xfonts;
|
||||
|
||||
int m_pointSize;
|
||||
int m_family,
|
||||
m_style,
|
||||
m_weight;
|
||||
wxFontFamily m_family;
|
||||
wxFontStyle m_style;
|
||||
wxFontWeight m_weight;
|
||||
bool m_underlined;
|
||||
wxString m_faceName;
|
||||
wxFontEncoding m_encoding; // Unused under GTK 2.0
|
||||
@@ -160,9 +160,9 @@ private:
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFontRefData::Init(int pointSize,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding)
|
||||
@@ -311,8 +311,8 @@ wxFontRefData::wxFontRefData( const wxFontRefData& data )
|
||||
m_nativeFontInfo.FromString(data.m_nativeFontInfo.ToString());
|
||||
}
|
||||
|
||||
wxFontRefData::wxFontRefData(int size, int family, int style,
|
||||
int weight, bool underlined,
|
||||
wxFontRefData::wxFontRefData(int size, wxFontFamily family, wxFontStyle style,
|
||||
wxFontWeight weight, bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
@@ -365,14 +365,14 @@ void wxFontRefData::SetPointSize(int pointSize)
|
||||
}
|
||||
}
|
||||
|
||||
void wxFontRefData::SetFamily(int family)
|
||||
void wxFontRefData::SetFamily(wxFontFamily family)
|
||||
{
|
||||
m_family = family;
|
||||
|
||||
// TODO: what are we supposed to do with m_nativeFontInfo here?
|
||||
}
|
||||
|
||||
void wxFontRefData::SetStyle(int style)
|
||||
void wxFontRefData::SetStyle(wxFontStyle style)
|
||||
{
|
||||
m_style = style;
|
||||
|
||||
@@ -401,7 +401,7 @@ void wxFontRefData::SetStyle(int style)
|
||||
}
|
||||
}
|
||||
|
||||
void wxFontRefData::SetWeight(int weight)
|
||||
void wxFontRefData::SetWeight(wxFontWeight weight)
|
||||
{
|
||||
m_weight = weight;
|
||||
|
||||
@@ -488,9 +488,9 @@ wxFont::wxFont(const wxNativeFontInfo& info)
|
||||
}
|
||||
|
||||
bool wxFont::Create( int pointSize,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
wxFontWeight weight,
|
||||
bool underlined,
|
||||
const wxString& face,
|
||||
wxFontEncoding encoding)
|
||||
@@ -564,23 +564,23 @@ wxString wxFont::GetFaceName() const
|
||||
return M_FONTDATA->m_faceName;
|
||||
}
|
||||
|
||||
int wxFont::GetFamily() const
|
||||
wxFontFamily wxFont::GetFamily() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( Ok(), wxFONTFAMILY_MAX, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->m_family;
|
||||
}
|
||||
|
||||
int wxFont::GetStyle() const
|
||||
wxFontStyle wxFont::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->m_style;
|
||||
}
|
||||
|
||||
int wxFont::GetWeight() const
|
||||
wxFontWeight wxFont::GetWeight() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->m_weight;
|
||||
}
|
||||
@@ -649,21 +649,21 @@ void wxFont::SetPointSize(int pointSize)
|
||||
M_FONTDATA->SetPointSize(pointSize);
|
||||
}
|
||||
|
||||
void wxFont::SetFamily(int family)
|
||||
void wxFont::SetFamily(wxFontFamily family)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->SetFamily(family);
|
||||
}
|
||||
|
||||
void wxFont::SetStyle(int style)
|
||||
void wxFont::SetStyle(wxFontStyle style)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
M_FONTDATA->SetStyle(style);
|
||||
}
|
||||
|
||||
void wxFont::SetWeight(int weight)
|
||||
void wxFont::SetWeight(wxFontWeight weight)
|
||||
{
|
||||
Unshare();
|
||||
|
||||
|
Reference in New Issue
Block a user