]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gdicmn.h
On screens with restricted space, it's useful to be able to add controls
[wxWidgets.git] / include / wx / gdicmn.h
index d38fe44b934dbe048d3d3ae411d2cf58c2448482..f823993b03a36a6535e70121edc024b0b0ac0b4e 100644 (file)
@@ -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__