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:
Vadim Zeitlin
2009-06-12 20:11:21 +00:00
parent 6541fd4b27
commit f76c075805
15 changed files with 141 additions and 62 deletions

View File

@@ -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"