From bd30752410f06d19015d6a8944205bbe7d93862c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Jan 2014 12:42:37 +0000 Subject: [PATCH] Just deprecate but don't schedule for removal wxNORMAL and friends. Deprecate the use of the old untyped constants but don't schedule them from removal in a future wx version by removing "#if WXWIN_COMPATIBILITY_3_0" tests around their definition and use. Provoking deprecation warnings in the code using these constants is worth it as they are unclear and it's easy to make mistakes when using them, but breaking this code compilation outright can't be justified -- even in the future. Also use more informational wxDEPRECATED_MSG() instead of a simple wxDEPRECATED() as it might not be obvious at all how should the code be updated exactly. Finally, avoid the use of deprecated constants inside the library itself. As a side effect, this closes #15814. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/brush.h | 10 +- include/wx/cocoa/brush.h | 13 ++- include/wx/cocoa/font.h | 25 ++--- include/wx/cocoa/pen.h | 13 ++- include/wx/defs.h | 3 - include/wx/dfb/brush.h | 13 ++- include/wx/dfb/font.h | 25 ++--- include/wx/dfb/pen.h | 13 ++- include/wx/font.h | 119 ++++++++++++------------ include/wx/gtk/brush.h | 12 +-- include/wx/gtk/font.h | 25 +++-- include/wx/gtk/pen.h | 13 ++- include/wx/gtk1/brush.h | 13 ++- include/wx/gtk1/font.h | 25 +++-- include/wx/gtk1/pen.h | 13 ++- include/wx/motif/font.h | 26 +++--- include/wx/msw/brush.h | 13 ++- include/wx/msw/font.h | 52 +++++------ include/wx/msw/pen.h | 14 +-- include/wx/os2/brush.h | 13 ++- include/wx/os2/font.h | 26 +++--- include/wx/os2/pen.h | 13 ++- include/wx/osx/brush.h | 13 ++- include/wx/osx/font.h | 26 +++--- include/wx/osx/pen.h | 13 ++- include/wx/pen.h | 10 +- include/wx/x11/brush.h | 13 ++- include/wx/x11/font.h | 25 +++-- include/wx/x11/pen.h | 12 +-- src/aui/dockart.cpp | 2 +- src/common/dcgraph.cpp | 8 +- src/common/gdicmn.cpp | 8 +- src/dfb/brush.cpp | 2 - src/dfb/pen.cpp | 2 - src/generic/tipdlg.cpp | 2 +- src/gtk/brush.cpp | 2 - src/gtk/font.cpp | 20 +++- src/gtk/pen.cpp | 2 - src/gtk1/brush.cpp | 2 - src/gtk1/pen.cpp | 2 - src/html/helpwnd.cpp | 6 +- src/html/winpars.cpp | 6 +- src/msw/brush.cpp | 2 - src/msw/graphics.cpp | 6 +- src/msw/pen.cpp | 2 - src/os2/brush.cpp | 2 - src/os2/pen.cpp | 2 - src/osx/brush.cpp | 2 - src/osx/pen.cpp | 2 - src/propgrid/editors.cpp | 4 +- src/richtext/richtextbackgroundpage.cpp | 2 +- src/richtext/richtextborderspage.cpp | 6 +- src/richtext/richtextmarginspage.cpp | 4 +- src/richtext/richtextsizepage.cpp | 8 +- src/richtext/richtextsymboldlg.cpp | 2 +- src/stc/stc.cpp | 4 +- src/x11/brush.cpp | 2 - src/x11/pen.cpp | 2 - 58 files changed, 341 insertions(+), 379 deletions(-) diff --git a/include/wx/brush.h b/include/wx/brush.h index cbb83463c1..78a47da63e 100644 --- a/include/wx/brush.h +++ b/include/wx/brush.h @@ -93,10 +93,9 @@ public: wxBrush *FindOrCreateBrush(const wxColour& colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") wxBrush *FindOrCreateBrush(const wxColour& colour, int style) { return FindOrCreateBrush(colour, (wxBrushStyle)style); } -#endif }; extern WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList; @@ -107,25 +106,24 @@ extern WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList; // // to compile without warnings which it would otherwise provoke from some // compilers as it compares elements of different enums -#if WXWIN_COMPATIBILITY_3_0 // Unfortunately some compilers have ambiguity issues when enum comparisons are // overloaded so we have to disable the overloads in this case, see // wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details. #ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM +wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only") inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t) { return static_cast(s) == static_cast(t); } +wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only") inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t) { - return !(s == t); + return static_cast(s) != static_cast(t); } #endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM -#endif // WXWIN_COMPATIBILITY_3_0 - #endif // _WX_BRUSH_H_BASE_ diff --git a/include/wx/cocoa/brush.h b/include/wx/cocoa/brush.h index 99d63d3aad..c6e8f63995 100644 --- a/include/wx/cocoa/brush.h +++ b/include/wx/cocoa/brush.h @@ -29,9 +29,6 @@ class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase public: wxBrush(); wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush(const wxBitmap& stipple); virtual ~wxBrush(); @@ -54,10 +51,12 @@ public: virtual wxBrushStyle GetStyle() const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } // wxCocoa WX_NSColor GetNSColor(); diff --git a/include/wx/cocoa/font.h b/include/wx/cocoa/font.h index 16831dfeb2..3a203c5fbb 100644 --- a/include/wx/cocoa/font.h +++ b/include/wx/cocoa/font.h @@ -53,18 +53,6 @@ public: /*! @abstract Platform-independent construction with individual properties */ -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = FALSE, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -133,6 +121,19 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = FALSE, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + // implementation only from now on // ------------------------------- diff --git a/include/wx/cocoa/pen.h b/include/wx/cocoa/pen.h index dab13337e2..af54be931a 100644 --- a/include/wx/cocoa/pen.h +++ b/include/wx/cocoa/pen.h @@ -25,9 +25,6 @@ class WXDLLIMPEXP_CORE wxPen: public wxGDIObject public: wxPen(); wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen(const wxBitmap& stipple, int width); virtual ~wxPen(); @@ -53,10 +50,12 @@ public: int GetDashes(wxDash **ptr) const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } // Cocoa-specific WX_NSColor GetNSColor(); diff --git a/include/wx/defs.h b/include/wx/defs.h index e60ae64002..eba47f7b85 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2416,8 +2416,6 @@ enum wxHatchStyle wxPenStyle, wxPenCap, wxPenJoin enum values instead! */ -#if WXWIN_COMPATIBILITY_3_0 - /* don't use any elements of this enum in the new code */ enum wxDeprecatedGUIConstants { @@ -2467,7 +2465,6 @@ enum wxDeprecatedGUIConstants wxFIRST_HATCH = wxHATCHSTYLE_FIRST, wxLAST_HATCH = wxHATCHSTYLE_LAST }; -#endif /* ToolPanel in wxFrame (VZ: unused?) */ enum diff --git a/include/wx/dfb/brush.h b/include/wx/dfb/brush.h index 98c9b6d2b5..b197ac064a 100644 --- a/include/wx/dfb/brush.h +++ b/include/wx/dfb/brush.h @@ -32,9 +32,6 @@ class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase public: wxBrush() {} wxBrush(const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush(const wxBitmap &stippleBitmap); bool operator==(const wxBrush& brush) const; @@ -49,10 +46,12 @@ public: void SetStyle(wxBrushStyle style); void SetStipple(const wxBitmap& stipple); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/dfb/font.h b/include/wx/dfb/font.h index 20a396021f..6be9d0a8f8 100644 --- a/include/wx/dfb/font.h +++ b/include/wx/dfb/font.h @@ -38,18 +38,6 @@ public: } wxFont(const wxNativeFontInfo& info) { Create(info); } -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif wxFont(int size, wxFontFamily family, @@ -103,6 +91,19 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + // implementation from now on: wxIDirectFBFontPtr GetDirectFBFont(bool antialiased) const; diff --git a/include/wx/dfb/pen.h b/include/wx/dfb/pen.h index c03e47a81f..e7ae220fb4 100644 --- a/include/wx/dfb/pen.h +++ b/include/wx/dfb/pen.h @@ -32,9 +32,6 @@ class WXDLLIMPEXP_CORE wxPen: public wxPenBase public: wxPen() {} wxPen(const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen(const wxBitmap& stipple, int width); @@ -60,10 +57,12 @@ public: wxDash* GetDash() const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/font.h b/include/wx/font.h index 6aca8e574e..d7e529fef2 100644 --- a/include/wx/font.h +++ b/include/wx/font.h @@ -285,32 +285,6 @@ public: virtual ~wxFontBase(); -#if WXWIN_COMPATIBILITY_3_0 - // from the font components - static wxFont *New( - int pointSize, // size of the font in points - int family, // see wxFontFamily enum - int style, // see wxFontStyle enum - int weight, // see wxFontWeight enum - bool underlined = false, // not underlined by default - const wxString& face = wxEmptyString, // facename - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) // ISO8859-X, ... - { return New(pointSize, (wxFontFamily)family, (wxFontStyle)style, - (wxFontWeight)weight, underlined, face, encoding); } - - // from the font components - static wxFont *New( - const wxSize& pixelSize, // size of the font in pixels - int family, // see wxFontFamily enum - int style, // see wxFontStyle enum - int weight, // see wxFontWeight enum - bool underlined = false, // not underlined by default - const wxString& face = wxEmptyString, // facename - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) // ISO8859-X, ... - { return New(pixelSize, (wxFontFamily)family, (wxFontStyle)style, - (wxFontWeight)weight, underlined, face, encoding); } -#endif - // from the font components static wxFont *New( int pointSize, // size of the font in points @@ -423,6 +397,33 @@ public: wxDEPRECATED_INLINE(bool GetNoAntiAliasing() const, return false;) #endif // WXWIN_COMPATIBILITY_2_8 + // from the font components + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + static wxFont *New( + int pointSize, // size of the font in points + int family, // see wxFontFamily enum + int style, // see wxFontStyle enum + int weight, // see wxFontWeight enum + bool underlined = false, // not underlined by default + const wxString& face = wxEmptyString, // facename + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) // ISO8859-X, ... + { return New(pointSize, (wxFontFamily)family, (wxFontStyle)style, + (wxFontWeight)weight, underlined, face, encoding); } + + // from the font components + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + static wxFont *New( + const wxSize& pixelSize, // size of the font in pixels + int family, // see wxFontFamily enum + int style, // see wxFontStyle enum + int weight, // see wxFontWeight enum + bool underlined = false, // not underlined by default + const wxString& face = wxEmptyString, // facename + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) // ISO8859-X, ... + { return New(pixelSize, (wxFontFamily)family, (wxFontStyle)style, + (wxFontWeight)weight, underlined, face, encoding); } + + protected: // the function called by both overloads of SetNativeFontInfo() virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); @@ -475,27 +476,26 @@ WXDLLIMPEXP_CORE wxString wxToString(const wxFontBase& font); WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font); -#if WXWIN_COMPATIBILITY_3_0 -#define wxDECLARE_FONT_COMPAT_SETTER \ - wxDEPRECATED( void SetFamily(int family) ) \ - { SetFamily((wxFontFamily)family); } \ - wxDEPRECATED( void SetStyle(int style) ) \ - { SetStyle((wxFontStyle)style); } \ - wxDEPRECATED( void SetWeight(int weight) ) \ - { SetWeight((wxFontWeight)weight); } \ - wxDEPRECATED( void SetFamily(wxDeprecatedGUIConstants family) ) \ - { SetFamily((wxFontFamily)family); } \ - wxDEPRECATED( void SetStyle(wxDeprecatedGUIConstants style) ) \ - { SetStyle((wxFontStyle)style); } \ - wxDEPRECATED( void SetWeight(wxDeprecatedGUIConstants weight) ) \ - { SetWeight((wxFontWeight)weight); } -#else -#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 \ + wxDEPRECATED_MSG("use wxFONTFAMILY_XXX constants") \ + void SetFamily(int family) \ + { SetFamily((wxFontFamily)family); } \ + 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(); \ @@ -546,14 +546,13 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); -#if WXWIN_COMPATIBILITY_3_0 - wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight, + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight, bool underline = false, const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { return FindOrCreateFont(pointSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underline, face, encoding); } -#endif }; extern WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList; @@ -565,29 +564,31 @@ extern WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList; // // to compile without warnings which it would otherwise provoke from some // compilers as it compares elements of different enums -#if WXWIN_COMPATIBILITY_3_0 // Unfortunately some compilers have ambiguity issues when enum comparisons are // overloaded so we have to disable the overloads in this case, see // wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details. #ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM +wxDEPRECATED_MSG("use wxFONTFAMILY_XXX constants") \ inline bool operator==(wxFontFamily s, wxDeprecatedGUIConstants t) -{ return static_cast(s) == static_cast(t); } + { return static_cast(s) == static_cast(t); } +wxDEPRECATED_MSG("use wxFONTFAMILY_XXX constants") \ inline bool operator!=(wxFontFamily s, wxDeprecatedGUIConstants t) -{ return !(s == t); } + { return static_cast(s) != static_cast(t); } +wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \ inline bool operator==(wxFontStyle s, wxDeprecatedGUIConstants t) -{ return static_cast(s) == static_cast(t); } + { return static_cast(s) == static_cast(t); } +wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \ inline bool operator!=(wxFontStyle s, wxDeprecatedGUIConstants t) -{ return !(s == t); } + { return static_cast(s) != static_cast(t); } +wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \ inline bool operator==(wxFontWeight s, wxDeprecatedGUIConstants t) -{ return static_cast(s) == static_cast(t); } + { return static_cast(s) == static_cast(t); } +wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \ inline bool operator!=(wxFontWeight s, wxDeprecatedGUIConstants t) -{ return !(s == t); } + { return static_cast(s) != static_cast(t); } #endif // // wxCOMPILER_NO_OVERLOAD_ON_ENUM -#endif // WXWIN_COMPATIBILITY_3_0 - -#endif - // _WX_FONT_H_BASE_ +#endif // _WX_FONT_H_BASE_ diff --git a/include/wx/gtk/brush.h b/include/wx/gtk/brush.h index 17d88b88ca..4ea1642be1 100644 --- a/include/wx/gtk/brush.h +++ b/include/wx/gtk/brush.h @@ -22,9 +22,6 @@ public: wxBrush() { } wxBrush( const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush( const wxBitmap &stippleBitmap ); virtual ~wxBrush(); @@ -40,10 +37,11 @@ public: void SetStyle( wxBrushStyle style ); void SetStipple( const wxBitmap& stipple ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/gtk/font.h b/include/wx/gtk/font.h index 15420bfeda..80a4e305a0 100644 --- a/include/wx/gtk/font.h +++ b/include/wx/gtk/font.h @@ -27,19 +27,6 @@ public: wxFont(const wxNativeFontInfo& info); -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -98,6 +85,18 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + // Set Pango attributes in the specified layout. Currently only // underlined and strike-through attributes are handled by this function. // diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index d0b368904c..33db6c89af 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -21,9 +21,6 @@ public: wxPen() { } wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif virtual ~wxPen(); @@ -49,10 +46,12 @@ public: wxDash* GetDash() const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/gtk1/brush.h b/include/wx/gtk1/brush.h index ee8808ffef..7b71146bd0 100644 --- a/include/wx/gtk1/brush.h +++ b/include/wx/gtk1/brush.h @@ -32,9 +32,6 @@ public: wxBrush() { } wxBrush( const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush( const wxBitmap &stippleBitmap ); virtual ~wxBrush(); @@ -50,10 +47,12 @@ public: void SetStyle( wxBrushStyle style ); void SetStipple( const wxBitmap& stipple ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } private: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/gtk1/font.h b/include/wx/gtk1/font.h index a2f49a7460..2bc317d630 100644 --- a/include/wx/gtk1/font.h +++ b/include/wx/gtk1/font.h @@ -52,19 +52,6 @@ public: wxFont(const wxNativeFontInfo& info); -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -122,6 +109,18 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + // implementation from now on void Unshare(); diff --git a/include/wx/gtk1/pen.h b/include/wx/gtk1/pen.h index 502da6d606..e2e593127a 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -37,9 +37,6 @@ public: wxPen() { } wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif bool operator==(const wxPen& pen) const; bool operator!=(const wxPen& pen) const { return !(*this == pen); } @@ -63,10 +60,12 @@ public: wxDash* GetDash() const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } private: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/motif/font.h b/include/wx/motif/font.h index 29a4b3622c..300cb485b4 100644 --- a/include/wx/motif/font.h +++ b/include/wx/motif/font.h @@ -43,19 +43,6 @@ public: wxFont(const wxNativeFontInfo& info); -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -113,6 +100,19 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + + // Implementation // Find an existing, or create a new, XFontStruct diff --git a/include/wx/msw/brush.h b/include/wx/msw/brush.h index 370358690d..09c4f2fe76 100644 --- a/include/wx/msw/brush.h +++ b/include/wx/msw/brush.h @@ -24,9 +24,6 @@ class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase public: wxBrush(); wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush(const wxBitmap& stipple); virtual ~wxBrush(); @@ -42,10 +39,12 @@ public: wxBrushStyle GetStyle() const; wxBitmap *GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } // return the HBRUSH for this brush virtual WXHANDLE GetResourceHandle() const; diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h index 4184e338e2..e5f8632173 100644 --- a/include/wx/msw/font.h +++ b/include/wx/msw/font.h @@ -25,19 +25,6 @@ public: wxFont(const wxFontInfo& info); -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -61,20 +48,6 @@ public: weight, underlined, face, encoding); } -#if WXWIN_COMPATIBILITY_3_0 - wxFont(const wxSize& pixelSize, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(pixelSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, - underlined, face, encoding); - } -#endif - wxFont(const wxSize& pixelSize, wxFontFamily family, wxFontStyle style, @@ -137,6 +110,31 @@ public: virtual bool IsFixedWidth() const; + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(const wxSize& pixelSize, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(pixelSize, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, + underlined, face, encoding); + } + // implementation only from now on // ------------------------------- diff --git a/include/wx/msw/pen.h b/include/wx/msw/pen.h index da80895a4d..d0d728cddf 100644 --- a/include/wx/msw/pen.h +++ b/include/wx/msw/pen.h @@ -23,9 +23,6 @@ class WXDLLIMPEXP_CORE wxPen : public wxPenBase public: wxPen() { } wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen(const wxBitmap& stipple, int width); virtual ~wxPen() { } @@ -54,10 +51,13 @@ public: int GetDashCount() const; wxBitmap* GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } + // internal: wxGDIObject methods virtual bool RealizeResource(); diff --git a/include/wx/os2/brush.h b/include/wx/os2/brush.h index c641e39e84..6b049b271d 100644 --- a/include/wx/os2/brush.h +++ b/include/wx/os2/brush.h @@ -19,9 +19,6 @@ class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase public: wxBrush(); wxBrush(const wxColour& rCol, wxBrushStyle nStyle = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush(const wxBitmap& rStipple); virtual ~wxBrush(); @@ -39,10 +36,12 @@ public: wxBitmap* GetStipple(void) const; int GetPS(void) const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } // // Implementation diff --git a/include/wx/os2/font.h b/include/wx/os2/font.h index ad9f19aa9c..d79b02bf76 100644 --- a/include/wx/os2/font.h +++ b/include/wx/os2/font.h @@ -40,19 +40,6 @@ public: SetPixelSize(info.GetPixelSize()); } -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -123,6 +110,19 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + + // // For internal use only! // diff --git a/include/wx/os2/pen.h b/include/wx/os2/pen.h index d6cffd2702..fb37d4dcb0 100644 --- a/include/wx/os2/pen.h +++ b/include/wx/os2/pen.h @@ -28,9 +28,6 @@ public: ,int nWidth = 1 ,wxPenStyle nStyle = wxPENSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen( const wxBitmap& rStipple ,int nWidth @@ -68,10 +65,12 @@ public: int GetDashCount() const; wxBitmap* GetStipple(void) const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } // // Implementation diff --git a/include/wx/osx/brush.h b/include/wx/osx/brush.h index d6ffc68f16..846f786898 100644 --- a/include/wx/osx/brush.h +++ b/include/wx/osx/brush.h @@ -23,9 +23,6 @@ class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase public: wxBrush(); wxBrush(const wxColour& col, wxBrushStyle style = wxBRUSHSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush(const wxBitmap& stipple); virtual ~wxBrush(); @@ -41,10 +38,12 @@ public: wxBrushStyle GetStyle() const ; wxBitmap *GetStipple() const ; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/osx/font.h b/include/wx/osx/font.h index d9e0d6f3dc..d54e79e17e 100644 --- a/include/wx/osx/font.h +++ b/include/wx/osx/font.h @@ -56,19 +56,6 @@ public: wxFont(WX_NSFont nsfont); #endif -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -133,6 +120,19 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + + // implementation only from now on // ------------------------------- diff --git a/include/wx/osx/pen.h b/include/wx/osx/pen.h index 2ae1cebf4d..c28ff64ec6 100644 --- a/include/wx/osx/pen.h +++ b/include/wx/osx/pen.h @@ -21,9 +21,6 @@ class WXDLLIMPEXP_CORE wxPen : public wxPenBase public: wxPen(); wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen(const wxBitmap& stipple, int width); virtual ~wxPen(); @@ -52,10 +49,12 @@ public: wxBitmap *GetStipple() const ; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } // Implementation diff --git a/include/wx/pen.h b/include/wx/pen.h index 42b7549970..2b7ecc0cad 100644 --- a/include/wx/pen.h +++ b/include/wx/pen.h @@ -122,10 +122,9 @@ public: int width = 1, wxPenStyle style = wxPENSTYLE_SOLID); -#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") wxPen *FindOrCreatePen(const wxColour& colour, int width, int style) { return FindOrCreatePen(colour, width, (wxPenStyle)style); } -#endif }; extern WXDLLIMPEXP_DATA_CORE(wxPenList*) wxThePenList; @@ -136,25 +135,24 @@ extern WXDLLIMPEXP_DATA_CORE(wxPenList*) wxThePenList; // // to compile without warnings which it would otherwise provoke from some // compilers as it compares elements of different enums -#if WXWIN_COMPATIBILITY_3_0 // Unfortunately some compilers have ambiguity issues when enum comparisons are // overloaded so we have to disable the overloads in this case, see // wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details. #ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM +wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") inline bool operator==(wxPenStyle s, wxDeprecatedGUIConstants t) { return static_cast(s) == static_cast(t); } +wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t) { - return !(s == t); + return static_cast(s) != static_cast(t); } #endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM -#endif // WXWIN_COMPATIBILITY_3_0 - #endif // _WX_PEN_H_BASE_ diff --git a/include/wx/x11/brush.h b/include/wx/x11/brush.h index 4deb18e58d..1597ca57b3 100644 --- a/include/wx/x11/brush.h +++ b/include/wx/x11/brush.h @@ -31,9 +31,6 @@ public: wxBrush() { } wxBrush( const wxColour &colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxBrush(const wxColour& col, int style) ); -#endif wxBrush( const wxBitmap &stippleBitmap ); virtual ~wxBrush(); @@ -49,10 +46,12 @@ public: void SetStyle( wxBrushStyle style ); void SetStipple( const wxBitmap& stipple ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxBrushStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + wxBrush(const wxColour& col, int style); + + wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxBrushStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/include/wx/x11/font.h b/include/wx/x11/font.h index 921bfdea4a..a92a5a92d3 100644 --- a/include/wx/x11/font.h +++ b/include/wx/x11/font.h @@ -34,19 +34,6 @@ public: SetPixelSize(info.GetPixelSize()); } -#if WXWIN_COMPATIBILITY_3_0 - wxFont(int size, - int family, - int style, - int weight, - bool underlined = false, - const wxString& face = wxEmptyString, - wxFontEncoding encoding = wxFONTENCODING_DEFAULT) - { - (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); - } -#endif - wxFont(int size, wxFontFamily family, wxFontStyle style, @@ -112,6 +99,18 @@ public: wxDECLARE_COMMON_FONT_METHODS(); + wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants") + wxFont(int size, + int family, + int style, + int weight, + bool underlined = false, + const wxString& face = wxEmptyString, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + { + (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding); + } + // Implementation #if wxUSE_PANGO diff --git a/include/wx/x11/pen.h b/include/wx/x11/pen.h index 064505fa28..73e7e25de7 100644 --- a/include/wx/x11/pen.h +++ b/include/wx/x11/pen.h @@ -34,9 +34,6 @@ public: wxPen() { } wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID ); -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( wxPen(const wxColour& col, int width, int style) ); -#endif wxPen( const wxBitmap &stipple, int width ); virtual ~wxPen(); @@ -63,10 +60,11 @@ public: wxDash* GetDash() const; wxBitmap* GetStipple() const; -#if WXWIN_COMPATIBILITY_3_0 - wxDEPRECATED( void SetStyle(int style) ) - { SetStyle((wxPenStyle)style); } -#endif + + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + wxPen(const wxColour& col, int width, int style); + wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants") + void SetStyle(int style) { SetStyle((wxPenStyle)style); } protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index df5c65febe..8709c54e4f 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -196,7 +196,7 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt() #ifdef __WXMAC__ m_captionFont = *wxSMALL_FONT; #else - m_captionFont = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE); + m_captionFont = wxFont(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); #endif // default metric values diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 74c0e55063..6e2d0192ab 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -550,7 +550,7 @@ void wxGCDCImpl::DoDrawArc( wxCoord x1, wxCoord y1, -atan2(double(y2 - yc), double(x2 - xc)) * RAD2DEG; } - bool fill = m_brush.GetStyle() != wxTRANSPARENT; + bool fill = m_brush.GetStyle() != wxBRUSHSTYLE_TRANSPARENT; wxGraphicsPath path = m_graphicContext->CreatePath(); if ( fill && ((x1!=x2)||(y1!=y2)) ) @@ -578,7 +578,7 @@ void wxGCDCImpl::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, // since these angles (ea,sa) are measured counter-clockwise, we invert them to // get clockwise angles - if ( m_brush.GetStyle() != wxTRANSPARENT ) + if ( m_brush.GetStyle() != wxBRUSHSTYLE_TRANSPARENT ) { wxGraphicsPath path = m_graphicContext->CreatePath(); path.MoveToPoint( 0, 0 ); @@ -691,7 +691,9 @@ void wxGCDCImpl::DoDrawPolygon( int n, const wxPoint points[], { wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawPolygon - invalid DC") ); - if ( n <= 0 || (m_brush.GetStyle() == wxTRANSPARENT && m_pen.GetStyle() == wxTRANSPARENT ) ) + if ( n <= 0 || + (m_brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT && + m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT) ) return; if ( !m_logicalFunctionSupported ) return; diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index fa12c0aa5b..89f1f0a9ee 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -613,7 +613,8 @@ const wxFont* wxStockGDI::GetFont(Item item) switch (item) { case FONT_ITALIC: - font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), wxROMAN, wxITALIC, wxNORMAL); + font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), + wxFONTFAMILY_ROMAN, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL); break; case FONT_NORMAL: font = new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); @@ -631,10 +632,11 @@ const wxFont* wxStockGDI::GetFont(Item item) #else - 2, #endif - wxSWISS, wxNORMAL, wxNORMAL); + wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); break; case FONT_SWISS: - font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), wxSWISS, wxNORMAL, wxNORMAL); + font = new wxFont(GetFont(FONT_NORMAL)->GetPointSize(), + wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); break; default: wxFAIL; diff --git a/src/dfb/brush.cpp b/src/dfb/brush.cpp index d52e9fa0ac..7cb0df8735 100644 --- a/src/dfb/brush.cpp +++ b/src/dfb/brush.cpp @@ -68,12 +68,10 @@ wxBrush::wxBrush(const wxColour &colour, wxBrushStyle style) m_refData = new wxBrushRefData(colour, style); } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData(col, (wxBrushStyle)style); } -#endif wxBrush::wxBrush(const wxBitmap &stippleBitmap) { diff --git a/src/dfb/pen.cpp b/src/dfb/pen.cpp index a7ae3ef5f4..b714d2c8fd 100644 --- a/src/dfb/pen.cpp +++ b/src/dfb/pen.cpp @@ -67,12 +67,10 @@ wxPen::wxPen(const wxColour &colour, int width, wxPenStyle style) m_refData = new wxPenRefData(colour, style); } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& col, int width, int style) { m_refData = new wxPenRefData(col, (wxPenStyle)style); } -#endif wxPen::wxPen(const wxBitmap& WXUNUSED(stipple), int WXUNUSED(width)) { diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index 47d180962e..e0a86c166a 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -246,7 +246,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent, wxDEFAULT_CONTROL_BORDER ); #if defined(__WXMSW__) - m_text->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)); + m_text->SetFont(wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); #endif //#if defined(__WXPM__) diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index b61408e34d..f88821a4b1 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -60,12 +60,10 @@ wxBrush::wxBrush( const wxColour &colour, wxBrushStyle style ) m_refData = new wxBrushRefData(colour, style); } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData(col, (wxBrushStyle)style); } -#endif wxBrush::wxBrush( const wxBitmap &stippleBitmap ) { diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 9cd46bac4b..6db81f65ed 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -113,6 +113,18 @@ void wxFontRefData::Init(int pointSize, const wxString& faceName, wxFontEncoding WXUNUSED(encoding)) { + // Old code could wrongly specify wxDEFAULT instead of -1 or wxNORMAL or, + // preferably, wxFONTSTYLE_NORMAL or wxFONTWEIGHT_NORMAL, continue handling + // this for compatibility. + if ( pointSize == wxDEFAULT ) + pointSize = -1; + + if ( static_cast(style) == wxDEFAULT ) + style = wxFONTSTYLE_NORMAL; + + if ( static_cast(weight) == wxDEFAULT ) + weight = wxFONTWEIGHT_NORMAL; + if (family == wxFONTFAMILY_DEFAULT) family = wxFONTFAMILY_SWISS; @@ -130,11 +142,9 @@ void wxFontRefData::Init(int pointSize, SetFamily(family); } - SetStyle( style == wxDEFAULT ? wxFONTSTYLE_NORMAL : style ); - SetPointSize( (pointSize == wxDEFAULT || pointSize == -1) - ? wxDEFAULT_FONT_SIZE - : pointSize ); - SetWeight( weight == wxDEFAULT ? wxFONTWEIGHT_NORMAL : weight ); + SetStyle( style ); + SetPointSize( pointSize == -1 ? wxDEFAULT_FONT_SIZE : pointSize ); + SetWeight( weight ); SetUnderlined( underlined ); SetStrikethrough( strikethrough ); } diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index 971f3efc2d..76e6fa632d 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -95,7 +95,6 @@ wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style ) M_PENDATA->m_colour = colour; } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& colour, int width, int style) { m_refData = new wxPenRefData(); @@ -103,7 +102,6 @@ wxPen::wxPen(const wxColour& colour, int width, int style) M_PENDATA->m_style = (wxPenStyle)style; M_PENDATA->m_colour = colour; } -#endif wxPen::~wxPen() { diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index 647c95a500..a63ff02da6 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -62,14 +62,12 @@ wxBrush::wxBrush( const wxColour &colour, wxBrushStyle style ) M_BRUSHDATA->m_colour = colour; } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData; M_BRUSHDATA->m_style = (wxBrushStyle)style; M_BRUSHDATA->m_colour = col; } -#endif wxBrush::wxBrush( const wxBitmap &stippleBitmap ) { diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 2d283c4210..1e24a693a4 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -95,7 +95,6 @@ wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style ) M_PENDATA->m_colour = colour; } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& colour, int width, int style) { m_refData = new wxPenRefData(); @@ -103,7 +102,6 @@ wxPen::wxPen(const wxColour& colour, int width, int style) M_PENDATA->m_style = (wxPenStyle)style; M_PENDATA->m_colour = colour; } -#endif wxGDIRefData *wxPen::CreateGDIRefData() const { diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index c208c756d6..ef91722efd 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -1329,12 +1329,14 @@ void wxHtmlHelpWindow::OptionsDialog() // are so that we can pass them to the dialog: if (m_NormalFace.empty()) { - wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false); + wxFont fnt(m_FontSize, + wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); m_NormalFace = fnt.GetFaceName(); } if (m_FixedFace.empty()) { - wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false); + wxFont fnt(m_FontSize, + wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); m_FixedFace = fnt.GetFaceName(); } diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index e4f0089aa9..9973cf19a5 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -611,9 +611,9 @@ wxFont* wxHtmlWinParser::CreateCurrentFont() *faceptr = face; *fontptr = new wxFont( (int) (m_FontsSizes[fs] * m_FontScale), - ff ? wxMODERN : wxSWISS, - fi ? wxITALIC : wxNORMAL, - fb ? wxBOLD : wxNORMAL, + ff ? wxFONTFAMILY_MODERN : wxFONTFAMILY_SWISS, + fi ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL, + fb ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, fu ? true : false, face #if wxUSE_UNICODE ); diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index bba5213157..e0311972b0 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -232,12 +232,10 @@ wxBrush::wxBrush(const wxColour& col, wxBrushStyle style) m_refData = new wxBrushRefData(col, style); } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData(col, (wxBrushStyle)style); } -#endif wxBrush::wxBrush(const wxBitmap& stipple) { diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index b8bc80a2e8..802469f875 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -785,7 +785,7 @@ wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer , const wxB : wxGraphicsObjectRefData(renderer) { Init(); - if ( brush.GetStyle() == wxSOLID) + if ( brush.GetStyle() == wxBRUSHSTYLE_SOLID) { m_brush = new SolidBrush(wxColourToColor( brush.GetColour())); } @@ -2114,7 +2114,7 @@ wxGraphicsMatrix wxGDIPlusRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDoub wxGraphicsPen wxGDIPlusRenderer::CreatePen(const wxPen& pen) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsPen); - if ( !pen.IsOk() || pen.GetStyle() == wxTRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) return wxNullGraphicsPen; else { @@ -2127,7 +2127,7 @@ wxGraphicsPen wxGDIPlusRenderer::CreatePen(const wxPen& pen) wxGraphicsBrush wxGDIPlusRenderer::CreateBrush(const wxBrush& brush ) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsBrush); - if ( !brush.IsOk() || brush.GetStyle() == wxTRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) return wxNullGraphicsBrush; else { diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index a0bad36f81..7d593500ca 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -432,12 +432,10 @@ wxPen::wxPen(const wxColour& col, int width, wxPenStyle style) m_refData = new wxPenRefData(col, width, style); } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& colour, int width, int style) { m_refData = new wxPenRefData(colour, width, (wxPenStyle)style); } -#endif wxPen::wxPen(const wxBitmap& stipple, int width) { diff --git a/src/os2/brush.cpp b/src/os2/brush.cpp index 6bfcd5a779..a8523da3fd 100644 --- a/src/os2/brush.cpp +++ b/src/os2/brush.cpp @@ -116,14 +116,12 @@ wxBrush::wxBrush( RealizeResource(); } // end of wxBrush::wxBrush -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData(col, (wxBrushStyle)style); RealizeResource(); } -#endif wxBrush::wxBrush(const wxBitmap& rStipple) { diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index 417a2c471e..c9c2e47454 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -148,14 +148,12 @@ wxPen::wxPen( RealizeResource(); } // end of wxPen::wxPen -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& colour, int width, int style) { m_refData = new wxPenRefData(colour, width, (wxPenStyle)style); RealizeResource(); } -#endif wxPen::wxPen( const wxBitmap& rStipple diff --git a/src/osx/brush.cpp b/src/osx/brush.cpp index 66b0dc397c..296779c8ac 100644 --- a/src/osx/brush.cpp +++ b/src/osx/brush.cpp @@ -99,12 +99,10 @@ wxBrush::wxBrush(const wxColour& col, wxBrushStyle style) m_refData = new wxBrushRefData( col, style ); } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData(col, (wxBrushStyle)style); } -#endif wxBrush::wxBrush(const wxBitmap& stipple) { diff --git a/src/osx/pen.cpp b/src/osx/pen.cpp index 4dd5407b0b..e5608fefdb 100644 --- a/src/osx/pen.cpp +++ b/src/osx/pen.cpp @@ -111,7 +111,6 @@ wxPen::wxPen(const wxColour& col, int Width, wxPenStyle Style) RealizeResource(); } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& col, int Width, int Style) { m_refData = new wxPenRefData; @@ -126,7 +125,6 @@ wxPen::wxPen(const wxColour& col, int Width, int Style) RealizeResource(); } -#endif wxPen::wxPen(const wxBitmap& stipple, int Width) { diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index bc8a3b55d7..33c9a7987f 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1548,7 +1548,7 @@ void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) ) int state = m_state; if ( !(state & wxSCB_STATE_UNSPECIFIED) && - GetFont().GetWeight() == wxBOLD ) + GetFont().GetWeight() == wxFONTWEIGHT_BOLD ) state |= wxSCB_STATE_BOLD; DrawSimpleCheckBox(dc, rect, m_boxHeight, state); @@ -1648,7 +1648,7 @@ void wxPGCheckBoxEditor::DrawValue( wxDC& dc, const wxRect& rect, if ( !property->IsValueUnspecified() ) { state = property->GetChoiceSelection(); - if ( dc.GetFont().GetWeight() == wxBOLD ) + if ( dc.GetFont().GetWeight() == wxFONTWEIGHT_BOLD ) state |= wxSCB_STATE_BOLD; } else diff --git a/src/richtext/richtextbackgroundpage.cpp b/src/richtext/richtextbackgroundpage.cpp index 56f14cafd8..5e8d26e18d 100644 --- a/src/richtext/richtextbackgroundpage.cpp +++ b/src/richtext/richtextbackgroundpage.cpp @@ -117,7 +117,7 @@ void wxRichTextBackgroundPage::CreateControls() itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); wxStaticText* itemStaticText5 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Background"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText5->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText5->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine6 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); diff --git a/src/richtext/richtextborderspage.cpp b/src/richtext/richtextborderspage.cpp index 0a9b642ad1..e1eaa93fdb 100644 --- a/src/richtext/richtextborderspage.cpp +++ b/src/richtext/richtextborderspage.cpp @@ -230,7 +230,7 @@ void wxRichTextBordersPage::CreateControls() wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer7->Add(itemBoxSizer8, 0, wxGROW, 5); wxStaticText* itemStaticText9 = new wxStaticText( itemPanel5, wxID_STATIC, _("Border"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText9->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText9->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine10 = new wxStaticLine( itemPanel5, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -399,7 +399,7 @@ void wxRichTextBordersPage::CreateControls() wxBoxSizer* itemBoxSizer51 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer50->Add(itemBoxSizer51, 0, wxGROW, 5); wxStaticText* itemStaticText52 = new wxStaticText( itemPanel48, wxID_STATIC, _("Outline"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText52->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText52->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer51->Add(itemStaticText52, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine53 = new wxStaticLine( itemPanel48, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -567,7 +567,7 @@ void wxRichTextBordersPage::CreateControls() wxBoxSizer* itemBoxSizer94 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer93->Add(itemBoxSizer94, 0, wxGROW, 5); wxStaticText* itemStaticText95 = new wxStaticText( itemPanel91, wxID_STATIC, _("Corner"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText95->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText95->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer94->Add(itemStaticText95, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine96 = new wxStaticLine( itemPanel91, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); diff --git a/src/richtext/richtextmarginspage.cpp b/src/richtext/richtextmarginspage.cpp index 6b896841f0..f9233d7222 100644 --- a/src/richtext/richtextmarginspage.cpp +++ b/src/richtext/richtextmarginspage.cpp @@ -169,7 +169,7 @@ void wxRichTextMarginsPage::CreateControls() itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5); wxStaticText* itemStaticText5 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Margins"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText5->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText5->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine6 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -283,7 +283,7 @@ void wxRichTextMarginsPage::CreateControls() itemBoxSizer3->Add(itemBoxSizer28, 0, wxGROW, 5); wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Padding"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText29->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText29->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer28->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine30 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); diff --git a/src/richtext/richtextsizepage.cpp b/src/richtext/richtextsizepage.cpp index a8472c5530..3d9d7d5834 100644 --- a/src/richtext/richtextsizepage.cpp +++ b/src/richtext/richtextsizepage.cpp @@ -225,7 +225,7 @@ void wxRichTextSizePage::CreateControls() itemBoxSizer6->Add(itemBoxSizer7, 0, wxGROW, 5); wxStaticText* itemStaticText8 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Floating"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText8->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText8->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine9 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -262,7 +262,7 @@ void wxRichTextSizePage::CreateControls() m_alignmentSizer->Add(itemBoxSizer17, 0, wxGROW, 5); wxStaticText* itemStaticText18 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText18->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText18->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine19 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -295,7 +295,7 @@ void wxRichTextSizePage::CreateControls() m_parentSizer->Add(itemBoxSizer24, 0, wxGROW, 5); wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText25->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText25->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine26 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -492,7 +492,7 @@ void wxRichTextSizePage::CreateControls() m_positionControls->Add(itemBoxSizer59, 0, wxGROW, 5); wxStaticText* itemStaticText60 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Position"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText60->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemStaticText60->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxFONTWEIGHT_BOLD)); itemBoxSizer59->Add(itemStaticText60, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticLine* itemStaticLine61 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index da3c628989..9c482459c1 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -556,7 +556,7 @@ void wxSymbolPickerDialog::UpdateSymbolDisplay(bool updateSymbolList, bool showA if (!fontNameToUse.empty()) { - font = wxFont(14, wxDEFAULT, wxNORMAL, wxNORMAL, false, fontNameToUse); + font = wxFont(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, fontNameToUse); } else font = *wxNORMAL_FONT; diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 024827ccc1..f8e90f72c1 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -4217,8 +4217,8 @@ void wxStyledTextCtrl::StyleSetFont(int styleNum, wxFont& font) { #endif int size = font.GetPointSize(); wxString faceName = font.GetFaceName(); - bool bold = font.GetWeight() == wxBOLD; - bool italic = font.GetStyle() != wxNORMAL; + bool bold = font.GetWeight() == wxFONTWEIGHT_BOLD; + bool italic = font.GetStyle() != wxFONTSTYLE_NORMAL; bool under = font.GetUnderlined(); wxFontEncoding encoding = font.GetEncoding(); diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp index 92460caed4..a792aab2c7 100644 --- a/src/x11/brush.cpp +++ b/src/x11/brush.cpp @@ -63,14 +63,12 @@ wxBrush::wxBrush( const wxColour &colour, wxBrushStyle style ) M_BRUSHDATA->m_colour = colour; } -#if WXWIN_COMPATIBILITY_3_0 wxBrush::wxBrush(const wxColour& col, int style) { m_refData = new wxBrushRefData; M_BRUSHDATA->m_style = (wxBrushStyle)style; M_BRUSHDATA->m_colour = col; } -#endif wxBrush::wxBrush( const wxBitmap &stippleBitmap ) { diff --git a/src/x11/pen.cpp b/src/x11/pen.cpp index 62f0b1e9fa..ec7da519b0 100644 --- a/src/x11/pen.cpp +++ b/src/x11/pen.cpp @@ -85,7 +85,6 @@ wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style ) M_PENDATA->m_colour = colour; } -#if WXWIN_COMPATIBILITY_3_0 wxPen::wxPen(const wxColour& colour, int width, int style) { m_refData = new wxPenRefData(); @@ -93,7 +92,6 @@ wxPen::wxPen(const wxColour& colour, int width, int style) M_PENDATA->m_style = (wxPenStyle)style; M_PENDATA->m_colour = colour; } -#endif wxPen::~wxPen() {