Add wx.Position
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -240,7 +240,8 @@ static wxPyCoreAPI API = {
|
||||
wxArrayDouble2PyList_helper,
|
||||
wxPoint2D_LIST_helper,
|
||||
wxRect2D_helper,
|
||||
|
||||
wxPosition_helper,
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1106,6 +1106,59 @@ public:
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
class wxPosition
|
||||
{
|
||||
public:
|
||||
wxPosition(int row=0, int col=0);
|
||||
~wxPosition();
|
||||
|
||||
int GetRow() const;
|
||||
int GetColumn() const;
|
||||
int GetCol() const;
|
||||
void SetRow(int row);
|
||||
void SetColumn(int column);
|
||||
void SetCol(int column);
|
||||
|
||||
%extend {
|
||||
DocStr(__eq__, "Test for equality of wx.Position objects.", "");
|
||||
bool __eq__(PyObject* other) {
|
||||
wxPosition temp, *obj = &temp;
|
||||
if ( other == Py_None ) return false;
|
||||
if ( ! wxPosition_helper(other, &obj) ) {
|
||||
PyErr_Clear();
|
||||
return false;
|
||||
}
|
||||
return self->operator==(*obj);
|
||||
}
|
||||
|
||||
|
||||
DocStr(__ne__, "Test for inequality of wx.Position objects.", "");
|
||||
bool __ne__(PyObject* other) {
|
||||
wxPosition temp, *obj = &temp;
|
||||
if ( other == Py_None ) return true;
|
||||
if ( ! wxPosition_helper(other, &obj)) {
|
||||
PyErr_Clear();
|
||||
return true;
|
||||
}
|
||||
return self->operator!=(*obj);
|
||||
}
|
||||
}
|
||||
|
||||
%nokwargs operator+;
|
||||
%nokwargs operator-;
|
||||
wxPosition operator+(const wxPosition& p) const;
|
||||
wxPosition operator-(const wxPosition& p) const;
|
||||
wxPosition operator+(const wxSize& s) const;
|
||||
wxPosition operator-(const wxSize& s) const;
|
||||
|
||||
%property(row, GetRow, SetRow);
|
||||
%property(col, GetCol, SetCol);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%immutable;
|
||||
|
Reference in New Issue
Block a user