X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/093d613e06133beb54af4ce05c50761fca7b3352..49bffb1482cd2a6a30b38280f6c9bffc72dbfe42:/wxPython/src/_gdicmn.i diff --git a/wxPython/src/_gdicmn.i b/wxPython/src/_gdicmn.i index f925aa8da3..5b86c9a6e0 100644 --- a/wxPython/src/_gdicmn.i +++ b/wxPython/src/_gdicmn.i @@ -130,6 +130,12 @@ public: ~wxSize(); +// None/NULL is now handled properly by the typemap, so these are not needed. +// %extend { +// bool __eq__(const wxSize* other) { return other ? (*self == *other) : False; } +// bool __ne__(const wxSize* other) { return other ? (*self != *other) : True; } +// } + DocDeclStr( bool, operator==(const wxSize& sz), "Test for equality of wx.Size objects."); @@ -165,6 +171,19 @@ public: int GetWidth() const; int GetHeight() const; + + DocDeclStr( + bool , IsFullySpecified() const, + "Returns True if both components of the size are non-default values."); + + + DocDeclStr( + void , SetDefaults(const wxSize& size), + "Combine this size with the other one replacing the default +components of this object (i.e. equal to -1) with those of the +other."); + + //int GetX() const; //int GetY() const; @@ -173,11 +192,11 @@ public: "Get() -> (width,height)", "Returns the width and height properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -246,11 +265,11 @@ public: "Get() -> (x,y)", "Return the x and y properties as a tuple. "); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -359,11 +378,11 @@ public: "Get() -> (x,y)", "Return the x and y properties as a tuple. "); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -527,13 +546,13 @@ public: "Get() -> (x,y,width,height)", "Return the rectangle properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(4); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } } @@ -571,10 +590,10 @@ DocAStr(wxIntersectRect, dest = reg1.GetBox(); if (dest != wxRect(0,0,0,0)) { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); wxRect* newRect = new wxRect(dest); obj = wxPyConstructObject((void*)newRect, wxT("wxRect"), True); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return obj; } Py_INCREF(Py_None); @@ -658,11 +677,11 @@ public: "Get() -> (x,y)", "Return x and y properties as a tuple."); PyObject* Get() { - wxPyBeginBlockThreads(); + bool blocked = wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->m_x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->m_y)); - wxPyEndBlockThreads(); + wxPyEndBlockThreads(blocked); return tup; } }