added convenient wxFont::Make{Bold,Italic,Smaller,Larger} and Scale() methods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -276,7 +276,7 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
|
||||
|
||||
|
||||
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
||||
#define WXDECLARE_COMPAT_SETTERS \
|
||||
#define wxDECLARE_FONT_COMPAT_SETTER \
|
||||
wxDEPRECATED_FUTURE( void SetFamily(int family) ) \
|
||||
{ SetFamily((wxFontFamily)family); } \
|
||||
wxDEPRECATED_FUTURE( void SetStyle(int style) ) \
|
||||
@@ -290,9 +290,20 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
|
||||
wxDEPRECATED_FUTURE( void SetWeight(wxDeprecatedGUIConstants weight) ) \
|
||||
{ SetWeight((wxFontWeight)weight); }
|
||||
#else
|
||||
#define WXDECLARE_COMPAT_SETTERS /*empty*/
|
||||
#define wxDECLARE_FONT_COMPAT_SETTER /*empty*/
|
||||
#endif
|
||||
|
||||
// this macro must be used in all derived wxFont classes declarations
|
||||
#define wxDECLARE_COMMON_FONT_METHODS() \
|
||||
wxDECLARE_FONT_COMPAT_SETTER \
|
||||
\
|
||||
/* functions for creating fonts based on this one */ \
|
||||
wxFont MakeBold() const; \
|
||||
wxFont MakeItalic() const; \
|
||||
wxFont MakeLarger() const { return Scale(1.2f); } \
|
||||
wxFont MakeSmaller() const { return Scale(1/1.2f); } \
|
||||
wxFont Scale(float x) const
|
||||
|
||||
// include the real class declaration
|
||||
#if defined(__WXPALMOS__)
|
||||
#include "wx/palmos/font.h"
|
||||
|
Reference in New Issue
Block a user