Fixed typemaps for wxArrayInt

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-01-14 21:27:56 +00:00
parent 39e44445a6
commit 56d3350d72
2 changed files with 14 additions and 3 deletions

View File

@@ -1804,8 +1804,8 @@ public:
const wxGridCellCoordsArray& GetSelectedCells() const; const wxGridCellCoordsArray& GetSelectedCells() const;
const wxGridCellCoordsArray& GetSelectionBlockTopLeft() const; const wxGridCellCoordsArray& GetSelectionBlockTopLeft() const;
const wxGridCellCoordsArray& GetSelectionBlockBottomRight() const; const wxGridCellCoordsArray& GetSelectionBlockBottomRight() const;
const wxArrayInt& GetSelectedRows() const; const wxArrayInt GetSelectedRows() const;
const wxArrayInt& GetSelectedCols() const; const wxArrayInt GetSelectedCols() const;
// This function returns the rectangle that encloses the block of cells // This function returns the rectangle that encloses the block of cells

View File

@@ -313,7 +313,7 @@ $function
} }
// Typemap to convert an array of ints to a list // Typemaps to convert an array of ints to a list
%typemap(python, out) wxArrayInt& { %typemap(python, out) wxArrayInt& {
$target = PyList_New(0); $target = PyList_New(0);
size_t idx; size_t idx;
@@ -324,6 +324,17 @@ $function
} }
} }
%typemap(python, out) wxArrayInt {
$target = PyList_New(0);
size_t idx;
for (idx = 0; idx < $source->GetCount(); idx += 1) {
PyObject* val = PyInt_FromLong($source->Item(idx));
PyList_Append($target, val);
Py_DECREF(val);
}
delete $source;
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Map T_OUTPUTs for floats to return ints. // Map T_OUTPUTs for floats to return ints.