X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5d2d8f6ae38287516603c6e2e5ea81c7fee5efd6..5df8beb1d95030c94f678458fc1980049f537992:/include/wx/pen.h?ds=sidebyside diff --git a/include/wx/pen.h b/include/wx/pen.h index 49d75c5458..b94486f364 100644 --- a/include/wx/pen.h +++ b/include/wx/pen.h @@ -49,7 +49,7 @@ enum wxPenJoin wxJOIN_BEVEL = 120, wxJOIN_MITER, - wxJOIN_ROUND, + wxJOIN_ROUND }; enum wxPenCap @@ -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_