Update wxFont in wxQt after recent base class interface changes

Trivially implement the new wxFont::{Set,Get}{FractionalPointSize,
NumericWeight}() methods in terms of the corresponding wxNativeFontInfo
methods.
This commit is contained in:
Vadim Zeitlin
2018-09-14 00:11:28 +02:00
parent 9b661b918e
commit f5cd9a7934
2 changed files with 12 additions and 12 deletions

View File

@@ -50,20 +50,20 @@ public:
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
// accessors: get the font characteristics // accessors: get the font characteristics
virtual int GetPointSize() const; virtual float GetFractionalPointSize() const wxOVERRIDE;
virtual wxFontStyle GetStyle() const; virtual wxFontStyle GetStyle() const;
virtual wxFontWeight GetWeight() const; virtual int GetNumericWeight() const wxOVERRIDE;
virtual bool GetUnderlined() const; virtual bool GetUnderlined() const;
virtual wxString GetFaceName() const; virtual wxString GetFaceName() const;
virtual wxFontEncoding GetEncoding() const; virtual wxFontEncoding GetEncoding() const;
virtual const wxNativeFontInfo *GetNativeFontInfo() const; virtual const wxNativeFontInfo *GetNativeFontInfo() const;
// change the font characteristics // change the font characteristics
virtual void SetPointSize( int pointSize ); virtual void SetFractionalPointSize(float pointSize) wxOVERRIDE;
virtual void SetFamily( wxFontFamily family ); virtual void SetFamily( wxFontFamily family );
virtual void SetStyle( wxFontStyle style ); virtual void SetStyle( wxFontStyle style );
virtual void SetNumericWeight(int weight) wxOVERRIDE;
virtual bool SetFaceName(const wxString& facename); virtual bool SetFaceName(const wxString& facename);
virtual void SetWeight( wxFontWeight weight );
virtual void SetUnderlined( bool underlined ); virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding); virtual void SetEncoding(wxFontEncoding encoding);

View File

@@ -203,9 +203,9 @@ bool wxFont::Create(wxSize size, wxFontFamily family, wxFontStyle style,
return true; return true;
} }
int wxFont::GetPointSize() const float wxFont::GetFractionalPointSize() const
{ {
return M_FONTDATA.GetPointSize(); return M_FONTDATA.GetFractionalPointSize();
} }
wxFontStyle wxFont::GetStyle() const wxFontStyle wxFont::GetStyle() const
@@ -213,9 +213,9 @@ wxFontStyle wxFont::GetStyle() const
return M_FONTDATA.GetStyle(); return M_FONTDATA.GetStyle();
} }
wxFontWeight wxFont::GetWeight() const int wxFont::GetNumericWeight() const
{ {
return M_FONTDATA.GetWeight(); return M_FONTDATA.GetNumericWeight();
} }
bool wxFont::GetUnderlined() const bool wxFont::GetUnderlined() const
@@ -238,11 +238,11 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
return &M_FONTDATA; return &M_FONTDATA;
} }
void wxFont::SetPointSize( int pointSize ) void wxFont::SetFractionalPointSize(float pointSize)
{ {
AllocExclusive(); AllocExclusive();
M_FONTDATA.SetPointSize(pointSize); M_FONTDATA.SetFractionalPointSize(pointSize);
} }
bool wxFont::SetFaceName(const wxString& facename) bool wxFont::SetFaceName(const wxString& facename)
@@ -266,11 +266,11 @@ void wxFont::SetStyle( wxFontStyle style )
M_FONTDATA.SetStyle(style); M_FONTDATA.SetStyle(style);
} }
void wxFont::SetWeight( wxFontWeight weight ) void wxFont::SetNumericWeight(int weight)
{ {
AllocExclusive(); AllocExclusive();
M_FONTDATA.SetWeight(weight); M_FONTDATA.SetNumericWeight(weight);
} }
void wxFont::SetUnderlined( bool underlined ) void wxFont::SetUnderlined( bool underlined )