X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c25f90f60ceb17d33900f6a94f7f4ff2a009c584..c533405853e8144ce8c0450f920207d0bd7160a4:/wxPython/src/grid.i diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 225f899087..c9491150ef 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -455,6 +455,20 @@ class wxGridCellAttr; #define wxGRID_VALUE_DATETIME "datetime" +// magic constant which tells (to some functions) to automatically calculate +// the appropriate size +enum { wxGRID_AUTOSIZE }; + + +// many wxGrid methods work either with columns or rows, this enum is used for +// the parameter indicating which one should it be +enum wxGridDirection +{ + wxGRID_COLUMN, + wxGRID_ROW +}; + + %immutable; const wxGridCellCoords wxGridNoCellCoords; const wxRect wxGridNoCellRect; @@ -593,6 +607,7 @@ public: rval = *ptr; } else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { + PyErr_Clear(); // Clear the exception left over from wxPyConvertSwigPtr PyObject* o1 = PySequence_GetItem(ro, 0); PyObject* o2 = PySequence_GetItem(ro, 1); if (PyNumber_Check(o1) && PyNumber_Check(o2)) @@ -1605,7 +1620,7 @@ public: def __str__(self): return str(self.Get()) def __repr__(self): return 'wxGridCellCoords'+str(self.Get()) def __len__(self): return len(self.Get()) - def __getitem__(self, index): return self.asTuple()[index] + def __getitem__(self, index): return self.Get()[index] def __setitem__(self, index, val): if index == 0: self.SetRow(val) elif index == 1: self.SetCol(val) @@ -2142,6 +2157,23 @@ public: }; +// ---------------------------------------------------------------------------- +// wxGridUpdateLocker prevents updates to a grid during its lifetime +// ---------------------------------------------------------------------------- + +class wxGridUpdateLocker +{ +public: + // if the pointer is NULL, Create() can be called later + wxGridUpdateLocker(wxGrid *grid = NULL); + ~wxGridUpdateLocker(); + + // can be called if ctor was used with a NULL pointer, must not be called + // more than once + void Create(wxGrid *grid); + +}; + //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // Grid events and stuff