X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b09cac450645c3b93baff6d50c412c9612869fe5..5df8beb1d95030c94f678458fc1980049f537992:/include/wx/brush.h diff --git a/include/wx/brush.h b/include/wx/brush.h index 08fc16b5ff..85973acb06 100644 --- a/include/wx/brush.h +++ b/include/wx/brush.h @@ -34,7 +34,7 @@ enum wxBrushStyle wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH, wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH, wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH, - wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH, + wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH }; @@ -96,5 +96,24 @@ public: extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList; -#endif - // _WX_BRUSH_H_BASE_ +// provide comparison operators to allow code such as +// +// if ( brush.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==(wxBrushStyle s, wxDeprecatedGUIConstants t) +{ + return wx_static_cast(int, s) == wx_static_cast(int, t); +} + +inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t) +{ + return !(s == t); +} + +#endif // FUTURE_WXWIN_COMPATIBILITY_3_0 + +#endif // _WX_BRUSH_H_BASE_