]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 840721 ] convenience function wxRect::GetBottomRight
authorJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 12:33:11 +0000 (12:33 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 12:33:11 +0000 (12:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/rect.tex
include/wx/gdicmn.h

index 63216a5bbf71e8da9fcc10fdedaab0b0a1f103a5..d9905a99dcfb26cb668fb3e8054b19bab25e119e 100644 (file)
@@ -103,6 +103,18 @@ Gets the left point of the rectangle (the same as \helpref{wxRect::GetX}{wxrectg
 
 Gets the position.
 
+\membersection{wxRect::GetTopLeft}\label{wxrectgettopleft}
+
+\constfunc{wxPoint}{GetTopLeft}{\void}
+
+Gets the topleft position of the rectangle. (Same as GetPosition).
+
+\membersection{wxRect::GetBottomRight}\label{wxrectgetbottomright}
+
+\constfunc{wxPoint}{GetBottomRight}{\void}
+
+Gets the the bottom right position. Returns the bottom right point inside the rectangle.
+
 \membersection{wxRect::GetRight}\label{wxrectgetright}
 
 \constfunc{int}{GetRight}{\void}
index a03e1d77fe897ac68ba2a857076ddc525e6b6c3c..9f81bff7d47ffe633cf68722e183e0f57c7e2e5d 100644 (file)
@@ -311,6 +311,16 @@ public:
     wxSize GetSize() const { return wxSize(width, height); }
     void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); }
 
+    wxPoint GetTopLeft() const { return GetPosition(); }
+    wxPoint GetLeftTop() const { return GetTopLeft(); }
+    void SetTopLeft(const wxPoint &p) { SetPosition(p); }
+    void SetLeftTop(const wxPoint &p) { SetTopLeft(p); }
+
+    wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); }
+    wxPoint GetRightBottom() const { return GetBottomRight(); }
+    void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); }
+    void SetRightBottom(const wxPoint &p) { SetBottomRight(p); }
+
     int GetLeft()   const { return x; }
     int GetTop()    const { return y; }
     int GetBottom() const { return y + height - 1; }