X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8ccad685e7df1f1479497a699c2871df7f849cd1..c81fd4b937cedd7c53715996200b9126e2756cbc:/wxPython/src/mac/controls2.cpp?ds=inline diff --git a/wxPython/src/mac/controls2.cpp b/wxPython/src/mac/controls2.cpp index 31c75340f5..f3a5770988 100644 --- a/wxPython/src/mac/controls2.cpp +++ b/wxPython/src/mac/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 @@ -4939,6 +4944,40 @@ static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyOb return _resultobj; } +static wxWindow * wxPyListCtrl_GetMainWindow(wxPyListCtrl *self) { + #ifdef __WXMSW__ + return self; + #else + return (wxWindow*)self->m_mainWin; + #endif + } +static PyObject *_wrap_wxListCtrl_GetMainWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxPyListCtrl * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetMainWindow",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetMainWindow. Expected _wxPyListCtrl_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxPyListCtrl_GetMainWindow(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + static void *SwigwxListViewTowxPyListCtrl(void *ptr) { wxListView *src; wxPyListCtrl *dest; @@ -6213,8 +6252,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 +6261,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 +7731,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 +7740,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 +7756,7 @@ static PyObject *_wrap_wxTreeCtrl_GetFirstChild(PyObject *self, PyObject *args, return NULL; } } + if (_obj2) { temp = (long) PyInt_AsLong(_obj2); _arg2 = &temp; @@ -10643,7 +10683,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 }, @@ -10679,6 +10719,7 @@ static PyMethodDef controls2cMethods[] = { { "wxListView_Create", (PyCFunction) _wrap_wxListView_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreListView", (PyCFunction) _wrap_new_wxPreListView, METH_VARARGS | METH_KEYWORDS }, { "new_wxListView", (PyCFunction) _wrap_new_wxListView, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetMainWindow", (PyCFunction) _wrap_wxListCtrl_GetMainWindow, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_SortItems", (PyCFunction) _wrap_wxListCtrl_SortItems, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_GetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_GetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_SetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_SetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS }, @@ -10754,7 +10795,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 },