Added accessor for the main window in generic wxListCtrl. In wxMSW
just returns self. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -740,6 +740,17 @@ public:
|
|||||||
return self->SortItems(wxPyListCtrl_SortItems, (long)func);
|
return self->SortItems(wxPyListCtrl_SortItems, (long)func);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%addmethods {
|
||||||
|
wxWindow* GetMainWindow() {
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
return self;
|
||||||
|
#else
|
||||||
|
return (wxWindow*)m_mainWin;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5032,6 +5032,40 @@ static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyOb
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static wxWindow * wxPyListCtrl_GetMainWindow(wxPyListCtrl *self) {
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
return self;
|
||||||
|
#else
|
||||||
|
return (wxWindow*)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) {
|
static void *SwigwxListViewTowxPyListCtrl(void *ptr) {
|
||||||
wxListView *src;
|
wxListView *src;
|
||||||
wxPyListCtrl *dest;
|
wxPyListCtrl *dest;
|
||||||
@@ -10880,6 +10914,7 @@ static PyMethodDef controls2cMethods[] = {
|
|||||||
{ "wxListView_Create", (PyCFunction) _wrap_wxListView_Create, METH_VARARGS | METH_KEYWORDS },
|
{ "wxListView_Create", (PyCFunction) _wrap_wxListView_Create, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxPreListView", (PyCFunction) _wrap_new_wxPreListView, METH_VARARGS | METH_KEYWORDS },
|
{ "new_wxPreListView", (PyCFunction) _wrap_new_wxPreListView, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "new_wxListView", (PyCFunction) _wrap_new_wxListView, 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_SortItems", (PyCFunction) _wrap_wxListCtrl_SortItems, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxListCtrl_GetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_GetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS },
|
{ "wxListCtrl_GetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_GetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS },
|
||||||
{ "wxListCtrl_SetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_SetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS },
|
{ "wxListCtrl_SetItemBackgroundColour", (PyCFunction) _wrap_wxListCtrl_SetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS },
|
||||||
|
@@ -635,6 +635,9 @@ class wxListCtrlPtr(wxControlPtr):
|
|||||||
def SortItems(self, *_args, **_kwargs):
|
def SortItems(self, *_args, **_kwargs):
|
||||||
val = apply(controls2c.wxListCtrl_SortItems,(self,) + _args, _kwargs)
|
val = apply(controls2c.wxListCtrl_SortItems,(self,) + _args, _kwargs)
|
||||||
return val
|
return val
|
||||||
|
def GetMainWindow(self, *_args, **_kwargs):
|
||||||
|
val = apply(controls2c.wxListCtrl_GetMainWindow,(self,) + _args, _kwargs)
|
||||||
|
return val
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<C wxListCtrl instance at %s>" % (self.this,)
|
return "<C wxListCtrl instance at %s>" % (self.this,)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user