X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bb0054cda81e7a6a6e1f33f4b47e46f529110f14..9cce9de16f93d260e9089bda724e9cf2e3b36b26:/utils/wxPython/src/windows2.i?ds=sidebyside diff --git a/utils/wxPython/src/windows2.i b/utils/wxPython/src/windows2.i index bd63b5136b..6aa7c46e7c 100644 --- a/utils/wxPython/src/windows2.i +++ b/utils/wxPython/src/windows2.i @@ -120,7 +120,30 @@ public: %name(GetDefCellAlignment)int GetCellAlignment(); wxColour& GetCellBackgroundColour(int row, int col); %name(GetDefCellBackgroundColour) wxColour& GetCellBackgroundColour(); + //wxGridCell *** GetCells(); + %addmethods { + PyObject* GetCells() { + int row, col; + PyObject* rows = PyList_New(0); + for (row=0; row < self->GetRows(); row++) { + PyObject* rowList = PyList_New(0); + for (col=0; col < self->GetCols(); col++) { + wxGridCell* cell = self->GetCell(row, col); + + bool doSave = wxPyRestoreThread(); + PyObject* pyCell = wxPyConstructObject(cell, "wxGridCell"); + wxPySaveThread(doSave); + + if (PyList_Append(rowList, pyCell) == -1) + return NULL; + } + if (PyList_Append(rows, rowList) == -1) + return NULL; + } + return rows; + } + } wxColour& GetCellTextColour(int row, int col); %name(GetDefCellTextColour)wxColour& GetCellTextColour(); wxFont& GetCellTextFont(int row, int col); @@ -174,6 +197,10 @@ public: void SetRowHeight(int row, int height); void UpdateDimensions(); + + bool GetEditInPlace(); + void SetEditInPlace(int edit = TRUE); + }; @@ -186,6 +213,13 @@ public: bool m_control; bool m_shift; wxGridCell* m_cell; + + int GetRow(); + int GetCol(); + wxPoint GetPosition(); + bool ControlDown(); + bool ShiftDown(); + wxGridCell* GetCell(); };