X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/edef87c8274bd4cadcccc4ff107aeb1815e48460..e7b8da226f3270abdecacd220a44843e869537f0:/include/wx/gdicmn.h diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index f4d5bc365e..b6faf8900d 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -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; }; @@ -474,7 +488,7 @@ public: wxFontEncoding encoding = wxFONTENCODING_DEFAULT); }; -WX_DECLARE_STRING_HASH_MAP( wxColour *, wxStringToColourHashMap ) +WX_DECLARE_STRING_HASH_MAP( wxColour *, wxStringToColourHashMap ); class WXDLLEXPORT wxColourDatabase {