X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12d1116bee8820bb1850f6f3ec63aa8a81b8e53f..3979290c611fa74cb3e64ab09e3b5b35160c082f:/wxPython/src/gtk/controls2.cpp diff --git a/wxPython/src/gtk/controls2.cpp b/wxPython/src/gtk/controls2.cpp index a3299838d8..c0d25e8761 100644 --- a/wxPython/src/gtk/controls2.cpp +++ b/wxPython/src/gtk/controls2.cpp @@ -100,6 +100,8 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { DECLARE_DEF_STRING(DirDialogDefaultFolderStr); static const wxString wxPyEmptyString(wxT("")); + + static const long longzero = 0; // C++ Version of a Python aware class class wxPyListCtrl : public wxListCtrl { DECLARE_ABSTRACT_CLASS(wxPyListCtrl); @@ -211,11 +213,13 @@ public: int rval = 0; bool found; wxPyBeginBlockThreads(); - if ((found = m_myInst.findCallback("OnCompareItems"))) - rval = m_myInst.callCallback(Py_BuildValue( - "(OO)", - wxPyConstructObject((void*)&item1, "wxTreeItemId"), - wxPyConstructObject((void*)&item2, "wxTreeItemId"))); + if ((found = m_myInst.findCallback("OnCompareItems"))) { + PyObject *o1 = wxPyConstructObject((void*)&item1, "wxTreeItemId"); + PyObject *o2 = wxPyConstructObject((void*)&item2, "wxTreeItemId"); + rval = m_myInst.callCallback(Py_BuildValue("(OO)",o1,o2)); + Py_DECREF(o1); + Py_DECREF(o2); + } wxPyEndBlockThreads(); if (! found) rval = wxTreeCtrl::OnCompareItems(item1, item2); @@ -2331,8 +2335,8 @@ static PyObject *_wrap_wxListEvent_m_item_get(PyObject *self, PyObject *args, Py return _resultobj; } -#define wxListEvent_GetCode(_swigobj) (_swigobj->GetCode()) -static PyObject *_wrap_wxListEvent_GetCode(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_GetKeyCode(_swigobj) (_swigobj->GetKeyCode()) +static PyObject *_wrap_wxListEvent_GetKeyCode(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; wxListEvent * _arg0; @@ -2340,18 +2344,18 @@ static PyObject *_wrap_wxListEvent_GetCode(PyObject *self, PyObject *args, PyObj char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_GetCode",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_GetKeyCode",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_GetCode. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_GetKeyCode. Expected _wxListEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxListEvent_GetCode(_arg0); + _result = (int )wxListEvent_GetKeyCode(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3008,6 +3012,7 @@ static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject * static wxListItem * wxPyListCtrl_GetColumn(wxPyListCtrl *self,int col) { wxListItem item; + item.SetMask(0xFFFF); if (self->GetColumn(col, item)) return new wxListItem(item); else @@ -6213,8 +6218,8 @@ static PyObject *_wrap_wxTreeEvent_GetKeyEvent(PyObject *self, PyObject *args, P return _resultobj; } -#define wxTreeEvent_GetCode(_swigobj) (_swigobj->GetCode()) -static PyObject *_wrap_wxTreeEvent_GetCode(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxTreeEvent_GetKeyCode(_swigobj) (_swigobj->GetKeyCode()) +static PyObject *_wrap_wxTreeEvent_GetKeyCode(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; wxTreeEvent * _arg0; @@ -6222,18 +6227,18 @@ static PyObject *_wrap_wxTreeEvent_GetCode(PyObject *self, PyObject *args, PyObj char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTreeEvent_GetCode",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTreeEvent_GetKeyCode",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeEvent_GetCode. Expected _wxTreeEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeEvent_GetKeyCode. Expected _wxTreeEvent_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxTreeEvent_GetCode(_arg0); + _result = (int )wxTreeEvent_GetKeyCode(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7692,7 +7697,7 @@ static PyObject *_wrap_wxTreeCtrl_GetFirstChild(PyObject *self, PyObject *args, wxTreeItemId * _result; wxPyTreeCtrl * _arg0; wxTreeItemId * _arg1; - long * _arg2; + long * _arg2 = (long *) &longzero; PyObject * _argo0 = 0; PyObject * _argo1 = 0; long temp; @@ -7701,7 +7706,7 @@ static PyObject *_wrap_wxTreeCtrl_GetFirstChild(PyObject *self, PyObject *args, char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_GetFirstChild",_kwnames,&_argo0,&_argo1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|O:wxTreeCtrl_GetFirstChild",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7717,6 +7722,7 @@ static PyObject *_wrap_wxTreeCtrl_GetFirstChild(PyObject *self, PyObject *args, return NULL; } } + if (_obj2) { temp = (long) PyInt_AsLong(_obj2); _arg2 = &temp; @@ -10643,7 +10649,7 @@ static PyMethodDef controls2cMethods[] = { { "new_wxPreTreeCtrl", (PyCFunction) _wrap_new_wxPreTreeCtrl, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeCtrl", (PyCFunction) _wrap_new_wxTreeCtrl, METH_VARARGS | METH_KEYWORDS }, { "wxTreeEvent_GetLabel", (PyCFunction) _wrap_wxTreeEvent_GetLabel, METH_VARARGS | METH_KEYWORDS }, - { "wxTreeEvent_GetCode", (PyCFunction) _wrap_wxTreeEvent_GetCode, METH_VARARGS | METH_KEYWORDS }, + { "wxTreeEvent_GetKeyCode", (PyCFunction) _wrap_wxTreeEvent_GetKeyCode, METH_VARARGS | METH_KEYWORDS }, { "wxTreeEvent_GetKeyEvent", (PyCFunction) _wrap_wxTreeEvent_GetKeyEvent, METH_VARARGS | METH_KEYWORDS }, { "wxTreeEvent_GetPoint", (PyCFunction) _wrap_wxTreeEvent_GetPoint, METH_VARARGS | METH_KEYWORDS }, { "wxTreeEvent_GetOldItem", (PyCFunction) _wrap_wxTreeEvent_GetOldItem, METH_VARARGS | METH_KEYWORDS }, @@ -10754,7 +10760,7 @@ static PyMethodDef controls2cMethods[] = { { "wxListEvent_GetPoint", (PyCFunction) _wrap_wxListEvent_GetPoint, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetColumn", (PyCFunction) _wrap_wxListEvent_GetColumn, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetIndex", (PyCFunction) _wrap_wxListEvent_GetIndex, METH_VARARGS | METH_KEYWORDS }, - { "wxListEvent_GetCode", (PyCFunction) _wrap_wxListEvent_GetCode, METH_VARARGS | METH_KEYWORDS }, + { "wxListEvent_GetKeyCode", (PyCFunction) _wrap_wxListEvent_GetKeyCode, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_item_get", (PyCFunction) _wrap_wxListEvent_m_item_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_pointDrag_get", (PyCFunction) _wrap_wxListEvent_m_pointDrag_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_col_get", (PyCFunction) _wrap_wxListEvent_m_col_get, METH_VARARGS | METH_KEYWORDS },