Add wxPoint::IsFullySpecified() and SetDefaults().
These methods do the same thing as wxSize methods with the same names and are useful for the same reasons. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -524,6 +524,18 @@ public:
|
||||
|
||||
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; }
|
||||
|
||||
// check if both components are set/initialized
|
||||
bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; }
|
||||
|
||||
// fill in the unset components with the values from the other point
|
||||
void SetDefaults(const wxPoint& pt)
|
||||
{
|
||||
if ( x == wxDefaultCoord )
|
||||
x = pt.x;
|
||||
if ( y == wxDefaultCoord )
|
||||
y = pt.y;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user