add comparison operators for wxPen/BrushStyle and wxSOLID/... constants to avoid warnings in the existing code using such comparisons
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -132,5 +132,24 @@ public:
|
||||
|
||||
extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
|
||||
|
||||
#endif
|
||||
// _WX_PEN_H_BASE_
|
||||
// provide comparison operators to allow code such as
|
||||
//
|
||||
// if ( pen.GetStyle() == wxTRANSPARENT )
|
||||
//
|
||||
// to compile without warnings which it would otherwise provoke from some
|
||||
// compilers as it compares elements of different enums
|
||||
#if FUTURE_WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
inline bool operator==(wxPenStyle s, wxDeprecatedGUIConstants t)
|
||||
{
|
||||
return wx_static_cast(int, s) == wx_static_cast(int, t);
|
||||
}
|
||||
|
||||
inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t)
|
||||
{
|
||||
return !(s == t);
|
||||
}
|
||||
|
||||
#endif // FUTURE_WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
#endif // _WX_PEN_H_BASE_
|
||||
|
Reference in New Issue
Block a user