From 907c2926f97456c7362f61637464b2cb5272b540 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 17 Apr 2004 02:04:56 +0000 Subject: [PATCH] default id's where possible git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_choice.i | 4 +-- wxPython/src/_combobox.i | 4 +-- wxPython/src/calendar.i | 2 +- wxPython/src/msw/calendar.py | 2 +- wxPython/src/msw/calendar_wrap.cpp | 10 +++++--- wxPython/src/msw/controls_wrap.cpp | 40 ++++++++++++++++++------------ 6 files changed, 36 insertions(+), 26 deletions(-) diff --git a/wxPython/src/_choice.i b/wxPython/src/_choice.i index d746c04245..a0472e1d96 100644 --- a/wxPython/src/_choice.i +++ b/wxPython/src/_choice.i @@ -40,7 +40,7 @@ public: RefDoc(wxChoice, ""); // turn it off for the ctors DocCtorAStr( - wxChoice(wxWindow *parent, wxWindowID id, + wxChoice(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices = wxPyEmptyStringArray, @@ -59,7 +59,7 @@ public: DocDeclAStr( - bool, Create(wxWindow *parent, wxWindowID id, + bool, Create(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices = wxPyEmptyStringArray, diff --git a/wxPython/src/_combobox.i b/wxPython/src/_combobox.i index b5522f3ecb..961a9554df 100644 --- a/wxPython/src/_combobox.i +++ b/wxPython/src/_combobox.i @@ -61,7 +61,7 @@ public: RefDoc(wxComboBox, ""); // turn it off for the ctors DocCtorAStr( - wxComboBox(wxWindow* parent, wxWindowID id, + wxComboBox(wxWindow* parent, wxWindowID id=-1, const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -82,7 +82,7 @@ public: DocDeclAStr( - bool, Create(wxWindow *parent, wxWindowID id, + bool, Create(wxWindow *parent, wxWindowID id=-1, const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index f81b86d766..2d21139061 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -203,7 +203,7 @@ public: RefDoc(wxCalendarCtrl, ""); // turn it off for the ctors wxCalendarCtrl(wxWindow *parent, - wxWindowID id, + wxWindowID id=-1, const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/wxPython/src/msw/calendar.py b/wxPython/src/msw/calendar.py index d9b21268e9..2d2b5fba05 100644 --- a/wxPython/src/msw/calendar.py +++ b/wxPython/src/msw/calendar.py @@ -169,7 +169,7 @@ class CalendarCtrl(core.Control): return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, int id, DateTime date=DefaultDateTime, + __init__(Window parent, int id=-1, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> CalendarCtrl diff --git a/wxPython/src/msw/calendar_wrap.cpp b/wxPython/src/msw/calendar_wrap.cpp index 28d260d46c..6b518e48dc 100644 --- a/wxPython/src/msw/calendar_wrap.cpp +++ b/wxPython/src/msw/calendar_wrap.cpp @@ -1182,7 +1182,7 @@ static PyObject *_wrap_CalendarNameStr_get() { static PyObject *_wrap_new_CalendarCtrl(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - int arg2 ; + int arg2 = (int) -1 ; wxDateTime const &arg3_defvalue = wxDefaultDateTime ; wxDateTime *arg3 = (wxDateTime *) &arg3_defvalue ; wxPoint const &arg4_defvalue = wxDefaultPosition ; @@ -1207,11 +1207,13 @@ static PyObject *_wrap_new_CalendarCtrl(PyObject *self, PyObject *args, PyObject (char *) "parent",(char *) "id",(char *) "date",(char *) "pos",(char *) "size",(char *) "style",(char *) "name", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOO:new_CalendarCtrl",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOOO:new_CalendarCtrl",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; + if (obj1) { + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + } if (obj2) { if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_wxDateTime, SWIG_POINTER_EXCEPTION | 0)) == -1) diff --git a/wxPython/src/msw/controls_wrap.cpp b/wxPython/src/msw/controls_wrap.cpp index 30fff0d5a9..5415b8639e 100644 --- a/wxPython/src/msw/controls_wrap.cpp +++ b/wxPython/src/msw/controls_wrap.cpp @@ -2382,7 +2382,7 @@ static PyObject *_wrap_ChoiceNameStr_get() { static PyObject *_wrap_new_Choice(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - int arg2 ; + int arg2 = (int) -1 ; wxPoint const &arg3_defvalue = wxDefaultPosition ; wxPoint *arg3 = (wxPoint *) &arg3_defvalue ; wxSize const &arg4_defvalue = wxDefaultSize ; @@ -2411,11 +2411,13 @@ static PyObject *_wrap_new_Choice(PyObject *self, PyObject *args, PyObject *kwar (char *) "parent",(char *) "id",(char *) "pos",(char *) "size",(char *) "choices",(char *) "style",(char *) "validator",(char *) "name", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOOO:new_Choice",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOOOO:new_Choice",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; + if (obj1) { + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + } if (obj2) { { arg3 = &temp3; @@ -2525,7 +2527,7 @@ static PyObject *_wrap_Choice_Create(PyObject *self, PyObject *args, PyObject *k PyObject *resultobj; wxChoice *arg1 = (wxChoice *) 0 ; wxWindow *arg2 = (wxWindow *) 0 ; - int arg3 ; + int arg3 = (int) -1 ; wxPoint const &arg4_defvalue = wxDefaultPosition ; wxPoint *arg4 = (wxPoint *) &arg4_defvalue ; wxSize const &arg5_defvalue = wxDefaultSize ; @@ -2555,13 +2557,15 @@ static PyObject *_wrap_Choice_Create(PyObject *self, PyObject *args, PyObject *k (char *) "self",(char *) "parent",(char *) "id",(char *) "pos",(char *) "size",(char *) "choices",(char *) "style",(char *) "validator",(char *) "name", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOOOOO:Choice_Create",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOOOO:Choice_Create",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxChoice, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg3 = (int) SWIG_AsInt(obj2); - if (PyErr_Occurred()) SWIG_fail; + if (obj2) { + arg3 = (int) SWIG_AsInt(obj2); + if (PyErr_Occurred()) SWIG_fail; + } if (obj3) { { arg4 = &temp4; @@ -2792,7 +2796,7 @@ static PyObject *_wrap_ComboBoxNameStr_get() { static PyObject *_wrap_new_ComboBox(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - int arg2 ; + int arg2 = (int) -1 ; wxString const &arg3_defvalue = wxPyEmptyString ; wxString *arg3 = (wxString *) &arg3_defvalue ; wxPoint const &arg4_defvalue = wxDefaultPosition ; @@ -2825,11 +2829,13 @@ static PyObject *_wrap_new_ComboBox(PyObject *self, PyObject *args, PyObject *kw (char *) "parent",(char *) "id",(char *) "value",(char *) "pos",(char *) "size",(char *) "choices",(char *) "style",(char *) "validator",(char *) "name", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOOOO:new_ComboBox",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOOOOO:new_ComboBox",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (int) SWIG_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; + if (obj1) { + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + } if (obj2) { { arg3 = wxString_in_helper(obj2); @@ -2954,7 +2960,7 @@ static PyObject *_wrap_ComboBox_Create(PyObject *self, PyObject *args, PyObject PyObject *resultobj; wxComboBox *arg1 = (wxComboBox *) 0 ; wxWindow *arg2 = (wxWindow *) 0 ; - int arg3 ; + int arg3 = (int) -1 ; wxString const &arg4_defvalue = wxPyEmptyString ; wxString *arg4 = (wxString *) &arg4_defvalue ; wxPoint const &arg5_defvalue = wxDefaultPosition ; @@ -2988,13 +2994,15 @@ static PyObject *_wrap_ComboBox_Create(PyObject *self, PyObject *args, PyObject (char *) "self",(char *) "parent",(char *) "id",(char *) "value",(char *) "pos",(char *) "size",(char *) "choices",(char *) "style",(char *) "validator",(char *) "name", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOOOOOO:ComboBox_Create",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOOOOO:ComboBox_Create",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_wxWindow, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg3 = (int) SWIG_AsInt(obj2); - if (PyErr_Occurred()) SWIG_fail; + if (obj2) { + arg3 = (int) SWIG_AsInt(obj2); + if (PyErr_Occurred()) SWIG_fail; + } if (obj3) { { arg4 = wxString_in_helper(obj3); -- 2.45.2