Move {Get,Set}Weight() implementations to wxFontBase
Implement these methods in the base class in terms of {Get,Set}NumericWeight() in order to avoid having to do it for each platform. No real changes.
This commit is contained in:
@@ -352,7 +352,6 @@ public:
|
||||
virtual bool IsUsingSizeInPixels() const;
|
||||
wxFontFamily GetFamily() const;
|
||||
virtual wxFontStyle GetStyle() const = 0;
|
||||
virtual wxFontWeight GetWeight() const = 0;
|
||||
virtual int GetNumericWeight() const = 0;
|
||||
virtual bool GetUnderlined() const = 0;
|
||||
virtual bool GetStrikethrough() const { return false; }
|
||||
@@ -360,6 +359,9 @@ public:
|
||||
virtual wxFontEncoding GetEncoding() const = 0;
|
||||
virtual const wxNativeFontInfo *GetNativeFontInfo() const = 0;
|
||||
|
||||
// Accessors that can be overridden in the platform-specific code but for
|
||||
// which we provide a reasonable default implementation in the base class.
|
||||
virtual wxFontWeight GetWeight() const;
|
||||
virtual bool IsFixedWidth() const;
|
||||
|
||||
wxString GetNativeFontInfoDesc() const;
|
||||
@@ -370,7 +372,6 @@ public:
|
||||
virtual void SetPixelSize( const wxSize& pixelSize );
|
||||
virtual void SetFamily( wxFontFamily family ) = 0;
|
||||
virtual void SetStyle( wxFontStyle style ) = 0;
|
||||
virtual void SetWeight( wxFontWeight weight ) = 0;
|
||||
virtual void SetNumericWeight( int weight ) = 0;
|
||||
|
||||
virtual void SetUnderlined( bool underlined ) = 0;
|
||||
@@ -380,6 +381,10 @@ public:
|
||||
void SetNativeFontInfo(const wxNativeFontInfo& info)
|
||||
{ DoSetNativeFontInfo(info); }
|
||||
|
||||
// Similarly to the accessors above, the functions in this group have a
|
||||
// reasonable default implementation in the base class.
|
||||
virtual void SetWeight( wxFontWeight weight );
|
||||
|
||||
bool SetNativeFontInfo(const wxString& info);
|
||||
bool SetNativeFontInfoUserDesc(const wxString& info);
|
||||
|
||||
@@ -413,6 +418,14 @@ public:
|
||||
wxDEPRECATED_INLINE(bool GetNoAntiAliasing() const, return false;)
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants instead of raw values")
|
||||
void SetWeight(int weight)
|
||||
{ SetWeight(static_cast<wxFontWeight>(weight)); }
|
||||
|
||||
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants instead of wxLIGHT/wxNORMAL/wxBOLD")
|
||||
void SetWeight(wxDeprecatedGUIConstants weight)
|
||||
{ SetWeight(static_cast<wxFontWeight>(weight)); }
|
||||
|
||||
// from the font components
|
||||
wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants")
|
||||
static wxFont *New(
|
||||
@@ -500,18 +513,12 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
|
||||
wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \
|
||||
void SetStyle(int style) \
|
||||
{ SetStyle((wxFontStyle)style); } \
|
||||
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \
|
||||
void SetWeight(int weight) \
|
||||
{ SetWeight((wxFontWeight)weight); } \
|
||||
wxDEPRECATED_MSG("use wxFONTFAMILY_XXX constants") \
|
||||
void SetFamily(wxDeprecatedGUIConstants family) \
|
||||
{ SetFamily((wxFontFamily)family); } \
|
||||
wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \
|
||||
void SetStyle(wxDeprecatedGUIConstants style) \
|
||||
{ SetStyle((wxFontStyle)style); } \
|
||||
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \
|
||||
void SetWeight(wxDeprecatedGUIConstants weight) \
|
||||
{ SetWeight((wxFontWeight)weight); } \
|
||||
\
|
||||
/* functions for modifying font in place */ \
|
||||
wxFont& MakeBold(); \
|
||||
|
@@ -66,7 +66,6 @@ public:
|
||||
// implement base class pure virtuals
|
||||
virtual float GetFractionalPointSize() const wxOVERRIDE;
|
||||
virtual wxFontStyle GetStyle() const wxOVERRIDE;
|
||||
virtual wxFontWeight GetWeight() const wxOVERRIDE;
|
||||
virtual int GetNumericWeight() const wxOVERRIDE;
|
||||
virtual wxString GetFaceName() const wxOVERRIDE;
|
||||
virtual bool GetUnderlined() const wxOVERRIDE;
|
||||
@@ -78,7 +77,6 @@ public:
|
||||
virtual void SetPointSize(float pointSize) wxOVERRIDE;
|
||||
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
|
||||
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
|
||||
virtual void SetWeight(wxFontWeight weight) wxOVERRIDE;
|
||||
virtual void SetNumericWeight(int weight) wxOVERRIDE;
|
||||
virtual bool SetFaceName( const wxString& faceName ) wxOVERRIDE;
|
||||
virtual void SetUnderlined( bool underlined ) wxOVERRIDE;
|
||||
|
@@ -89,7 +89,6 @@ public:
|
||||
virtual wxSize GetPixelSize() const wxOVERRIDE;
|
||||
virtual bool IsUsingSizeInPixels() const wxOVERRIDE;
|
||||
virtual wxFontStyle GetStyle() const wxOVERRIDE;
|
||||
virtual wxFontWeight GetWeight() const wxOVERRIDE;
|
||||
virtual int GetNumericWeight() const wxOVERRIDE;
|
||||
virtual bool GetUnderlined() const wxOVERRIDE;
|
||||
virtual bool GetStrikethrough() const wxOVERRIDE;
|
||||
@@ -101,7 +100,6 @@ public:
|
||||
virtual void SetPixelSize(const wxSize& pixelSize) wxOVERRIDE;
|
||||
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
|
||||
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
|
||||
virtual void SetWeight(wxFontWeight weight) wxOVERRIDE;
|
||||
virtual void SetNumericWeight(int weight) wxOVERRIDE;
|
||||
virtual bool SetFaceName(const wxString& faceName) wxOVERRIDE;
|
||||
virtual void SetUnderlined(bool underlined) wxOVERRIDE;
|
||||
|
@@ -122,7 +122,6 @@ public:
|
||||
virtual float GetFractionalPointSize() const wxOVERRIDE;
|
||||
virtual wxSize GetPixelSize() const wxOVERRIDE;
|
||||
virtual wxFontStyle GetStyle() const wxOVERRIDE;
|
||||
virtual wxFontWeight GetWeight() const wxOVERRIDE;
|
||||
virtual int GetNumericWeight() const wxOVERRIDE;
|
||||
virtual bool GetUnderlined() const wxOVERRIDE;
|
||||
virtual bool GetStrikethrough() const wxOVERRIDE;
|
||||
@@ -135,7 +134,6 @@ public:
|
||||
virtual void SetPointSize(float pointSize) wxOVERRIDE;
|
||||
virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
|
||||
virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
|
||||
virtual void SetWeight(wxFontWeight weight) wxOVERRIDE;
|
||||
virtual void SetNumericWeight(int weight) wxOVERRIDE;
|
||||
virtual bool SetFaceName(const wxString& faceName) wxOVERRIDE;
|
||||
virtual void SetUnderlined(bool underlined) wxOVERRIDE;
|
||||
|
Reference in New Issue
Block a user