X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56f5d962ad563d79930c01b51434fb1ca6d189d6..85bc0351f76f6d3f00460a167fc108b900e0725c:/utils/wxPython/src/gtk/controls.cpp diff --git a/utils/wxPython/src/gtk/controls.cpp b/utils/wxPython/src/gtk/controls.cpp index 24e9ecf361..9bb7a1bb90 100644 --- a/utils/wxPython/src/gtk/controls.cpp +++ b/utils/wxPython/src/gtk/controls.cpp @@ -178,94 +178,67 @@ static void *SwigwxControlTowxEvtHandler(void *ptr) { return (void *) dest; } -#define new_wxControl() (new wxControl()) +#define new_wxControl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxControl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) static PyObject *_wrap_new_wxControl(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxControl * _result; - char *_kwnames[] = { NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxControl",_kwnames)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxControl *)new_wxControl(); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxControl_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - -#define wxControl_CreateControl(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (_swigobj->CreateControl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) -static PyObject *_wrap_wxControl_CreateControl(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxControl * _arg0; - wxWindow * _arg1; - wxWindowID _arg2; - wxPoint * _arg3 = (wxPoint *) &wxPyDefaultPosition; - wxSize * _arg4 = (wxSize *) &wxPyDefaultSize; - long _arg5 = (long ) 0; - wxValidator * _arg6 = (wxValidator *) &wxPyDefaultValidator; - char * _arg7 = (char *) ""; + wxWindow * _arg0; + wxWindowID _arg1; + wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition; + wxSize * _arg3 = (wxSize *) &wxPyDefaultSize; + long _arg4 = (long ) 0; + wxValidator * _arg5 = (wxValidator *) &wxPyDefaultValidator; + char * _arg6 = (char *) "control"; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; wxPoint temp; - PyObject * _obj3 = 0; + PyObject * _obj2 = 0; wxSize temp0; - PyObject * _obj4 = 0; - PyObject * _argo6 = 0; - char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; + PyObject * _obj3 = 0; + PyObject * _argo5 = 0; + char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlOs:wxControl_CreateControl",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlOs:new_wxControl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxControl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxControl_CreateControl. Expected _wxControl_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxControl_CreateControl. Expected _wxWindow_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxControl. Expected _wxWindow_p."); return NULL; } } - if (_obj3) + if (_obj2) { - _arg3 = &temp; - if (! wxPoint_helper(_obj3, &_arg3)) + _arg2 = &temp; + if (! wxPoint_helper(_obj2, &_arg2)) return NULL; } - if (_obj4) + if (_obj3) { - _arg4 = &temp0; - if (! wxSize_helper(_obj4, &_arg4)) + _arg3 = &temp0; + if (! wxSize_helper(_obj3, &_arg3)) return NULL; } - if (_argo6) { - if (_argo6 == Py_None) { _arg6 = NULL; } - else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxValidator_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 7 of wxControl_CreateControl. Expected _wxValidator_p."); + if (_argo5) { + if (_argo5 == Py_None) { _arg5 = NULL; } + else if (SWIG_GetPtrObj(_argo5,(void **) &_arg5,"_wxValidator_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 6 of new_wxControl. Expected _wxValidator_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxControl_CreateControl(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxControl *)new_wxControl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxControl_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } @@ -329,7 +302,7 @@ static PyObject *_wrap_wxControl_GetLabel(PyObject *self, PyObject *args, PyObje wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -505,6 +478,78 @@ static PyObject *_wrap_wxButton_SetDefault(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxButton_SetBackgroundColour(_swigobj,_swigarg0) (_swigobj->SetBackgroundColour(_swigarg0)) +static PyObject *_wrap_wxButton_SetBackgroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxButton * _arg0; + wxColour * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","colour", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetBackgroundColour",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxButton_SetBackgroundColour. Expected _wxButton_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxButton_SetBackgroundColour. Expected _wxColour_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxButton_SetBackgroundColour(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxButton_SetForegroundColour(_swigobj,_swigarg0) (_swigobj->SetForegroundColour(_swigarg0)) +static PyObject *_wrap_wxButton_SetForegroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxButton * _arg0; + wxColour * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","colour", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxButton_SetForegroundColour",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxButton_SetForegroundColour. Expected _wxButton_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxColour_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxButton_SetForegroundColour. Expected _wxColour_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxButton_SetForegroundColour(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxBitmapButtonTowxButton(void *ptr) { wxBitmapButton *src; wxButton *dest; @@ -1096,7 +1141,7 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; - char *_kwnames[] = { "parent","id","pos","size","LIST","style","validator","name", NULL }; + char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; @@ -1347,7 +1392,7 @@ static PyObject *_wrap_wxChoice_GetString(PyObject *self, PyObject *args, PyObje wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -1379,7 +1424,7 @@ static PyObject *_wrap_wxChoice_GetStringSelection(PyObject *self, PyObject *arg wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -1563,7 +1608,7 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; - char *_kwnames[] = { "parent","id","value","pos","size","LIST","style","validator","name", NULL }; + char *_kwnames[] = { "parent","id","value","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; @@ -1923,7 +1968,7 @@ static PyObject *_wrap_wxComboBox_GetString(PyObject *self, PyObject *args, PyOb wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -1955,7 +2000,7 @@ static PyObject *_wrap_wxComboBox_GetStringSelection(PyObject *self, PyObject *a wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -1987,7 +2032,7 @@ static PyObject *_wrap_wxComboBox_GetValue(PyObject *self, PyObject *args, PyObj wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -2868,7 +2913,7 @@ static PyObject *_wrap_wxStaticText_GetLabel(PyObject *self, PyObject *args, PyO wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -2960,7 +3005,7 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; - char *_kwnames[] = { "parent","id","pos","size","LIST","style","validator","name", NULL }; + char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; @@ -3261,7 +3306,7 @@ static PyObject *_wrap_wxListBox_InsertItems(PyObject *self, PyObject *args, PyO int _arg3; PyObject * _argo0 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","LIST","pos", NULL }; + char *_kwnames[] = { "self","choices","pos", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListBox_InsertItems",_kwnames,&_argo0,&_obj2,&_arg3)) @@ -3325,7 +3370,7 @@ static PyObject *_wrap_wxListBox_GetString(PyObject *self, PyObject *args, PyObj wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -3357,7 +3402,7 @@ static PyObject *_wrap_wxListBox_GetStringSelection(PyObject *self, PyObject *ar wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -3428,7 +3473,7 @@ static PyObject *_wrap_wxListBox_Set(PyObject *self, PyObject *args, PyObject *k wxString * _arg2; PyObject * _argo0 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","LIST", NULL }; + char *_kwnames[] = { "self","choices", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListBox_Set",_kwnames,&_argo0,&_obj2)) @@ -3703,7 +3748,7 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; - char *_kwnames[] = { "parent","id","pos","size","LIST","style","validator","name", NULL }; + char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; @@ -3834,7 +3879,7 @@ static PyObject *_wrap_wxCheckListBox_InsertItems(PyObject *self, PyObject *args int _arg3; PyObject * _argo0 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","LIST","pos", NULL }; + char *_kwnames[] = { "self","choices","pos", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxCheckListBox_InsertItems",_kwnames,&_argo0,&_obj2,&_arg3)) @@ -4204,7 +4249,7 @@ static PyObject *_wrap_wxTextCtrl_GetLineText(PyObject *self, PyObject *args, Py wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -4263,7 +4308,7 @@ static PyObject *_wrap_wxTextCtrl_GetValue(PyObject *self, PyObject *args, PyObj wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -5837,7 +5882,7 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo9 = 0; - char *_kwnames[] = { "parent","id","label","point","size","LIST","majorDimension","style","validator","name", NULL }; + char *_kwnames[] = { "parent","id","label","point","size","choices","majorDimension","style","validator","name", NULL }; char _ptemp[128]; self = self; @@ -6039,7 +6084,7 @@ static PyObject *_wrap_wxRadioBox_GetItemLabel(PyObject *self, PyObject *args, P wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -6099,7 +6144,7 @@ static PyObject *_wrap_wxRadioBox_GetString(PyObject *self, PyObject *args, PyOb wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -6131,7 +6176,7 @@ static PyObject *_wrap_wxRadioBox_GetStringSelection(PyObject *self, PyObject *a wxPy_END_ALLOW_THREADS; }{ - _resultobj = PyString_FromString(WXSTRINGCAST *(_result)); + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); } { delete _result; @@ -7159,6 +7204,7 @@ static PyMethodDef controlscMethods[] = { { "new_wxSpinButton", (PyCFunction) _wrap_new_wxSpinButton, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_SetScrollbar", (PyCFunction) _wrap_wxScrollBar_SetScrollbar, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_SetThumbPosition", (PyCFunction) _wrap_wxScrollBar_SetThumbPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxScrollBar_GetThumbLength", (PyCFunction) _wrap_wxScrollBar_GetThumbSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetThumbSize", (PyCFunction) _wrap_wxScrollBar_GetThumbSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetThumbPosition", (PyCFunction) _wrap_wxScrollBar_GetThumbPosition, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetPageSize", (PyCFunction) _wrap_wxScrollBar_GetPageSize, METH_VARARGS | METH_KEYWORDS }, @@ -7285,12 +7331,13 @@ static PyMethodDef controlscMethods[] = { { "wxBitmapButton_GetBitmapDisabled", (PyCFunction) _wrap_wxBitmapButton_GetBitmapDisabled, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapButton_GetBitmapLabel", (PyCFunction) _wrap_wxBitmapButton_GetBitmapLabel, METH_VARARGS | METH_KEYWORDS }, { "new_wxBitmapButton", (PyCFunction) _wrap_new_wxBitmapButton, METH_VARARGS | METH_KEYWORDS }, + { "wxButton_SetForegroundColour", (PyCFunction) _wrap_wxButton_SetForegroundColour, METH_VARARGS | METH_KEYWORDS }, + { "wxButton_SetBackgroundColour", (PyCFunction) _wrap_wxButton_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxButton_SetDefault", (PyCFunction) _wrap_wxButton_SetDefault, METH_VARARGS | METH_KEYWORDS }, { "new_wxButton", (PyCFunction) _wrap_new_wxButton, METH_VARARGS | METH_KEYWORDS }, { "wxControl_SetLabel", (PyCFunction) _wrap_wxControl_SetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxControl_GetLabel", (PyCFunction) _wrap_wxControl_GetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxControl_Command", (PyCFunction) _wrap_wxControl_Command, METH_VARARGS | METH_KEYWORDS }, - { "wxControl_CreateControl", (PyCFunction) _wrap_wxControl_CreateControl, METH_VARARGS | METH_KEYWORDS }, { "new_wxControl", (PyCFunction) _wrap_new_wxControl, METH_VARARGS | METH_KEYWORDS }, { "wxButton_GetDefaultSize", (PyCFunction) _wrap_wxButton_GetDefaultSize, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL }