From d02bc4c8d40b855c05a4c2103a584b2ecdc7788c Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 8 Jan 2004 15:05:38 +0000 Subject: [PATCH] Applied patch [ 871014 ] Adding size of control to its position git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 5 +++++ include/wx/gdicmn.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 9fbd7a7f3c..4e88793b0b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -87,6 +87,8 @@ All: - Added some extra convenience functions to wxRect such as GetBottomRight (Hajo Kirchhoff) - Changed built-in regex library to a unicode-compatible one (Ryan Norton) +- Added extra convenience functions to wxPoint for adding a + wxSize (Wlodzimierz Skiba) All (GUI): @@ -119,6 +121,9 @@ wxMSW: - fixed enumerating of entries/groups under '/' in wxRegConfig - added wxSYS_ICONTITLE_FONT (Andreas Pflug) - added wxPATH_NORM_SHORTCUT to wxFileName +- wxComboBox::GetValue within a wxEVT_COMMAND_TEXT_UPDATED event + should now pass the correct value even if the handler for + wxEVT_COMMAND_COMBOBOX_SELECTED changed the selection wxGTK: diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 9f81bff7d4..7be6d7bcb4 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -273,6 +273,12 @@ public: wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; } wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; } + + wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } + wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } + + wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); } + wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); } }; // --------------------------------------------------------------------------- -- 2.45.2