X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f5c62f982ff185daf8bed1f87ef7214fbb6d8cc..5851053a968330aea0a4bd6918b330eb0bfa0007:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index d38fe44b93..f823993b03 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gdicmn.h +// Name: wx/gdicmn.h // Purpose: Common GDI classes, types and declarations // Author: Julian Smart // Modified by: @@ -428,6 +428,20 @@ public: } + // centre this rectangle in the given (usually, but not necessarily, + // larger) one + wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const + { + return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x, + dir & wxVERTICAL ? r.y + (r.height - height)/2 : y, + width, height); + } + + wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const + { + return CentreIn(r, dir); + } + public: int x, y, width, height; }; @@ -489,8 +503,10 @@ public: // add a new colour to the database void AddColour(const wxString& name, const wxColour& colour); +#if WXWIN_COMPATIBILITY_2_6 // deprecated, use Find() instead wxDEPRECATED( wxColour *FindColour(const wxString& name) ); +#endif // WXWIN_COMPATIBILITY_2_6 #ifdef __WXPM__