Better wrapper for wxListCtrl.GetColumn, and some other cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -421,7 +421,22 @@ public:
|
|||||||
bool SetBackgroundColour(const wxColour& col);
|
bool SetBackgroundColour(const wxColour& col);
|
||||||
|
|
||||||
// Gets information about this column
|
// Gets information about this column
|
||||||
bool GetColumn(int col, wxListItem& item) const;
|
// bool GetColumn(int col, wxListItem& item) const;
|
||||||
|
%addmethods {
|
||||||
|
%new wxListItem* GetColumn(int col) {
|
||||||
|
wxListItem item;
|
||||||
|
if (self->GetColumn(col, item))
|
||||||
|
return new wxListItem(item);
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
} // The OOR typemaps don't know what to do with the %new, so fix it up.
|
||||||
|
%pragma(python) addtoclass = "
|
||||||
|
def GetItem(self, *_args, **_kwargs):
|
||||||
|
val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs)
|
||||||
|
if val is not None: val.thisown = 1
|
||||||
|
return val
|
||||||
|
"
|
||||||
|
|
||||||
// Sets information about this column
|
// Sets information about this column
|
||||||
bool SetColumn(int col, wxListItem& item) ;
|
bool SetColumn(int col, wxListItem& item) ;
|
||||||
|
@@ -3182,19 +3182,23 @@ static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject *
|
|||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define wxListCtrl_GetColumn(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetColumn(_swigarg0,_swigarg1))
|
static wxListItem * wxPyListCtrl_GetColumn(wxPyListCtrl *self,int col) {
|
||||||
|
wxListItem item;
|
||||||
|
if (self->GetColumn(col, item))
|
||||||
|
return new wxListItem(item);
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyObject *kwargs) {
|
static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||||
PyObject * _resultobj;
|
PyObject * _resultobj;
|
||||||
bool _result;
|
wxListItem * _result;
|
||||||
wxPyListCtrl * _arg0;
|
wxPyListCtrl * _arg0;
|
||||||
int _arg1;
|
int _arg1;
|
||||||
wxListItem * _arg2;
|
|
||||||
PyObject * _argo0 = 0;
|
PyObject * _argo0 = 0;
|
||||||
PyObject * _argo2 = 0;
|
char *_kwnames[] = { "self","col", NULL };
|
||||||
char *_kwnames[] = { "self","col","item", NULL };
|
|
||||||
|
|
||||||
self = self;
|
self = self;
|
||||||
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxListCtrl_GetColumn",_kwnames,&_argo0,&_arg1,&_argo2))
|
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetColumn",_kwnames,&_argo0,&_arg1))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (_argo0) {
|
if (_argo0) {
|
||||||
if (_argo0 == Py_None) { _arg0 = NULL; }
|
if (_argo0 == Py_None) { _arg0 = NULL; }
|
||||||
@@ -3203,20 +3207,13 @@ static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyOb
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_argo2) {
|
|
||||||
if (_argo2 == Py_None) { _arg2 = NULL; }
|
|
||||||
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) {
|
|
||||||
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_GetColumn. Expected _wxListItem_p.");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
PyThreadState* __tstate = wxPyBeginAllowThreads();
|
||||||
_result = (bool )wxListCtrl_GetColumn(_arg0,_arg1,*_arg2);
|
_result = (wxListItem *)wxPyListCtrl_GetColumn(_arg0,_arg1);
|
||||||
|
|
||||||
wxPyEndAllowThreads(__tstate);
|
wxPyEndAllowThreads(__tstate);
|
||||||
if (PyErr_Occurred()) return NULL;
|
if (PyErr_Occurred()) return NULL;
|
||||||
} _resultobj = Py_BuildValue("i",_result);
|
}{ _resultobj = wxPyMake_wxObject(_result); }
|
||||||
return _resultobj;
|
return _resultobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -621,6 +621,12 @@ class wxListCtrlPtr(wxControlPtr):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<C wxListCtrl instance at %s>" % (self.this,)
|
return "<C wxListCtrl instance at %s>" % (self.this,)
|
||||||
|
|
||||||
|
def GetItem(self, *_args, **_kwargs):
|
||||||
|
val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs)
|
||||||
|
if val is not None: val.thisown = 1
|
||||||
|
return val
|
||||||
|
|
||||||
|
|
||||||
def GetItem(self, *_args, **_kwargs):
|
def GetItem(self, *_args, **_kwargs):
|
||||||
val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
|
val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs)
|
||||||
val.thisown = 1
|
val.thisown = 1
|
||||||
|
@@ -1676,7 +1676,7 @@ class __wxPyCleanup:
|
|||||||
|
|
||||||
sys.__wxPythonCleanup = __wxPyCleanup()
|
sys.__wxPythonCleanup = __wxPyCleanup()
|
||||||
|
|
||||||
## # another possible solution, but it gets called too eary...
|
## # another possible solution, but it gets called too early...
|
||||||
## if sys.version[0] == '2':
|
## if sys.version[0] == '2':
|
||||||
## import atexit
|
## import atexit
|
||||||
## atexit.register(wxc.wxApp_CleanUp)
|
## atexit.register(wxc.wxApp_CleanUp)
|
||||||
|
@@ -375,8 +375,8 @@ public:
|
|||||||
wxSizer* GetSizer();
|
wxSizer* GetSizer();
|
||||||
|
|
||||||
// Track if this window is a member of a sizer
|
// Track if this window is a member of a sizer
|
||||||
void SetContainingSizer(wxSizer* sizer) { m_containingSizer = sizer; }
|
void SetContainingSizer(wxSizer* sizer);
|
||||||
wxSizer *GetContainingSizer() const { return m_containingSizer; }
|
wxSizer *GetContainingSizer() const;
|
||||||
|
|
||||||
wxValidator* GetValidator();
|
wxValidator* GetValidator();
|
||||||
void SetValidator(const wxValidator& validator);
|
void SetValidator(const wxValidator& validator);
|
||||||
|
Reference in New Issue
Block a user