handle returning the cookie for Get[First|Next]Selected like in the treectrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -333,22 +333,44 @@ public:
|
|||||||
// this method is valid for both single and multi selection listboxes
|
// this method is valid for both single and multi selection listboxes
|
||||||
size_t GetSelectedCount() const;
|
size_t GetSelectedCount() const;
|
||||||
|
|
||||||
// get the first selected item, returns wxNOT_FOUND if none
|
%extend {
|
||||||
//
|
// get the first selected item, returns wxNOT_FOUND if none
|
||||||
// cookie is an opaque parameter which should be passed to
|
//
|
||||||
// GetNextSelected() later
|
// cookie is an opaque parameter which should be passed to
|
||||||
//
|
// GetNextSelected() later
|
||||||
// this method is only valid for the multi selection listboxes
|
//
|
||||||
int GetFirstSelected(unsigned long& cookie) const;
|
// this method is only valid for the multi selection listboxes
|
||||||
|
//int GetFirstSelected(unsigned long& cookie) const;
|
||||||
|
PyObject* GetFirstSelected() {
|
||||||
|
unsigned long cookie = 0;
|
||||||
|
int selected = self->GetFirstSelected(cookie);
|
||||||
|
bool blocked = wxPyBeginBlockThreads();
|
||||||
|
PyObject* tup = PyTuple_New(2);
|
||||||
|
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(selected));
|
||||||
|
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie));
|
||||||
|
wxPyEndBlockThreads(blocked);
|
||||||
|
return tup;
|
||||||
|
}
|
||||||
|
|
||||||
// get next selection item, return wxNOT_FOUND if no more
|
// get next selection item, return wxNOT_FOUND if no more
|
||||||
//
|
//
|
||||||
// cookie must be the same parameter that was passed to GetFirstSelected()
|
// cookie must be the same parameter that was passed to GetFirstSelected()
|
||||||
// before
|
// before
|
||||||
//
|
//
|
||||||
// this method is only valid for the multi selection listboxes
|
// this method is only valid for the multi selection listboxes
|
||||||
int GetNextSelected(unsigned long& cookie) const;
|
// int GetNextSelected(unsigned long& cookie) const;
|
||||||
|
PyObject* GetNextSelected(unsigned long cookie) {
|
||||||
|
int selected = self->GetNextSelected(cookie);
|
||||||
|
bool blocked = wxPyBeginBlockThreads();
|
||||||
|
PyObject* tup = PyTuple_New(2);
|
||||||
|
PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(selected));
|
||||||
|
PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(cookie));
|
||||||
|
wxPyEndBlockThreads(blocked);
|
||||||
|
return tup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// get the margins around each item
|
// get the margins around each item
|
||||||
wxPoint GetMargins() const;
|
wxPoint GetMargins() const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user