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
This commit is contained in:
Vadim Zeitlin
2014-01-06 12:42:37 +00:00
parent f5b1cc026d
commit bd30752410
58 changed files with 341 additions and 379 deletions

View File

@@ -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<int>(s) == static_cast<int>(t);
}
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only")
inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
return !(s == t);
return static_cast<int>(s) != static_cast<int>(t);
}
#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // WXWIN_COMPATIBILITY_3_0
#endif // _WX_BRUSH_H_BASE_

View File

@@ -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();

View File

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

View File

@@ -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();

View File

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

View File

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

View File

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

View File

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

View File

@@ -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<int>(s) == static_cast<int>(t); }
{ return static_cast<int>(s) == static_cast<int>(t); }
wxDEPRECATED_MSG("use wxFONTFAMILY_XXX constants") \
inline bool operator!=(wxFontFamily s, wxDeprecatedGUIConstants t)
{ return !(s == t); }
{ return static_cast<int>(s) != static_cast<int>(t); }
wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \
inline bool operator==(wxFontStyle s, wxDeprecatedGUIConstants t)
{ return static_cast<int>(s) == static_cast<int>(t); }
{ return static_cast<int>(s) == static_cast<int>(t); }
wxDEPRECATED_MSG("use wxFONTSTYLE_XXX constants") \
inline bool operator!=(wxFontStyle s, wxDeprecatedGUIConstants t)
{ return !(s == t); }
{ return static_cast<int>(s) != static_cast<int>(t); }
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \
inline bool operator==(wxFontWeight s, wxDeprecatedGUIConstants t)
{ return static_cast<int>(s) == static_cast<int>(t); }
{ return static_cast<int>(s) == static_cast<int>(t); }
wxDEPRECATED_MSG("use wxFONTWEIGHT_XXX constants") \
inline bool operator!=(wxFontWeight s, wxDeprecatedGUIConstants t)
{ return !(s == t); }
{ return static_cast<int>(s) != static_cast<int>(t); }
#endif // // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // WXWIN_COMPATIBILITY_3_0
#endif
// _WX_FONT_H_BASE_
#endif // _WX_FONT_H_BASE_

View File

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

View File

@@ -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.
//

View File

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

View File

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

View File

@@ -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();

View File

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

View File

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

View File

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

View File

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

View File

@@ -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();

View File

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

View File

@@ -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!
//

View File

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

View File

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

View File

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

View File

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

View File

@@ -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<int>(s) == static_cast<int>(t);
}
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t)
{
return !(s == t);
return static_cast<int>(s) != static_cast<int>(t);
}
#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // WXWIN_COMPATIBILITY_3_0
#endif // _WX_PEN_H_BASE_

View File

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

View File

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

View File

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