Merged wxPython 2.2.2 over to the main branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -184,7 +184,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class wxListEvent: public wxCommandEvent {
|
||||
class wxListEvent: public wxNotifyEvent {
|
||||
public:
|
||||
int m_code;
|
||||
long m_itemIndex;
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
#endif
|
||||
long GetTopItem();
|
||||
long HitTest(const wxPoint& point, int& OUTPUT);
|
||||
%name(InsertColumnWith)long InsertColumn(long col, wxListItem& info);
|
||||
%name(InsertColumnInfo)long InsertColumn(long col, wxListItem& info);
|
||||
long InsertColumn(long col, const wxString& heading,
|
||||
int format = wxLIST_FORMAT_LEFT,
|
||||
int width = -1);
|
||||
@@ -380,7 +380,7 @@ public:
|
||||
|
||||
%addmethods {
|
||||
int __cmp__(wxTreeItemId* other) {
|
||||
if (! other) return 0;
|
||||
if (! other) return -1;
|
||||
return *self != *other;
|
||||
}
|
||||
}
|
||||
@@ -392,15 +392,15 @@ public:
|
||||
class wxPyTreeItemData : public wxTreeItemData {
|
||||
public:
|
||||
wxPyTreeItemData(PyObject* obj = NULL) {
|
||||
if (obj == NULL)
|
||||
if (obj == NULL)
|
||||
obj = Py_None;
|
||||
Py_INCREF(obj);
|
||||
m_obj = obj;
|
||||
Py_INCREF(obj);
|
||||
m_obj = obj;
|
||||
}
|
||||
|
||||
~wxPyTreeItemData() {
|
||||
bool doSave = wxPyRestoreThread();
|
||||
Py_DECREF(m_obj);
|
||||
Py_DECREF(m_obj);
|
||||
wxPySaveThread(doSave);
|
||||
}
|
||||
|
||||
@@ -410,7 +410,9 @@ public:
|
||||
}
|
||||
|
||||
void SetData(PyObject* obj) {
|
||||
bool doSave = wxPyRestoreThread();
|
||||
Py_DECREF(m_obj);
|
||||
wxPySaveThread(doSave);
|
||||
m_obj = obj;
|
||||
Py_INCREF(obj);
|
||||
}
|
||||
@@ -517,8 +519,8 @@ public:
|
||||
void SetItemHasChildren(const wxTreeItemId& item, bool hasChildren = TRUE);
|
||||
|
||||
%addmethods {
|
||||
// [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
|
||||
// if needed.
|
||||
// [Get|Set]ItemData substitutes. Automatically create wxPyTreeItemData
|
||||
// if needed.
|
||||
wxPyTreeItemData* GetItemData(const wxTreeItemId& item) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
if (data == NULL) {
|
||||
@@ -532,11 +534,11 @@ public:
|
||||
void SetItemData(const wxTreeItemId& item, wxPyTreeItemData* data) {
|
||||
data->SetId(item); // set the id
|
||||
self->SetItemData(item, data);
|
||||
}
|
||||
}
|
||||
|
||||
// [Get|Set]PyData are short-cuts. Also made somewhat crash-proof by
|
||||
// automatically creating data classes.
|
||||
PyObject* GetPyData(const wxTreeItemId& item) {
|
||||
// [Get|Set]PyData are short-cuts. Also made somewhat crash-proof by
|
||||
// automatically creating data classes.
|
||||
PyObject* GetPyData(const wxTreeItemId& item) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
if (data == NULL) {
|
||||
data = new wxPyTreeItemData();
|
||||
@@ -544,7 +546,7 @@ public:
|
||||
self->SetItemData(item, data);
|
||||
}
|
||||
return data->GetData();
|
||||
}
|
||||
}
|
||||
|
||||
void SetPyData(const wxTreeItemId& item, PyObject* obj) {
|
||||
wxPyTreeItemData* data = (wxPyTreeItemData*)self->GetItemData(item);
|
||||
@@ -554,7 +556,7 @@ public:
|
||||
self->SetItemData(item, data);
|
||||
} else
|
||||
data->SetData(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -575,8 +577,8 @@ public:
|
||||
size_t num, x;
|
||||
num = self->GetSelections(array);
|
||||
for (x=0; x < num; x++) {
|
||||
PyObject* item = wxPyConstructObject((void*)&array.Item(x),
|
||||
"wxTreeItemId");
|
||||
wxTreeItemId *tii = new wxTreeItemId(array.Item(x));
|
||||
PyObject* item = wxPyConstructObject((void*)tii, "wxTreeItemId", TRUE);
|
||||
PyList_Append(rval, item);
|
||||
}
|
||||
wxPySaveThread(doSave);
|
||||
|
Reference in New Issue
Block a user