From 137b5242b1834999da2883c7a68fbde28c6fba37 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 21 Mar 2002 05:50:09 +0000 Subject: [PATCH] More unicode related cleanup and fixes for wxPython git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 2 +- contrib/src/stc/stc.h.in | 2 +- include/wx/stc/stc.h | 2 +- src/stc/stc.h.in | 2 +- wxPython/.cvsignore | 1 + wxPython/CHANGES.txt | 25 +- wxPython/contrib/dllwidget/dllwidget_.cpp | 9 +- wxPython/contrib/dllwidget/dllwidget_.i | 13 +- wxPython/contrib/gizmos/gizmos.cpp | 55 +- wxPython/contrib/gizmos/gizmos.i | 14 +- wxPython/contrib/glcanvas/glcanvas.i | 12 +- wxPython/contrib/glcanvas/msw/glcanvas.cpp | 38 +- wxPython/contrib/ogl/oglshapes2.cpp | 37 +- wxPython/contrib/ogl/oglshapes2.i | 11 +- wxPython/contrib/stc/msw/stc_.cpp | 20 +- wxPython/contrib/stc/stc_.i | 6 + wxPython/demo/wxDirDialog.py | 2 +- wxPython/src/_defs.i | 1 - wxPython/src/calendar.i | 9 +- wxPython/src/clip_dnd.i | 13 +- wxPython/src/cmndlgs.i | 36 +- wxPython/src/controls.i | 150 ++-- wxPython/src/controls2.i | 44 +- wxPython/src/frames.i | 30 +- wxPython/src/gdi.i | 23 +- wxPython/src/grid.i | 9 +- wxPython/src/helpers.h | 3 +- wxPython/src/html.i | 42 +- wxPython/src/htmlhelp.i | 50 +- wxPython/src/mdi.i | 15 +- wxPython/src/misc.i | 11 +- wxPython/src/misc2.i | 86 ++- wxPython/src/msw/calendar.cpp | 37 +- wxPython/src/msw/clip_dnd.cpp | 25 +- wxPython/src/msw/cmndlgs.cpp | 184 ++++- wxPython/src/msw/controls.cpp | 819 +++++++++++++++++---- wxPython/src/msw/controls2.cpp | 176 ++++- wxPython/src/msw/frames.cpp | 176 ++++- wxPython/src/msw/gdi.cpp | 62 +- wxPython/src/msw/grid.cpp | 20 +- wxPython/src/msw/html.cpp | 126 +++- wxPython/src/msw/htmlhelp.cpp | 107 +-- wxPython/src/msw/htmlhelp.py | 45 +- wxPython/src/msw/mdi.cpp | 71 +- wxPython/src/msw/misc.cpp | 26 +- wxPython/src/msw/misc2.cpp | 223 +++++- wxPython/src/msw/printfw.cpp | 56 +- wxPython/src/msw/stattool.cpp | 123 +++- wxPython/src/msw/utils.cpp | 216 ++++-- wxPython/src/msw/windows.cpp | 136 +++- wxPython/src/msw/windows2.cpp | 92 ++- wxPython/src/msw/windows3.cpp | 74 +- wxPython/src/msw/wx.cpp | 1 - wxPython/src/msw/wx.py | 1 - wxPython/src/printfw.i | 16 +- wxPython/src/stattool.i | 41 +- wxPython/src/utils.i | 52 +- wxPython/src/windows.i | 50 +- wxPython/src/windows2.i | 21 +- wxPython/src/windows3.i | 17 +- 60 files changed, 2920 insertions(+), 846 deletions(-) diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index 10b857dd18..1149ea620d 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -817,7 +817,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "styledtext"); + const wxString& name = wxPySTCNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" #else diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in index 1f2a2ac2d2..2a1d1314a5 100644 --- a/contrib/src/stc/stc.h.in +++ b/contrib/src/stc/stc.h.in @@ -50,7 +50,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "styledtext"); + const wxString& name = wxPySTCNameStr); %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)" #else diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 10b857dd18..1149ea620d 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -817,7 +817,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "styledtext"); + const wxString& name = wxPySTCNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" #else diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 1f2a2ac2d2..2a1d1314a5 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -50,7 +50,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "styledtext"); + const wxString& name = wxPySTCNameStr); %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)" #else diff --git a/wxPython/.cvsignore b/wxPython/.cvsignore index d5373151f7..ee1535efbf 100644 --- a/wxPython/.cvsignore +++ b/wxPython/.cvsignore @@ -2,6 +2,7 @@ MANIFEST build build.local +build.unicode dist licence s.bat diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 25e3b74c9e..5183ee0e53 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -34,8 +34,29 @@ Added wxBufferedDC. Upgraded wxSTC from Scintilla 1.40 to Scintilla 1.45 -UNICODE! - +***---***---***---***---***---***---***---***---***---***---***--- + UNICODE! + + wxWindows and wxPython can be compiled with unicode support + enabled or disabled. Previous to wxPython 2.3.3 non-unicode mode + was always used. Starting with 2.3.3 either mode is supported, + but only if it is also available in wxWindow on the platform. + Currently wxWindows only supports unicode on MS Windows platforms, + but with the recent release of GTK+ 2.0 it is only a matter of + time until it can be done on wxGTK (Linux and other unixes) as + well. + + When unicode is enabled, then all functions and methods in + wxPython that return a wxString from the C++ function will return + a Python unicode object, and parameters to C++ functions/methods + that expect a wxString can accept either a Python string or + unicode object. If a string object is passed then it will be + decoded into unicode using the converter pointed to by + wxConvCurrent, which will use the default system encoding. If you + need to use a string in some other encoding then you should + convert it to unicode using the Python codecs first and then pass + the unicode to the wxPython method. +***---***---***---***---***---***---***---***---***---***---***--- diff --git a/wxPython/contrib/dllwidget/dllwidget_.cpp b/wxPython/contrib/dllwidget/dllwidget_.cpp index 8d53ec8215..a9da25d14b 100644 --- a/wxPython/contrib/dllwidget/dllwidget_.cpp +++ b/wxPython/contrib/dllwidget/dllwidget_.cpp @@ -84,6 +84,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); #ifdef __cplusplus extern "C" { #endif @@ -125,8 +128,8 @@ static PyObject *_wrap_new_wxDllWidget(PyObject *self, PyObject *args, PyObject wxDllWidget * _result; wxWindow * _arg0; wxWindowID _arg1 = (wxWindowID ) -1; - wxString * _arg2 = (wxString *) &wxEmptyString; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; @@ -232,7 +235,7 @@ static PyObject *_wrap_wxDllWidget_SendCommand(PyObject *self, PyObject *args, P int _result; wxDllWidget * _arg0; int _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; char *_kwnames[] = { "self","cmd","param", NULL }; diff --git a/wxPython/contrib/dllwidget/dllwidget_.i b/wxPython/contrib/dllwidget/dllwidget_.i index 52f4622f6e..e2e486942c 100644 --- a/wxPython/contrib/dllwidget/dllwidget_.i +++ b/wxPython/contrib/dllwidget/dllwidget_.i @@ -27,6 +27,13 @@ %extern windows.i %extern _defs.i +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- /* @@ -82,8 +89,8 @@ class wxDllWidget : public wxPanel public: wxDllWidget(wxWindow *parent, wxWindowID id = -1, - const wxString& dllName = wxEmptyString, - const wxString& className = wxEmptyString, + const wxString& dllName = wxPyEmptyString, + const wxString& className = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); @@ -92,7 +99,7 @@ public: bool Ok(); - int SendCommand(int cmd, const wxString& param = wxEmptyString); + int SendCommand(int cmd, const wxString& param = wxPyEmptyString); wxWindow* GetWidgetWindow(); static wxString GetDllExt(); diff --git a/wxPython/contrib/gizmos/gizmos.cpp b/wxPython/contrib/gizmos/gizmos.cpp index 41fc000205..ed145eed3b 100644 --- a/wxPython/contrib/gizmos/gizmos.cpp +++ b/wxPython/contrib/gizmos/gizmos.cpp @@ -88,6 +88,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyDynamicSashNameStr(wxT("dynamicSashWindow")); + static const wxString wxPyEditableListBoxNameStr(wxT("editableListBox")); + typedef wxTreeCtrl wxPyTreeCtrl; class wxPyTreeCompanionWindow: public wxTreeCompanionWindow @@ -273,17 +277,18 @@ static PyObject *_wrap_new_wxDynamicSashWindow(PyObject *self, PyObject *args, P wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxCLIP_CHILDREN|(wxDS_MANAGE_SCROLLBARS)|(wxDS_DRAG_CORNER); - char * _arg5 = (char *) "dynamicSashWindow"; + wxString * _arg5 = (wxString *) &wxPyDynamicSashNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxDynamicSashWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxDynamicSashWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -303,10 +308,16 @@ static PyObject *_wrap_new_wxDynamicSashWindow(PyObject *self, PyObject *args, P _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxDynamicSashWindow *)new_wxDynamicSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxDynamicSashWindow *)new_wxDynamicSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -317,6 +328,10 @@ static PyObject *_wrap_new_wxDynamicSashWindow(PyObject *self, PyObject *args, P Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -356,17 +371,18 @@ static PyObject *_wrap_wxDynamicSashWindow_Create(PyObject *self, PyObject *args wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxCLIP_CHILDREN|(wxDS_MANAGE_SCROLLBARS)|(wxDS_DRAG_CORNER); - char * _arg6 = (char *) "dynamicSashWindow"; + wxString * _arg6 = (wxString *) &wxPyDynamicSashNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxDynamicSashWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxDynamicSashWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -393,14 +409,24 @@ static PyObject *_wrap_wxDynamicSashWindow_Create(PyObject *self, PyObject *args _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxDynamicSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxDynamicSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -534,18 +560,19 @@ static PyObject *_wrap_new_wxEditableListBox(PyObject *self, PyObject *args, PyO wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxEL_ALLOW_NEW)|(wxEL_ALLOW_EDIT)|(wxEL_ALLOW_DELETE); - char * _arg6 = (char *) "editableListBox"; + wxString * _arg6 = (wxString *) &wxPyEditableListBoxNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxEditableListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxEditableListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -570,10 +597,16 @@ static PyObject *_wrap_new_wxEditableListBox(PyObject *self, PyObject *args, PyO _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxEditableListBox *)new_wxEditableListBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxEditableListBox *)new_wxEditableListBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -587,6 +620,10 @@ static PyObject *_wrap_new_wxEditableListBox(PyObject *self, PyObject *args, PyO { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 25aa3ec04d..239a195b03 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -35,6 +35,14 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyDynamicSashNameStr(wxT("dynamicSashWindow")); + static const wxString wxPyEditableListBoxNameStr(wxT("editableListBox")); +%} + +///---------------------------------------------------------------------- + enum { wxEVT_DYNAMIC_SASH_SPLIT, wxEVT_DYNAMIC_SASH_UNIFY, @@ -124,13 +132,13 @@ public: wxDynamicSashWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const char* name = "dynamicSashWindow"); + const wxString& name = wxPyDynamicSashNameStr); %name(wxPreDynamicSashWindow)wxDynamicSashWindow(); bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const char* name = "dynamicSashWindow"); + const wxString& name = wxPyDynamicSashNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreDynamicSashWindow:val._setOORInfo(val)" @@ -171,7 +179,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE, - const char* name = "editableListBox"); + const wxString& name = wxPyEditableListBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index bb5620d857..b51b3fb5f1 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -42,6 +42,14 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas")); + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- class wxPalette; @@ -121,7 +129,7 @@ public: wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "GLCanvas", + const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, const wxPalette& palette = wxNullPalette); @@ -132,7 +140,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "GLCanvas", + const wxString& name = wxPyGLCanvasNameStr, int *attribList = NULL, const wxPalette& palette = wxNullPalette ); diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index 8073f3000e..c103574fff 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -89,6 +89,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyGLCanvasNameStr(wxT("GLCanvas")); + static const wxString wxPyEmptyString(wxT("")); #ifdef __cplusplus extern "C" { #endif @@ -321,7 +325,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5 = (char *) "GLCanvas"; + wxString * _arg5 = (wxString *) &wxPyGLCanvasNameStr; int * _arg6 = (int *) NULL; wxPalette * _arg7 = (wxPalette *) &wxNullPalette; PyObject * _argo0 = 0; @@ -329,6 +333,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; int * temp1; PyObject * _obj6 = 0; PyObject * _argo7 = 0; @@ -336,7 +341,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlsOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5,&_obj6,&_argo7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOOO:new_wxGLCanvas",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5,&_obj6,&_argo7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -356,6 +361,12 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } if (_obj6) { @@ -379,7 +390,7 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7); + _result = (wxGLCanvas *)new_wxGLCanvas(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -390,6 +401,10 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} { delete [] _arg6; } @@ -406,7 +421,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "GLCanvas"; + wxString * _arg6 = (wxString *) &wxPyGLCanvasNameStr; int * _arg7 = (int *) NULL; wxPalette * _arg8 = (wxPalette *) &wxNullPalette; PyObject * _argo0 = 0; @@ -415,6 +430,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; int * temp1; PyObject * _obj7 = 0; PyObject * _argo8 = 0; @@ -422,7 +438,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlsOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_obj7,&_argo8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OiOOlOOO:new_wxGLCanvasWithContext",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6,&_obj7,&_argo8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -449,6 +465,12 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } if (_obj7) { @@ -472,7 +494,7 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8); + _result = (wxGLCanvas *)new_wxGLCanvasWithContext(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -483,6 +505,10 @@ static PyObject *_wrap_new_wxGLCanvasWithContext(PyObject *self, PyObject *args, Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} { delete [] _arg7; } diff --git a/wxPython/contrib/ogl/oglshapes2.cpp b/wxPython/contrib/ogl/oglshapes2.cpp index 28e6c17042..96560588ac 100644 --- a/wxPython/contrib/ogl/oglshapes2.cpp +++ b/wxPython/contrib/ogl/oglshapes2.cpp @@ -85,6 +85,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape); WXSHAPE_IMP_CALLBACKS(wxPyCircleShape, wxCircleShape); @@ -2330,16 +2333,23 @@ static PyObject *_wrap_new_wxArrowHead(PyObject *self, PyObject *args, PyObject int _arg1 = (int ) 0; double _arg2 = (double ) 0.0; double _arg3 = (double ) 0.0; - char * _arg4 = (char *) ""; + wxString * _arg4 = (wxString *) &wxPyEmptyString; wxPseudoMetaFile * _arg5 = (wxPseudoMetaFile *) NULL; long _arg6 = (long ) -1; + PyObject * _obj4 = 0; PyObject * _argo5 = 0; char *_kwnames[] = { "type","end","size","dist","name","mf","arrowId", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|iiddsOl:new_wxArrowHead",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|iiddOOl:new_wxArrowHead",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_obj4,&_argo5,&_arg6)) + return NULL; + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) return NULL; +} if (_argo5) { if (_argo5 == Py_None) { _arg5 = NULL; } else if (SWIG_GetPtrObj(_argo5,(void **) &_arg5,"_wxPseudoMetaFile_p")) { @@ -2349,7 +2359,7 @@ static PyObject *_wrap_new_wxArrowHead(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxArrowHead *)new_wxArrowHead(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + _result = (wxArrowHead *)new_wxArrowHead(_arg0,_arg1,_arg2,_arg3,*_arg4,_arg5,_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2360,6 +2370,10 @@ static PyObject *_wrap_new_wxArrowHead(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj4) + delete _arg4; +} return _resultobj; } @@ -2949,15 +2963,16 @@ static PyObject *_wrap_wxPyLineShape_AddArrow(PyObject *self, PyObject *args, Py int _arg2 = (int ) ARROW_POSITION_END; double _arg3 = (double ) 10.0; double _arg4 = (double ) 0.0; - char * _arg5 = (char *) ""; + wxString * _arg5 = (wxString *) &wxPyEmptyString; wxPseudoMetaFile * _arg6 = (wxPseudoMetaFile *) NULL; long _arg7 = (long ) -1; PyObject * _argo0 = 0; + PyObject * _obj5 = 0; PyObject * _argo6 = 0; char *_kwnames[] = { "self","type","end","arrowSize","xOffset","name","mf","arrowId", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|iddsOl:wxPyLineShape_AddArrow",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|iddOOl:wxPyLineShape_AddArrow",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_obj5,&_argo6,&_arg7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2966,6 +2981,12 @@ static PyObject *_wrap_wxPyLineShape_AddArrow(PyObject *self, PyObject *args, Py return NULL; } } + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; +} if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxPseudoMetaFile_p")) { @@ -2975,12 +2996,16 @@ static PyObject *_wrap_wxPyLineShape_AddArrow(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxPyLineShape_AddArrow(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7); + wxPyLineShape_AddArrow(_arg0,_arg1,_arg2,_arg3,_arg4,*_arg5,_arg6,_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj5) + delete _arg5; +} return _resultobj; } diff --git a/wxPython/contrib/ogl/oglshapes2.i b/wxPython/contrib/ogl/oglshapes2.i index 89d4ee8f06..f4e28ee29f 100644 --- a/wxPython/contrib/ogl/oglshapes2.i +++ b/wxPython/contrib/ogl/oglshapes2.i @@ -38,7 +38,14 @@ %pragma(python) code = "import wx" //--------------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- + %{ WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape); %} @@ -133,7 +140,7 @@ public: int end = 0, double size = 0.0, double dist = 0.0, - const char * name = "", + const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL, long arrowId = -1); ~wxArrowHead(); @@ -170,7 +177,7 @@ public: void AddArrow(int type, int end = ARROW_POSITION_END, double arrowSize = 10.0, double xOffset = 0.0, - char* name = "", wxPseudoMetaFile *mf = NULL, + const wxString& name = wxPyEmptyString, wxPseudoMetaFile *mf = NULL, long arrowId = -1); //void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int end); diff --git a/wxPython/contrib/stc/msw/stc_.cpp b/wxPython/contrib/stc/msw/stc_.cpp index 04085efc97..87c57954e8 100644 --- a/wxPython/contrib/stc/msw/stc_.cpp +++ b/wxPython/contrib/stc/msw/stc_.cpp @@ -84,6 +84,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(STCNameStr); #ifdef __cplusplus extern "C" { #endif @@ -128,17 +131,18 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5 = (char *) "styledtext"; + wxString * _arg5 = (wxString *) &wxPySTCNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -158,10 +162,16 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStyledTextCtrl *)new_wxStyledTextCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxStyledTextCtrl *)new_wxStyledTextCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -172,6 +182,10 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } diff --git a/wxPython/contrib/stc/stc_.i b/wxPython/contrib/stc/stc_.i index fa4936e84c..c92d6ebce1 100644 --- a/wxPython/contrib/stc/stc_.i +++ b/wxPython/contrib/stc/stc_.i @@ -30,6 +30,12 @@ %extern controls.i +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(STCNameStr); +%} //---------------------------------------------------------------------- // Get all our defs from the REAL header file. diff --git a/wxPython/demo/wxDirDialog.py b/wxPython/demo/wxDirDialog.py index 1e40bf2bb1..bbed89b9d8 100644 --- a/wxPython/demo/wxDirDialog.py +++ b/wxPython/demo/wxDirDialog.py @@ -4,7 +4,7 @@ from wxPython.wx import * #--------------------------------------------------------------------------- def runTest(frame, nb, log): - dlg = wxDirDialog(frame) + dlg = wxDirDialog(frame, "Choose a directory:") if dlg.ShowModal() == wxID_OK: log.WriteText('You selected: %s\n' % dlg.GetPath()) dlg.Destroy() diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index e06f24ee11..6e6a1112c2 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -894,7 +894,6 @@ enum wxHitTest #define TRUE 1 #define true 1 -const char* wxVERSION_STRING; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index 0acbdd652d..6c5b1a4be6 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -151,6 +151,11 @@ def EVT_CALENDAR_WEEKDAY_CLICKED(win, id, fn): //--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(CalendarNameStr); +%} + class wxCalendarCtrl : public wxControl { public: @@ -161,7 +166,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, - const char* name = "calendar"); + const wxString& name = wxPyCalendarNameStr); %name(wxPreCalendarCtrl)wxCalendarCtrl(); bool Create(wxWindow *parent, @@ -170,7 +175,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, - const char* name = "calendar"); + const wxString& name = wxPyCalendarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreCalendarCtrl:val._setOORInfo(val)" diff --git a/wxPython/src/clip_dnd.i b/wxPython/src/clip_dnd.i index ea59320ca1..184f42f0a6 100644 --- a/wxPython/src/clip_dnd.i +++ b/wxPython/src/clip_dnd.i @@ -35,6 +35,11 @@ %pragma(python) code = "import wx" +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //---------------------------------------------------------------------- @@ -72,7 +77,7 @@ public: wxDataFormatId GetType() const; wxString GetId() const; - void SetId(const wxChar *format); + void SetId(const wxString& format); }; %new wxDataFormat* wxCustomDataFormat(const wxString &id); @@ -205,7 +210,7 @@ public: class wxTextDataObject : public wxDataObjectSimple { public: - wxTextDataObject(const wxString& text = wxEmptyString); + wxTextDataObject(const wxString& text = wxPyEmptyString); size_t GetTextLength(); wxString GetText(); @@ -217,7 +222,7 @@ public: %{ // Create a new class for wxPython to use class wxPyTextDataObject : public wxTextDataObject { public: - wxPyTextDataObject(const wxString& text = wxEmptyString) + wxPyTextDataObject(const wxString& text = wxPyEmptyString) : wxTextDataObject(text) {} DEC_PYCALLBACK_SIZET_(GetTextLength); @@ -236,7 +241,7 @@ IMP_PYCALLBACK__STRING(wxPyTextDataObject, wxTextDataObject, SetText); // Now define it for SWIG class wxPyTextDataObject : public wxTextDataObject { public: - wxPyTextDataObject(const wxString& text = wxEmptyString); + wxPyTextDataObject(const wxString& text = wxPyEmptyString); void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyTextDataObject)" }; diff --git a/wxPython/src/cmndlgs.i b/wxPython/src/cmndlgs.i index 8cef7b42bc..5ab14a8693 100644 --- a/wxPython/src/cmndlgs.i +++ b/wxPython/src/cmndlgs.i @@ -38,6 +38,18 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FileSelectorPromptStr); + DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); + DECLARE_DEF_STRING(GetTextFromUserPromptStr); + DECLARE_DEF_STRING(MessageBoxCaptionStr); + static const wxString wxPyEmptyString(wxT("")); + +%} + +//---------------------------------------------------------------------- + class wxColourData : public wxObject { public: wxColourData(); @@ -68,8 +80,8 @@ public: class wxDirDialog : public wxDialog { public: wxDirDialog(wxWindow* parent, - char* message = "Choose a directory", - char* defaultPath = "", + const wxString& message = wxPyFileSelectorPromptStr, + const wxString& defaultPath = wxPyEmptyString, long style = 0, const wxPoint& pos = wxDefaultPosition); @@ -89,10 +101,10 @@ public: class wxFileDialog : public wxDialog { public: wxFileDialog(wxWindow* parent, - char* message = "Choose a file", - char* defaultDir = "", - char* defaultFile = "", - char* wildcard = "*.*", + const wxString& message = wxPyFileSelectorPromptStr, + const wxString& defaultDir = wxPyEmptyString, + const wxString& defaultFile = wxPyEmptyString, + const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, long style = 0, const wxPoint& pos = wxDefaultPosition); @@ -190,9 +202,9 @@ public: class wxTextEntryDialog : public wxDialog { public: wxTextEntryDialog(wxWindow* parent, - char* message, - char* caption = "Input Text", - char* defaultValue = "", + const wxString& message, + const wxString& caption = wxPyGetTextFromUserPromptStr, + const wxString& defaultValue = wxPyEmptyString, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition); @@ -241,8 +253,8 @@ public: class wxMessageDialog : public wxDialog { public: wxMessageDialog(wxWindow* parent, - char* message, - char* caption = "Message box", + const wxString& message, + const wxString& caption = wxPyMessageBoxCaptionStr, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" @@ -261,7 +273,7 @@ public: int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - bool Update(int value = -1, const char* newmsg = NULL); + bool Update(int value, const wxString& newmsg = wxPyEmptyString); void Resume(); } diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index c18c03d843..bb8a78bfff 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -54,6 +54,34 @@ wxValidator wxDefaultValidator; //---------------------------------------------------------------------- +%{ +//#define DECLARE_DEF_STRING(name) static wxString* wxPy##name + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(ControlNameStr); + DECLARE_DEF_STRING(ButtonNameStr); + DECLARE_DEF_STRING(CheckBoxNameStr); + DECLARE_DEF_STRING(ChoiceNameStr); + DECLARE_DEF_STRING(ComboBoxNameStr); + DECLARE_DEF_STRING(GaugeNameStr); + DECLARE_DEF_STRING(StaticBoxNameStr); + DECLARE_DEF_STRING(StaticTextNameStr); + DECLARE_DEF_STRING(ListBoxNameStr); + DECLARE_DEF_STRING(TextCtrlNameStr); + DECLARE_DEF_STRING(ScrollBarNameStr); + DECLARE_DEF_STRING(SPIN_BUTTON_NAME); + DECLARE_DEF_STRING(StaticBitmapNameStr); + DECLARE_DEF_STRING(RadioBoxNameStr); + DECLARE_DEF_STRING(RadioButtonNameStr); + DECLARE_DEF_STRING(SliderNameStr); + + wxChar* wxSpinCtrlNameStr = _T("wxSpinCtrl"); + DECLARE_DEF_STRING(SpinCtrlNameStr); + + static const wxString wxPyEmptyString(wxT("")); +%} + +//---------------------------------------------------------------------- // This is the base class for a control or 'widget'. // @@ -69,7 +97,7 @@ public: const wxSize& size=wxDefaultSize, long style=0, const wxValidator& validator=wxDefaultValidator, - const char* name="control"); + const wxString& name=wxPyControlNameStr); // %name(wxPreControl)wxControl(); @@ -81,7 +109,7 @@ public: const wxSize& size=wxDefaultSize, long style=0, const wxValidator& validator=wxDefaultValidator, - const char* name="control"); + const wxString& name=wxPyControlNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreControl:val._setOORInfo(val)" @@ -209,7 +237,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "button"); + const wxString& name = wxPyButtonNameStr); // Default constructor %name(wxPreButton)wxButton(); @@ -220,7 +248,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "button"); + const wxString& name = wxPyButtonNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreButton:val._setOORInfo(val)" @@ -260,7 +288,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, const wxValidator& validator = wxDefaultValidator, - char* name = "button"); + const wxString& name = wxPyButtonNameStr); %name(wxPreBitmapButton)wxBitmapButton(); bool Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap, @@ -268,7 +296,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, const wxValidator& validator = wxDefaultValidator, - char* name = "button"); + const wxString& name = wxPyButtonNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)" @@ -296,7 +324,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& val = wxDefaultValidator, - char* name = "checkBox"); + const wxString& name = wxPyCheckBoxNameStr); %name(wxPreCheckBox)wxCheckBox(); bool Create(wxWindow* parent, wxWindowID id, const wxString& label, @@ -304,7 +332,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& val = wxDefaultValidator, - char* name = "checkBox"); + const wxString& name = wxPyCheckBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)" @@ -323,7 +351,7 @@ public: int LCOUNT=0, wxString* choices=NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "choice"); + const wxString& name = wxPyChoiceNameStr); %name(wxPreChoice)wxChoice(); bool Create(wxWindow *parent, wxWindowID id, @@ -332,7 +360,7 @@ public: int LCOUNT=0, wxString* choices=NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "choice"); + const wxString& name = wxPyChoiceNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreChoice:val._setOORInfo(val)" @@ -360,22 +388,24 @@ public: class wxComboBox : public wxControl { public: - wxComboBox(wxWindow* parent, wxWindowID id, char* value = "", + wxComboBox(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int LCOUNT=0, wxString* choices=NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "comboBox"); + const wxString& name = wxPyComboBoxNameStr); %name(wxPreComboBox)wxComboBox(); - bool Create(wxWindow* parent, wxWindowID id, char* value = "", - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - int LCOUNT=0, wxString* choices=NULL, - long style = 0, - const wxValidator& validator = wxDefaultValidator, - char* name = "comboBox"); + bool Create(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + int LCOUNT=0, wxString* choices=NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxPyComboBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)" @@ -451,22 +481,24 @@ public: class wxComboBox : public wxChoice { public: - wxComboBox(wxWindow* parent, wxWindowID id, char* value = "", + wxComboBox(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int LCOUNT=0, wxString* choices=NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "comboBox"); + const wxString& name = wxPyComboBoxNameStr); %name(wxPreComboBox)wxComboBox(); - bool Create(wxWindow* parent, wxWindowID id, char* value = "", + bool Create(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int LCOUNT=0, wxString* choices=NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "comboBox"); + const wxString& name = wxPyComboBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)" @@ -498,7 +530,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "gauge"); + const wxString& name = wxPyGaugeNameStr); %name(wxPreGauge)wxGauge(); bool Create(wxWindow* parent, wxWindowID id, int range, @@ -506,7 +538,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "gauge"); + const wxString& name = wxPyGaugeNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreGauge:val._setOORInfo(val)" @@ -529,14 +561,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticBox"); + const wxString& name = wxPyStaticBoxNameStr); %name(wxPreStaticBox)wxStaticBox(); bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticBox"); + const wxString& name = wxPyStaticBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreStaticBox:val._setOORInfo(val)" @@ -552,14 +584,14 @@ public: const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxLI_HORIZONTAL, - const char* name = "staticLine" ); + const wxString& name = wxPyStaticTextNameStr); %name(wxPreStaticLine)wxStaticLine(); bool Create( wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxLI_HORIZONTAL, - const char* name = "staticLine" ); + const wxString& name = wxPyStaticTextNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreStaticLine:val._setOORInfo(val)" @@ -574,14 +606,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticText"); + const wxString& name = wxPyStaticTextNameStr); %name(wxPreStaticText)wxStaticText(); bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticText"); + const wxString& name = wxPyStaticTextNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreStaticText:val._setOORInfo(val)" @@ -600,7 +632,7 @@ public: int LCOUNT, wxString* choices = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "listBox"); + const wxString& name = wxPyListBoxNameStr); %name(wxPreListBox)wxListBox(); bool Create(wxWindow* parent, wxWindowID id, @@ -609,7 +641,7 @@ public: int LCOUNT, wxString* choices = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "listBox"); + const wxString& name = wxPyListBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreListBox:val._setOORInfo(val)" @@ -655,7 +687,7 @@ public: wxString* choices = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "listBox"); + const wxString& name = wxPyListBoxNameStr); %name(wxPreCheckListBox)wxCheckListBox(); bool Create(wxWindow *parent, wxWindowID id, @@ -665,7 +697,7 @@ public: wxString* choices = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "listBox"); + const wxString& name = wxPyListBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreCheckListBox:val._setOORInfo(val)" @@ -720,20 +752,22 @@ public: class wxTextCtrl : public wxControl { public: - wxTextCtrl(wxWindow* parent, wxWindowID id, char* value = "", + wxTextCtrl(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "text"); + const wxString& name = wxPyTextCtrlNameStr); %name(wxPreTextCtrl)wxTextCtrl(); - bool Create(wxWindow* parent, wxWindowID id, char* value = "", + bool Create(wxWindow* parent, wxWindowID id, + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "text"); + const wxString& name = wxPyTextCtrlNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreTextCtrl:val._setOORInfo(val)" @@ -761,7 +795,7 @@ public: // load/save the controls contents from/to the file bool LoadFile(const wxString& file); - bool SaveFile(const wxString& file = wxEmptyString); + bool SaveFile(const wxString& file = wxPyEmptyString); // clears the dirty flag void DiscardEdits(); @@ -842,7 +876,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "scrollBar"); + const wxString& name = wxPyScrollBarNameStr); %name(wxPreScrollBar)wxScrollBar(); bool Create(wxWindow* parent, wxWindowID id = -1, @@ -850,7 +884,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSB_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "scrollBar"); + const wxString& name = wxPyScrollBarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreScrollBar:val._setOORInfo(val)" @@ -877,14 +911,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_HORIZONTAL, - char* name = "spinButton"); + const wxString& name = wxPySPIN_BUTTON_NAME); %name(wxPreSpinButton)wxSpinButton(); bool Create(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_HORIZONTAL, - char* name = "spinButton"); + const wxString& name = wxPySPIN_BUTTON_NAME); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSpinButton:val._setOORInfo(val)" @@ -905,7 +939,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticBitmap"); + const wxString& name = wxPyStaticBitmapNameStr); %name(wxPreStaticBitmap)wxStaticBitmap(); bool Create(wxWindow* parent, wxWindowID id, @@ -913,7 +947,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "staticBitmap"); + const wxString& name = wxPyStaticBitmapNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)" @@ -935,7 +969,7 @@ public: int majorDimension = 0, long style = wxRA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "radioBox"); + const wxString& name = wxPyRadioBoxNameStr); %name(wxPreRadioBox)wxRadioBox(); bool Create(wxWindow* parent, wxWindowID id, @@ -946,7 +980,7 @@ public: int majorDimension = 0, long style = wxRA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "radioBox"); + const wxString& name = wxPyRadioBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreRadioBox:val._setOORInfo(val)" @@ -991,7 +1025,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "radioButton"); + const wxString& name = wxPyRadioButtonNameStr); %name(wxPreRadioButton)wxRadioButton(); bool Create(wxWindow* parent, wxWindowID id, @@ -1000,7 +1034,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - char* name = "radioButton"); + const wxString& name = wxPyRadioButtonNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreRadioButton:val._setOORInfo(val)" @@ -1019,7 +1053,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "slider"); + const wxString& name = wxPySliderNameStr); %name(wxPreSlider)wxSlider(); bool Create(wxWindow* parent, wxWindowID id, @@ -1028,7 +1062,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - char* name = "slider"); + const wxString& name = wxPySliderNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSlider:val._setOORInfo(val)" @@ -1061,22 +1095,22 @@ class wxSpinCtrl : public wxSpinButton { public: wxSpinCtrl(wxWindow *parent, wxWindowID id = -1, - const char* value = "", + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const char* name = "wxSpinCtrl"); + const wxString& name = wxPySpinCtrlNameStr); %name(wxPreSpinCtrl)wxSpinCtrl(); bool Create(wxWindow *parent, wxWindowID id = -1, - const char* value = "", + const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const char* name = "wxSpinCtrl"); + const wxString& name = wxPySpinCtrlNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSpinCtrl:val._setOORInfo(val)" @@ -1104,7 +1138,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const char* name = "toggle"); + const wxString& name = wxPyCheckBoxNameStr); %name(wxPreToggleButton)wxToggleButton(); bool Create(wxWindow *parent, @@ -1114,7 +1148,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const char* name = "toggle"); + const wxString& name = wxPyCheckBoxNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreToggleButton:val._setOORInfo(val)" diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index ea64625404..ef63593dc1 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -40,6 +40,18 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + const wxChar* wxListCtrlNameStr = _T("wxListCtrl"); + DECLARE_DEF_STRING(ListCtrlNameStr); + + const wxChar* wx_TreeCtrlNameStr = _T("wxListCtrl"); + DECLARE_DEF_STRING(_TreeCtrlNameStr); + DECLARE_DEF_STRING(DirDialogDefaultFolderStr); + + static const wxString wxPyEmptyString(wxT("")); +%} + //---------------------------------------------------------------------- enum { @@ -365,7 +377,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) : + const wxString& name) : wxListCtrl(parent, id, pos, size, style, validator, name) {} bool Create(wxWindow* parent, wxWindowID id, @@ -373,7 +385,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) { + const wxString& name) { return wxListCtrl::Create(parent, id, pos, size, style, validator, name); } @@ -400,7 +412,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - char* name = "listCtrl"); + const wxString& name = wxPyListCtrlNameStr); %name(wxPreListCtrl)wxPyListCtrl(); bool Create(wxWindow* parent, wxWindowID id = -1, @@ -408,7 +420,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, - char* name = "listCtrl"); + const wxString& name = wxPyListCtrlNameStr); void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxListCtrl)" @@ -747,7 +759,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_REPORT, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "listctrl" ); + const wxString& name = wxPyListCtrlNameStr); %name(wxPreListView)wxListView(); bool Create( wxWindow *parent, @@ -756,7 +768,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxLC_REPORT, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "listctrl" ); + const wxString& name = wxPyListCtrlNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreListView:val._setOORInfo(val)" @@ -1031,7 +1043,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) : + const wxString& name) : wxTreeCtrl(parent, id, pos, size, style, validator, name) {} bool Create(wxWindow *parent, wxWindowID id, @@ -1039,7 +1051,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) { + const wxString& name) { return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name); } @@ -1078,7 +1090,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, const wxValidator& validator = wxDefaultValidator, - char* name = "wxTreeCtrl"); + const wxString& name = wxPy_TreeCtrlNameStr); %name(wxPreTreeCtrl)wxPyTreeCtrl(); bool Create(wxWindow *parent, wxWindowID id = -1, @@ -1086,7 +1098,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, const wxValidator& validator = wxDefaultValidator, - char* name = "wxTreeCtrl"); + const wxString& name = wxPy_TreeCtrlNameStr); void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxTreeCtrl)" @@ -1333,26 +1345,26 @@ class wxGenericDirCtrl: public wxControl { public: wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1, - const char* dir = wxDirDialogDefaultFolderStr, + const wxString& dir = wxPyDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const char* filter = wxEmptyString, + const wxString& filter = wxPyEmptyString, int defaultFilter = 0, - const char* name = "dirCtrl" ); + const wxString& name = wxPy_TreeCtrlNameStr); %name(wxPreGenericDirCtrl)wxGenericDirCtrl(); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreGenericDirCtrl:val._setOORInfo(val)" bool Create(wxWindow *parent, const wxWindowID id = -1, - const char* dir = wxDirDialogDefaultFolderStr, + const wxString& dir = wxPyDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const char* filter = wxEmptyString, + const wxString& filter = wxPyEmptyString, int defaultFilter = 0, - const char* name = "dirCtrl" ); + const wxString& name = wxPy_TreeCtrlNameStr); // Try to expand as much of the given path as possible. diff --git a/wxPython/src/frames.i b/wxPython/src/frames.i index 9955e0a912..fc4ed7f10d 100644 --- a/wxPython/src/frames.i +++ b/wxPython/src/frames.i @@ -35,6 +35,16 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FrameNameStr); + DECLARE_DEF_STRING(DialogNameStr); + DECLARE_DEF_STRING(StatusLineNameStr); + DECLARE_DEF_STRING(ToolBarNameStr); +%} + +//---------------------------------------------------------------------- + enum { wxFULLSCREEN_NOMENUBAR, wxFULLSCREEN_NOTOOLBAR, @@ -60,7 +70,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %name(wxPreTopLevelWindow)wxTopLevelWindow(); bool Create(wxWindow *parent, @@ -69,7 +79,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)" @@ -115,14 +125,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %name(wxPreFrame)wxFrame(); bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" @@ -143,7 +153,7 @@ public: wxStatusBar* CreateStatusBar(int number = 1, long style = wxST_SIZEGRIP, wxWindowID id = -1, - char* name = "statusBar"); + const wxString& name = wxPyStatusLineNameStr); // get the main status bar wxStatusBar *GetStatusBar(); @@ -159,7 +169,7 @@ public: // create main toolbar virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, - const char* name = "toolBar"); + const wxString& name = wxPyToolBarNameStr); // get/set the main toolbar virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } @@ -177,7 +187,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, - const char* name = "dialogBox"); + const wxString& name = wxPyDialogNameStr); %name(wxPreDialog)wxDialog(); bool Create(wxWindow* parent, @@ -186,7 +196,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, - const char* name = "dialogBox"); + const wxString& name = wxPyDialogNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" @@ -214,14 +224,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %name(wxPreMiniFrame)wxMiniFrame(); bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index ba26ef7556..032a3b2947 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -33,6 +33,11 @@ %import misc.i +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //--------------------------------------------------------------------------- class wxGDIObject : public wxObject { @@ -482,7 +487,7 @@ public: // that can be used it wxFont ctor otherwise return FALSE //bool GetAltForEncoding(wxFontEncoding encoding, // wxFontEncoding *alt_encoding, - // const wxString& facename = wxEmptyString, + // const wxString& facename = wxPyEmptyString, // bool interactive = TRUE); @@ -491,7 +496,7 @@ public: // returns None. %addmethods { PyObject* GetAltForEncoding(wxFontEncoding encoding, - const wxString& facename = wxEmptyString, + const wxString& facename = wxPyEmptyString, bool interactive = TRUE) { wxFontEncoding alt_enc; if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive)) @@ -507,7 +512,7 @@ public: // checks whether given encoding is available in given face or not. // If no facename is given, bool IsEncodingAvailable(wxFontEncoding encoding, - const wxString& facename = wxEmptyString); + const wxString& facename = wxPyEmptyString); // returns the encoding for the given charset (in the form of RFC 2046) or // wxFONTENCODING_SYSTEM if couldn't decode it @@ -542,7 +547,7 @@ public: void SetConfigPath(const wxString& prefix); // return default config path - static const wxChar *GetDefaultConfigPath(); + static wxString GetDefaultConfigPath(); }; @@ -551,7 +556,7 @@ public: class wxFont : public wxGDIObject { public: wxFont( int pointSize, int family, int style, int weight, - int underline=FALSE, char* faceName = "", + int underline=FALSE, const wxString& faceName = wxPyEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT); %name(wxFontFromNativeInfo)wxFont(const wxNativeFontInfo& info); @@ -599,7 +604,7 @@ public: void AddFont(wxFont* font); wxFont * FindOrCreateFont(int point_size, int family, int style, int weight, - bool underline = FALSE, const char* facename = NULL, + bool underline = FALSE, const wxString& facename = wxPyEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT); void RemoveFont(wxFont *font); @@ -1203,7 +1208,7 @@ public: class wxMetaFile : public wxObject { public: - wxMetaFile(const wxString& filename = wxEmptyString); + wxMetaFile(const wxString& filename = wxPyEmptyString); ~wxMetaFile(); bool Ok(); @@ -1223,9 +1228,9 @@ public: class wxMetaFileDC : public wxDC { public: - wxMetaFileDC(const wxString& filename = wxEmptyString, + wxMetaFileDC(const wxString& filename = wxPyEmptyString, int width = 0, int height = 0, - const wxString& description = wxEmptyString); + const wxString& description = wxPyEmptyString); wxMetaFile* Close(); }; diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 64a11cda50..b5af636a9d 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -35,6 +35,13 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(PanelNameStr); +%} + //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // Macros, similar to what's in helpers.h, to aid in the creation of @@ -1315,7 +1322,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, - const char* name = wxPanelNameStr ); + const wxString& name = wxPyPanelNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 0db2221e05..64d394ef00 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -114,7 +114,8 @@ PyObject* wxArrayString2PyList_helper(const wxArrayString& arr); PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr); -#define RETURN_NONE() { Py_INCREF(Py_None); return Py_None; } +#define RETURN_NONE() { Py_INCREF(Py_None); return Py_None; } +#define DECLARE_DEF_STRING(name) static wxString wxPy##name(wx##name) //---------------------------------------------------------------------- diff --git a/wxPython/src/html.i b/wxPython/src/html.i index dbbfa8867a..506e999c08 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -43,6 +43,22 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxHtmlWindowNameStr = wxT("htmlWindow"); + DECLARE_DEF_STRING(HtmlWindowNameStr); + + static const wxChar* wxHtmlPrintoutTitleStr = wxT("Printout"); + DECLARE_DEF_STRING(HtmlPrintoutTitleStr); + + static const wxChar* wxHtmlPrintingTitleStr = wxT("Printing"); + DECLARE_DEF_STRING(HtmlPrintingTitleStr); + + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- enum { @@ -98,7 +114,7 @@ enum wxHtmlURLType class wxHtmlLinkInfo : public wxObject { public: - wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString); + wxHtmlLinkInfo(const wxString& href, const wxString& target = wxPyEmptyString); wxString GetHref(); wxString GetTarget(); wxMouseEvent* GetEvent(); @@ -531,14 +547,14 @@ public: wxPoint& pos = wxDefaultPosition, wxSize& size = wxDefaultSize, int flags=wxHW_SCROLLBAR_AUTO, - char* name = "htmlWindow"); + const wxString& name = wxPyHtmlWindowNameStr); %name(wxPreHtmlWindow)wxPyHtmlWindow(); bool Create(wxWindow *parent, int id = -1, wxPoint& pos = wxDefaultPosition, wxSize& size = wxDefaultSize, int flags=wxHW_SCROLLBAR_AUTO, - char* name = "htmlWindow"); + const wxString& name = wxPyHtmlWindowNameStr); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -553,7 +569,7 @@ public: wxString GetOpenedAnchor(); wxString GetOpenedPageTitle(); - void SetRelatedFrame(wxFrame* frame, const char* format); + void SetRelatedFrame(wxFrame* frame, const wxString& format); wxFrame* GetRelatedFrame(); void SetRelatedStatusBar(int bar); @@ -570,8 +586,8 @@ public: void SetTitle(const wxString& title); void SetBorders(int b); - void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); bool HistoryBack(); bool HistoryForward(); bool HistoryCanBack(); @@ -584,7 +600,7 @@ public: bool HasAnchor(const wxString& anchor); void base_OnLinkClicked(const wxHtmlLinkInfo& link); - void base_OnSetTitle(const char* title); + void base_OnSetTitle(const wxString& title); void base_OnCellMouseHover(wxHtmlCell *cell, wxCoord x, wxCoord y); void base_OnCellClicked(wxHtmlCell *cell, wxCoord x, wxCoord y, @@ -611,7 +627,7 @@ public: void SetDC(wxDC *dc, int maxwidth); void SetSize(int width, int height); void SetHtmlText(const wxString& html, - const wxString& basepath = wxEmptyString, + const wxString& basepath = wxPyEmptyString, bool isdir = TRUE); int Render(int x, int y, int from = 0, int dont_render = FALSE); int GetTotalHeight(); @@ -628,11 +644,11 @@ enum { class wxHtmlPrintout : public wxPyPrintout { public: - wxHtmlPrintout(const char* title = "Printout"); + wxHtmlPrintout(const wxString& title = wxPyHtmlPrintoutTitleStr); //~wxHtmlPrintout(); wxPrintPreview object takes ownership... void SetHtmlText(const wxString& html, - const wxString &basepath = wxEmptyString, + const wxString &basepath = wxPyEmptyString, bool isdir = TRUE); void SetHtmlFile(const wxString &htmlfile); void SetHeader(const wxString& header, int pg = wxPAGE_ALL); @@ -646,14 +662,14 @@ public: class wxHtmlEasyPrinting : public wxObject { public: - wxHtmlEasyPrinting(const char* name = "Printing", + wxHtmlEasyPrinting(const wxString& name = wxPyHtmlPrintingTitleStr, wxFrame *parent_frame = NULL); ~wxHtmlEasyPrinting(); void PreviewFile(const wxString &htmlfile); - void PreviewText(const wxString &htmltext, const wxString& basepath = wxEmptyString); + void PreviewText(const wxString &htmltext, const wxString& basepath = wxPyEmptyString); void PrintFile(const wxString &htmlfile); - void PrintText(const wxString &htmltext, const wxString& basepath = wxEmptyString); + void PrintText(const wxString &htmltext, const wxString& basepath = wxPyEmptyString); void PrinterSetup(); void PageSetup(); void SetHeader(const wxString& header, int pg = wxPAGE_ALL); diff --git a/wxPython/src/htmlhelp.i b/wxPython/src/htmlhelp.i index b9c9bee5e1..42917a1398 100644 --- a/wxPython/src/htmlhelp.i +++ b/wxPython/src/htmlhelp.i @@ -23,6 +23,11 @@ #include %} +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //--------------------------------------------------------------------------- %include typemaps.i @@ -39,15 +44,6 @@ %extern utils.i %extern html.i -// #ifdef wxUSE_UNICODE -// %typemap(python, memberin) wxChar* { -// if ($target) delete [] $target; -// wxString *tempStr = new wxString($source); -// $target = new wxChar[tempStr->Len()+1]; -// memcpy($target, tempStr->c_str(), (sizeof(wxChar)*tempStr->Len())+sizeof(wxChar)); -// delete tempStr; -// } -// #endif //--------------------------------------------------------------------------- @@ -76,13 +72,13 @@ public: struct wxHtmlContentsItem { -%readonly - short int m_Level; - int m_ID; - wxChar* m_Name; - wxChar* m_Page; - wxHtmlBookRecord *m_Book; -%readwrite + %addmethods { + int GetLevel() { return self->m_Level; } + int GetID() { return self->m_ID; } + wxString GetName() { return self->m_Name; } + wxString GetPage() { return self->m_Page; } + wxHtmlBookRecord* GetBook() { return self->m_Book; } + } }; //--------------------------------------------------------------------------- @@ -91,7 +87,7 @@ class wxHtmlSearchStatus { public: //wxHtmlSearchStatus(wxHtmlHelpData* base, const wxString& keyword, - // const wxString& book = wxEmptyString); + // const wxString& book = wxPyEmptyString); bool Search(); bool IsActive(); int GetCurIndex(); @@ -110,9 +106,9 @@ public: void SetTempDir(const wxString& path); bool AddBook(const wxString& book); // bool AddBookParam(const wxString& title, const wxString& contfile, -// const wxString& indexfile=wxEmptyString, -// const wxString& deftopic=wxEmptyString, -// const wxString& path=wxEmptyString); +// const wxString& indexfile=wxPyEmptyString, +// const wxString& deftopic=wxPyEmptyString, +// const wxString& path=wxPyEmptyString); wxString FindPageByName(const wxString& page); wxString FindPageById(int id); @@ -131,7 +127,7 @@ public: class wxHtmlHelpFrame : public wxFrame { public: wxHtmlHelpFrame(wxWindow* parent, int wxWindowID, - const wxString& title = wxEmptyString, + const wxString& title = wxPyEmptyString, int style = wxHF_DEFAULTSTYLE, wxHtmlHelpData* data = NULL); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" @@ -143,9 +139,9 @@ public: void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); }; @@ -180,9 +176,9 @@ public: void DisplayContents(); void DisplayIndex(); bool KeywordSearch(const wxString& keyword); - void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString); - void ReadCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); - void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); + void UseConfig(wxConfigBase *config, const wxString& rootpath = wxPyEmptyString); + void ReadCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); + void WriteCustomization(wxConfigBase *cfg, wxString path = wxPyEmptyString); wxHtmlHelpFrame* GetFrame(); }; diff --git a/wxPython/src/mdi.i b/wxPython/src/mdi.i index 8276334643..7c17fcea71 100644 --- a/wxPython/src/mdi.i +++ b/wxPython/src/mdi.i @@ -32,6 +32,13 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FrameNameStr); +%} + +//---------------------------------------------------------------------- + const int IDM_WINDOWTILE = 4001; const int IDM_WINDOWTILEHOR = 4001; const int IDM_WINDOWCASCADE = 4002; @@ -51,7 +58,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %name(wxPreMDIParentFrame)wxMDIParentFrame(); bool Create(wxWindow *parent, @@ -60,7 +67,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreMDIParentFrame:val._setOORInfo(val)" @@ -95,7 +102,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %name(wxPreMDIChildFrame)wxMDIChildFrame(); bool Create(wxMDIParentFrame* parent, @@ -104,7 +111,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - const char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreMDIChildFrame:val._setOORInfo(val)" diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index bae3d066b9..c0bf1d2e79 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -28,6 +28,11 @@ %import _defs.i +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //--------------------------------------------------------------------------- @@ -345,7 +350,7 @@ long wxGetFreeMemory(); void wxGetMousePosition(int* OUTPUT, int* OUTPUT); bool wxIsBusy(); wxString wxNow(); -bool wxShell(const wxString& command = wxEmptyString); +bool wxShell(const wxString& command = wxPyEmptyString); void wxStartTimer(); int wxGetOsVersion(int *OUTPUT, int *OUTPUT); wxString wxGetOsDescription(); @@ -358,7 +363,7 @@ void wxEnableTopLevelWindows(bool enable); %inline %{ wxString wxGetResource(const wxString& section, const wxString& entry, - const wxString& file = wxEmptyString) { + const wxString& file = wxPyEmptyString) { wxChar * retval; wxGetResource(section, entry, &retval, file); return retval; @@ -374,7 +379,7 @@ wxString wxGetFullHostName(); wxString wxGetUserId(); wxString wxGetUserName(); wxString wxGetHomeDir(); -wxString wxGetUserHome(const char* user = ""); +wxString wxGetUserHome(const wxString& user = wxPyEmptyString); // When wxApp gets the virtual method magic then enable this. diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index 74c55bd82f..f174454e57 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -50,40 +50,50 @@ %import utils.i +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FileSelectorPromptStr); + DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); + + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- // Dialog Functions -wxString wxFileSelector(const wxChar* message = wxFileSelectorPromptStr, - const wxChar* default_path = NULL, - const wxChar* default_filename = NULL, - const wxChar* default_extension = NULL, - const wxChar* wildcard = wxFileSelectorDefaultWildcardStr, +wxString wxFileSelector(const wxString& message = wxPyFileSelectorPromptStr, + const wxString& default_path = wxPyEmptyString, + const wxString& default_filename = wxPyEmptyString, + const wxString& default_extension = wxPyEmptyString, + const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1); // Ask for filename to load -wxString wxLoadFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name = NULL, +wxString wxLoadFileSelector(const wxString& what, + const wxString& extension, + const wxString& default_name = wxPyEmptyString, wxWindow *parent = NULL); // Ask for filename to save -wxString wxSaveFileSelector(const wxChar *what, - const wxChar *extension, - const wxChar *default_name = NULL, +wxString wxSaveFileSelector(const wxString& what, + const wxString& extension, + const wxString& default_name = wxPyEmptyString, wxWindow *parent = NULL); wxString wxGetTextFromUser(const wxString& message, - const wxString& caption = wxEmptyString, - const wxString& default_value = wxEmptyString, + const wxString& caption = wxPyEmptyString, + const wxString& default_value = wxPyEmptyString, wxWindow *parent = NULL, int x = -1, int y = -1, bool centre = TRUE); wxString wxGetPasswordFromUser(const wxString& message, - const wxString& caption = wxEmptyString, - const wxString& default_value = wxEmptyString, + const wxString& caption = wxPyEmptyString, + const wxString& default_value = wxPyEmptyString, wxWindow *parent = NULL); @@ -111,7 +121,7 @@ int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, int wxMessageBox(const wxString& message, - const wxString& caption = wxEmptyString, + const wxString& caption = wxPyEmptyString, int style = wxOK | wxCENTRE, wxWindow *parent = NULL, int x = -1, int y = -1); @@ -163,15 +173,15 @@ void wxFlushEvents(); //--------------------------------------------------------------------------- // Resource System -bool wxResourceAddIdentifier(char *name, int value); +bool wxResourceAddIdentifier(char* name, int value); void wxResourceClear(void); -wxBitmap wxResourceCreateBitmap(char *resource); -wxIcon wxResourceCreateIcon(char *resource); -wxMenuBar * wxResourceCreateMenuBar(char *resource); -int wxResourceGetIdentifier(char *name); -bool wxResourceParseData(char *resource, wxResourceTable *table = NULL); -bool wxResourceParseFile(char *filename, wxResourceTable *table = NULL); -bool wxResourceParseString(char *resource, wxResourceTable *table = NULL); +wxBitmap wxResourceCreateBitmap(char* resource); +wxIcon wxResourceCreateIcon(char* resource); +wxMenuBar * wxResourceCreateMenuBar(char* resource); +int wxResourceGetIdentifier(char* name); +bool wxResourceParseData(char* resource, wxResourceTable *table = NULL); +bool wxResourceParseFile(char* filename, wxResourceTable *table = NULL); +bool wxResourceParseString(char* resource, wxResourceTable *table = NULL); //--------------------------------------------------------------------------- // System Settings @@ -382,7 +392,7 @@ public: bool EnumerateFacenames( wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all bool fixedWidthOnly = FALSE); - bool EnumerateEncodings(const char* facename = ""); + bool EnumerateEncodings(const wxString& facename = wxPyEmptyString); //wxArrayString* GetEncodings(); //wxArrayString* GetFacenames(); @@ -606,8 +616,8 @@ public: static void RemoveTraceMask(const wxString& str); static void ClearTraceMasks(); - static void SetTimestamp(const wxChar *ts); - static const wxChar *GetTimestamp(); + static void SetTimestamp(const wxString& ts); + static const wxString& GetTimestamp(); bool GetVerbose() const { return m_bVerbose; } @@ -980,10 +990,10 @@ class wxFileTypeInfo public: // ctors // a normal item - wxFileTypeInfo(const char *mimeType, - const char *openCmd, - const char *printCmd, - const char *desc); + wxFileTypeInfo(const char* mimeType, + const char* openCmd, + const char* printCmd, + const char* desc); // the array elements correspond to the parameters of the ctor above in @@ -1051,8 +1061,8 @@ public: { public: // ctors - MessageParameters(const wxString& filename=wxEmptyString, - const wxString& mimetype=wxEmptyString); + MessageParameters(const wxString& filename=wxPyEmptyString, + const wxString& mimetype=wxPyEmptyString); // accessors (called by GetOpenCommand) // filename @@ -1161,7 +1171,7 @@ public: // get the command to open/execute the file of given type %addmethods { PyObject* GetOpenCommand(const wxString& filename, - const wxString& mimetype=wxEmptyString) { + const wxString& mimetype=wxPyEmptyString) { wxString str; if (self->GetOpenCommand(&str, wxFileType::MessageParameters(filename, mimetype))) { #if wxUSE_UNICODE @@ -1178,7 +1188,7 @@ public: // get the command to print the file of given type %addmethods { PyObject* GetPrintCommand(const wxString& filename, - const wxString& mimetype=wxEmptyString) { + const wxString& mimetype=wxPyEmptyString) { wxString str; if (self->GetPrintCommand(&str, wxFileType::MessageParameters(filename, mimetype))) { #if wxUSE_UNICODE @@ -1195,7 +1205,7 @@ public: // Get all commands defined for this file type %addmethods { PyObject* GetAllCommands(const wxString& filename, - const wxString& mimetype=wxEmptyString) { + const wxString& mimetype=wxPyEmptyString) { wxArrayString verbs; wxArrayString commands; if (self->GetAllCommands(&verbs, &commands, @@ -1218,7 +1228,7 @@ public: bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = TRUE); - bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0); + bool SetDefaultIcon(const wxString& cmd = wxPyEmptyString, int index = 0); // remove the association for this filetype from the system MIME database: @@ -1262,7 +1272,7 @@ public: // use the extraDir parameter if you want to look for files in another // directory void Initialize(int mailcapStyle = wxMAILCAP_STANDARD, - const wxString& extraDir = wxEmptyString); + const wxString& extraDir = wxPyEmptyString); // and this function clears all the data from the manager void ClearData(); diff --git a/wxPython/src/msw/calendar.cpp b/wxPython/src/msw/calendar.cpp index 2e3c9289f7..9da116f721 100644 --- a/wxPython/src/msw/calendar.cpp +++ b/wxPython/src/msw/calendar.cpp @@ -84,6 +84,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(CalendarNameStr); #ifdef __cplusplus extern "C" { #endif @@ -872,18 +875,19 @@ static PyObject *_wrap_new_wxCalendarCtrl(PyObject *self, PyObject *args, PyObje wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxCAL_SHOW_HOLIDAYS)|wxWANTS_CHARS; - char * _arg6 = (char *) "calendar"; + wxString * _arg6 = (wxString *) &wxPyCalendarNameStr; PyObject * _argo0 = 0; PyObject * _argo2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","date","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOls:new_wxCalendarCtrl",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlO:new_wxCalendarCtrl",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -910,10 +914,16 @@ static PyObject *_wrap_new_wxCalendarCtrl(PyObject *self, PyObject *args, PyObje _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxCalendarCtrl *)new_wxCalendarCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxCalendarCtrl *)new_wxCalendarCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -924,6 +934,10 @@ static PyObject *_wrap_new_wxCalendarCtrl(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -964,7 +978,7 @@ static PyObject *_wrap_wxCalendarCtrl_Create(PyObject *self, PyObject *args, PyO wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) (wxCAL_SHOW_HOLIDAYS)|wxWANTS_CHARS; - char * _arg7 = (char *) "calendar"; + wxString * _arg7 = (wxString *) &wxPyCalendarNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo3 = 0; @@ -972,10 +986,11 @@ static PyObject *_wrap_wxCalendarCtrl_Create(PyObject *self, PyObject *args, PyO PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","date","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOls:wxCalendarCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlO:wxCalendarCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1009,14 +1024,24 @@ static PyObject *_wrap_wxCalendarCtrl_Create(PyObject *self, PyObject *args, PyO _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxCalendarCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxCalendarCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } diff --git a/wxPython/src/msw/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp index 493610c844..d37dc49fe2 100644 --- a/wxPython/src/msw/clip_dnd.cpp +++ b/wxPython/src/msw/clip_dnd.cpp @@ -86,6 +86,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); // An alternate constructor... wxDataFormat* wxCustomDataFormat(const wxString &id) { return new wxDataFormat(id); @@ -144,7 +147,7 @@ bool wxPyDataObjectSimple::SetData(size_t len, const void *buf) { // Create a new class for wxPython to use class wxPyTextDataObject : public wxTextDataObject { public: - wxPyTextDataObject(const wxString& text = wxEmptyString) + wxPyTextDataObject(const wxString& text = wxPyEmptyString) : wxTextDataObject(text) {} DEC_PYCALLBACK_SIZET_(GetTextLength); @@ -547,12 +550,13 @@ static PyObject *_wrap_wxDataFormat_GetId(PyObject *self, PyObject *args, PyObje static PyObject *_wrap_wxDataFormat_SetId(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxDataFormat * _arg0; - wxChar * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","format", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDataFormat_SetId",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDataFormat_SetId",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -561,14 +565,23 @@ static PyObject *_wrap_wxDataFormat_SetId(PyObject *self, PyObject *args, PyObje return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxDataFormat_SetId(_arg0,_arg1); + wxDataFormat_SetId(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -1162,7 +1175,7 @@ static void *SwigwxTextDataObjectTowxDataObject(void *ptr) { static PyObject *_wrap_new_wxTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxTextDataObject * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "text", NULL }; char _ptemp[128]; @@ -1328,7 +1341,7 @@ static void *SwigwxPyTextDataObjectTowxDataObject(void *ptr) { static PyObject *_wrap_new_wxPyTextDataObject(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyTextDataObject * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "text", NULL }; char _ptemp[128]; diff --git a/wxPython/src/msw/cmndlgs.cpp b/wxPython/src/msw/cmndlgs.cpp index b56c41e6b4..bc8fe68a71 100644 --- a/wxPython/src/msw/cmndlgs.cpp +++ b/wxPython/src/msw/cmndlgs.cpp @@ -88,6 +88,14 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FileSelectorPromptStr); + DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); + DECLARE_DEF_STRING(GetTextFromUserPromptStr); + DECLARE_DEF_STRING(MessageBoxCaptionStr); + static const wxString wxPyEmptyString(wxT("")); + #ifdef __cplusplus extern "C" { #endif @@ -537,18 +545,20 @@ static PyObject *_wrap_new_wxDirDialog(PyObject *self, PyObject *args, PyObject PyObject * _resultobj; wxDirDialog * _result; wxWindow * _arg0; - char * _arg1 = (char *) "Choose a directory"; - char * _arg2 = (char *) ""; + wxString * _arg1 = (wxString *) &wxPyFileSelectorPromptStr; + wxString * _arg2 = (wxString *) &wxPyEmptyString; long _arg3 = (long ) 0; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj4 = 0; char *_kwnames[] = { "parent","message","defaultPath","style","pos", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|sslO:new_wxDirDialog",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_obj4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOlO:new_wxDirDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -557,6 +567,18 @@ static PyObject *_wrap_new_wxDirDialog(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -565,7 +587,7 @@ static PyObject *_wrap_new_wxDirDialog(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxDirDialog *)new_wxDirDialog(_arg0,_arg1,_arg2,_arg3,*_arg4); + _result = (wxDirDialog *)new_wxDirDialog(_arg0,*_arg1,*_arg2,_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -576,6 +598,14 @@ static PyObject *_wrap_new_wxDirDialog(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} return _resultobj; } @@ -832,20 +862,24 @@ static PyObject *_wrap_new_wxFileDialog(PyObject *self, PyObject *args, PyObject PyObject * _resultobj; wxFileDialog * _result; wxWindow * _arg0; - char * _arg1 = (char *) "Choose a file"; - char * _arg2 = (char *) ""; - char * _arg3 = (char *) ""; - char * _arg4 = (char *) "*.*"; + wxString * _arg1 = (wxString *) &wxPyFileSelectorPromptStr; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; + wxString * _arg4 = (wxString *) &wxPyFileSelectorDefaultWildcardStr; long _arg5 = (long ) 0; wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; wxPoint temp; PyObject * _obj6 = 0; char *_kwnames[] = { "parent","message","defaultDir","defaultFile","wildcard","style","pos", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|sssslO:new_wxFileDialog",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_obj6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOOOlO:new_wxFileDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -854,6 +888,30 @@ static PyObject *_wrap_new_wxFileDialog(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} if (_obj6) { _arg6 = &temp; @@ -862,7 +920,7 @@ static PyObject *_wrap_new_wxFileDialog(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxFileDialog *)new_wxFileDialog(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,*_arg6); + _result = (wxFileDialog *)new_wxFileDialog(_arg0,*_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -873,6 +931,22 @@ static PyObject *_wrap_new_wxFileDialog(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj4) + delete _arg4; +} return _resultobj; } @@ -1974,19 +2048,22 @@ static PyObject *_wrap_new_wxTextEntryDialog(PyObject *self, PyObject *args, PyO PyObject * _resultobj; wxTextEntryDialog * _result; wxWindow * _arg0; - char * _arg1; - char * _arg2 = (char *) "Input Text"; - char * _arg3 = (char *) ""; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyGetTextFromUserPromptStr; + wxString * _arg3 = (wxString *) &wxPyEmptyString; long _arg4 = (long ) wxOK|wxCANCEL|wxCENTRE; wxPoint * _arg5 = (wxPoint *) &wxDefaultPosition; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj5 = 0; char *_kwnames[] = { "parent","message","caption","defaultValue","style","pos", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os|sslO:new_wxTextEntryDialog",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_obj5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OOlO:new_wxTextEntryDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1995,6 +2072,23 @@ static PyObject *_wrap_new_wxTextEntryDialog(PyObject *self, PyObject *args, PyO return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} if (_obj5) { _arg5 = &temp; @@ -2003,7 +2097,7 @@ static PyObject *_wrap_new_wxTextEntryDialog(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxTextEntryDialog *)new_wxTextEntryDialog(_arg0,_arg1,_arg2,_arg3,_arg4,*_arg5); + _result = (wxTextEntryDialog *)new_wxTextEntryDialog(_arg0,*_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2014,6 +2108,18 @@ static PyObject *_wrap_new_wxTextEntryDialog(PyObject *self, PyObject *args, PyO Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -2783,18 +2889,20 @@ static PyObject *_wrap_new_wxMessageDialog(PyObject *self, PyObject *args, PyObj PyObject * _resultobj; wxMessageDialog * _result; wxWindow * _arg0; - char * _arg1; - char * _arg2 = (char *) "Message box"; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyMessageBoxCaptionStr; long _arg3 = (long ) wxOK|wxCANCEL|wxCENTRE; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj4 = 0; char *_kwnames[] = { "parent","message","caption","style","pos", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os|slO:new_wxMessageDialog",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_obj4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OlO:new_wxMessageDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_arg3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2803,6 +2911,17 @@ static PyObject *_wrap_new_wxMessageDialog(PyObject *self, PyObject *args, PyObj return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -2811,7 +2930,7 @@ static PyObject *_wrap_new_wxMessageDialog(PyObject *self, PyObject *args, PyObj } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxMessageDialog *)new_wxMessageDialog(_arg0,_arg1,_arg2,_arg3,*_arg4); + _result = (wxMessageDialog *)new_wxMessageDialog(_arg0,*_arg1,*_arg2,_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2822,6 +2941,14 @@ static PyObject *_wrap_new_wxMessageDialog(PyObject *self, PyObject *args, PyObj Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} return _resultobj; } @@ -2957,13 +3084,14 @@ static PyObject *_wrap_wxProgressDialog_Update(PyObject *self, PyObject *args, P PyObject * _resultobj; bool _result; wxProgressDialog * _arg0; - int _arg1 = (int ) -1; - char * _arg2 = (char *) NULL; + int _arg1; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","value","newmsg", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|is:wxProgressDialog_Update",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|O:wxProgressDialog_Update",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2972,13 +3100,23 @@ static PyObject *_wrap_wxProgressDialog_Update(PyObject *self, PyObject *args, P return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxProgressDialog_Update(_arg0,_arg1,_arg2); + _result = (bool )wxProgressDialog_Update(_arg0,_arg1,*_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj2) + delete _arg2; +} return _resultobj; } diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index 4aead096a1..5861abf826 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -99,6 +99,31 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + +//#define DECLARE_DEF_STRING(name) static wxString* wxPy##name + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(ControlNameStr); + DECLARE_DEF_STRING(ButtonNameStr); + DECLARE_DEF_STRING(CheckBoxNameStr); + DECLARE_DEF_STRING(ChoiceNameStr); + DECLARE_DEF_STRING(ComboBoxNameStr); + DECLARE_DEF_STRING(GaugeNameStr); + DECLARE_DEF_STRING(StaticBoxNameStr); + DECLARE_DEF_STRING(StaticTextNameStr); + DECLARE_DEF_STRING(ListBoxNameStr); + DECLARE_DEF_STRING(TextCtrlNameStr); + DECLARE_DEF_STRING(ScrollBarNameStr); + DECLARE_DEF_STRING(SPIN_BUTTON_NAME); + DECLARE_DEF_STRING(StaticBitmapNameStr); + DECLARE_DEF_STRING(RadioBoxNameStr); + DECLARE_DEF_STRING(RadioButtonNameStr); + DECLARE_DEF_STRING(SliderNameStr); + + wxChar* wxSpinCtrlNameStr = _T("wxSpinCtrl"); + DECLARE_DEF_STRING(SpinCtrlNameStr); + + static const wxString wxPyEmptyString(wxT("")); #ifdef __cplusplus extern "C" { #endif @@ -151,18 +176,19 @@ static PyObject *_wrap_new_wxControl(PyObject *self, PyObject *args, PyObject *k wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; - char * _arg6 = (char *) "control"; + wxString * _arg6 = (wxString *) &wxPyControlNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; PyObject * _argo5 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlOs:new_wxControl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlOO:new_wxControl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -190,9 +216,15 @@ static PyObject *_wrap_new_wxControl(PyObject *self, PyObject *args, PyObject *k return NULL; } } + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxControl *)new_wxControl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); + _result = (wxControl *)new_wxControl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -203,6 +235,10 @@ static PyObject *_wrap_new_wxControl(PyObject *self, PyObject *args, PyObject *k Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -243,7 +279,7 @@ static PyObject *_wrap_wxControl_Create(PyObject *self, PyObject *args, PyObject wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "control"; + wxString * _arg7 = (wxString *) &wxPyControlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -251,10 +287,11 @@ static PyObject *_wrap_wxControl_Create(PyObject *self, PyObject *args, PyObject wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlOs:wxControl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlOO:wxControl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -289,13 +326,23 @@ static PyObject *_wrap_wxControl_Create(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxControl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (bool )wxControl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -937,7 +984,7 @@ static PyObject *_wrap_new_wxButton(PyObject *self, PyObject *args, PyObject *kw wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "button"; + wxString * _arg7 = (wxString *) &wxPyButtonNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; @@ -945,11 +992,12 @@ static PyObject *_wrap_new_wxButton(PyObject *self, PyObject *args, PyObject *kw wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOO:new_wxButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -982,9 +1030,15 @@ static PyObject *_wrap_new_wxButton(PyObject *self, PyObject *args, PyObject *kw return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxButton *)new_wxButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxButton *)new_wxButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -998,6 +1052,10 @@ static PyObject *_wrap_new_wxButton(PyObject *self, PyObject *args, PyObject *kw { if (_obj2) delete _arg2; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -1040,7 +1098,7 @@ static PyObject *_wrap_wxButton_Create(PyObject *self, PyObject *args, PyObject wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "button"; + wxString * _arg8 = (wxString *) &wxPyButtonNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -1049,10 +1107,11 @@ static PyObject *_wrap_wxButton_Create(PyObject *self, PyObject *args, PyObject wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOs:wxButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOO:wxButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1092,9 +1151,15 @@ static PyObject *_wrap_wxButton_Create(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1102,6 +1167,10 @@ static PyObject *_wrap_wxButton_Create(PyObject *self, PyObject *args, PyObject { if (_obj3) delete _arg3; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -1344,7 +1413,7 @@ static PyObject *_wrap_new_wxBitmapButton(PyObject *self, PyObject *args, PyObje wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxBU_AUTODRAW; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "button"; + wxString * _arg7 = (wxString *) &wxPyButtonNameStr; PyObject * _argo0 = 0; PyObject * _argo2 = 0; wxPoint temp; @@ -1352,11 +1421,12 @@ static PyObject *_wrap_new_wxBitmapButton(PyObject *self, PyObject *args, PyObje wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","bitmap","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxBitmapButton",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOO:new_wxBitmapButton",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1391,9 +1461,15 @@ static PyObject *_wrap_new_wxBitmapButton(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxBitmapButton *)new_wxBitmapButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxBitmapButton *)new_wxBitmapButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1404,6 +1480,10 @@ static PyObject *_wrap_new_wxBitmapButton(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -1445,7 +1525,7 @@ static PyObject *_wrap_wxBitmapButton_Create(PyObject *self, PyObject *args, PyO wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxBU_AUTODRAW; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "button"; + wxString * _arg8 = (wxString *) &wxPyButtonNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo3 = 0; @@ -1454,10 +1534,11 @@ static PyObject *_wrap_wxBitmapButton_Create(PyObject *self, PyObject *args, PyO wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","bitmap","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOs:wxBitmapButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOO:wxBitmapButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1499,13 +1580,23 @@ static PyObject *_wrap_wxBitmapButton_Create(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxBitmapButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxBitmapButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj8) + delete _arg8; +} return _resultobj; } @@ -1906,7 +1997,7 @@ static PyObject *_wrap_new_wxCheckBox(PyObject *self, PyObject *args, PyObject * wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "checkBox"; + wxString * _arg7 = (wxString *) &wxPyCheckBoxNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; @@ -1914,11 +2005,12 @@ static PyObject *_wrap_new_wxCheckBox(PyObject *self, PyObject *args, PyObject * wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","val","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxCheckBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOO:new_wxCheckBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1951,9 +2043,15 @@ static PyObject *_wrap_new_wxCheckBox(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxCheckBox *)new_wxCheckBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxCheckBox *)new_wxCheckBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1967,6 +2065,10 @@ static PyObject *_wrap_new_wxCheckBox(PyObject *self, PyObject *args, PyObject * { if (_obj2) delete _arg2; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -2009,7 +2111,7 @@ static PyObject *_wrap_wxCheckBox_Create(PyObject *self, PyObject *args, PyObjec wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "checkBox"; + wxString * _arg8 = (wxString *) &wxPyCheckBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -2018,10 +2120,11 @@ static PyObject *_wrap_wxCheckBox_Create(PyObject *self, PyObject *args, PyObjec wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","val","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOs:wxCheckBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOO:wxCheckBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2061,9 +2164,15 @@ static PyObject *_wrap_wxCheckBox_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxCheckBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxCheckBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2071,6 +2180,10 @@ static PyObject *_wrap_wxCheckBox_Create(PyObject *self, PyObject *args, PyObjec { if (_obj3) delete _arg3; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -2186,7 +2299,7 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw wxString * _arg5 = (wxString *) NULL; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "choice"; + wxString * _arg8 = (wxString *) &wxPyChoiceNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; @@ -2194,11 +2307,12 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOs:new_wxChoice",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOO:new_wxChoice",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2233,6 +2347,12 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { if (_obj5) { _arg4 = PyList_Size(_obj5); @@ -2243,7 +2363,7 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChoice *)new_wxChoice(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,_arg8); + _result = (wxChoice *)new_wxChoice(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2256,6 +2376,10 @@ static PyObject *_wrap_new_wxChoice(PyObject *self, PyObject *args, PyObject *kw } { delete [] _arg5; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -2299,7 +2423,7 @@ static PyObject *_wrap_wxChoice_Create(PyObject *self, PyObject *args, PyObject wxString * _arg6 = (wxString *) NULL; long _arg7 = (long ) 0; wxValidator * _arg8 = (wxValidator *) &wxDefaultValidator; - char * _arg9 = (char *) "choice"; + wxString * _arg9 = (wxString *) &wxPyChoiceNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -2308,10 +2432,11 @@ static PyObject *_wrap_wxChoice_Create(PyObject *self, PyObject *args, PyObject PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "self","parent","id","pos","size","choices","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOs:wxChoice_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOO:wxChoice_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2353,6 +2478,12 @@ static PyObject *_wrap_wxChoice_Create(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; +} { if (_obj6) { _arg5 = PyList_Size(_obj6); @@ -2363,13 +2494,17 @@ static PyObject *_wrap_wxChoice_Create(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxChoice_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,_arg9); + _result = (bool )wxChoice_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { delete [] _arg6; +} +{ + if (_obj9) + delete _arg9; } return _resultobj; } @@ -2621,26 +2756,28 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * wxComboBox * _result; wxWindow * _arg0; wxWindowID _arg1; - char * _arg2 = (char *) ""; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; int _arg5 = (int ) 0; wxString * _arg6 = (wxString *) NULL; long _arg7 = (long ) 0; wxValidator * _arg8 = (wxValidator *) &wxDefaultValidator; - char * _arg9 = (char *) "comboBox"; + wxString * _arg9 = (wxString *) &wxPyComboBoxNameStr; PyObject * _argo0 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "parent","id","value","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|sOOOlOs:new_wxComboBox",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOOlOO:new_wxComboBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2649,6 +2786,12 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj3) { _arg3 = &temp; @@ -2675,6 +2818,12 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; +} { if (_obj6) { _arg5 = PyList_Size(_obj6); @@ -2685,7 +2834,7 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxComboBox *)new_wxComboBox(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,_arg9); + _result = (wxComboBox *)new_wxComboBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2696,8 +2845,16 @@ static PyObject *_wrap_new_wxComboBox(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj2) + delete _arg2; +} { delete [] _arg6; +} +{ + if (_obj9) + delete _arg9; } return _resultobj; } @@ -2735,26 +2892,28 @@ static PyObject *_wrap_wxComboBox_Create(PyObject *self, PyObject *args, PyObjec wxComboBox * _arg0; wxWindow * _arg1; wxWindowID _arg2; - char * _arg3 = (char *) ""; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; int _arg6 = (int ) 0; wxString * _arg7 = (wxString *) NULL; long _arg8 = (long ) 0; wxValidator * _arg9 = (wxValidator *) &wxDefaultValidator; - char * _arg10 = (char *) "comboBox"; + wxString * _arg10 = (wxString *) &wxPyComboBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; PyObject * _obj7 = 0; PyObject * _argo9 = 0; + PyObject * _obj10 = 0; char *_kwnames[] = { "self","parent","id","value","pos","size","choices","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|sOOOlOs:wxComboBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_obj7,&_arg8,&_argo9,&_arg10)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOOlOO:wxComboBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_obj7,&_arg8,&_argo9,&_obj10)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2770,6 +2929,12 @@ static PyObject *_wrap_wxComboBox_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -2796,6 +2961,12 @@ static PyObject *_wrap_wxComboBox_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj10) +{ + _arg10 = wxString_in_helper(_obj10); + if (_arg10 == NULL) + return NULL; +} { if (_obj7) { _arg6 = PyList_Size(_obj7); @@ -2806,13 +2977,21 @@ static PyObject *_wrap_wxComboBox_Create(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxComboBox_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,*_arg9,_arg10); + _result = (bool )wxComboBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,*_arg9,*_arg10); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} { delete [] _arg7; +} +{ + if (_obj10) + delete _arg10; } return _resultobj; } @@ -3294,18 +3473,19 @@ static PyObject *_wrap_new_wxGauge(PyObject *self, PyObject *args, PyObject *kwa wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxGA_HORIZONTAL; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "gauge"; + wxString * _arg7 = (wxString *) &wxPyGaugeNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","range","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii|OOlOs:new_wxGauge",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii|OOlOO:new_wxGauge",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3333,9 +3513,15 @@ static PyObject *_wrap_new_wxGauge(PyObject *self, PyObject *args, PyObject *kwa return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGauge *)new_wxGauge(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxGauge *)new_wxGauge(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3346,6 +3532,10 @@ static PyObject *_wrap_new_wxGauge(PyObject *self, PyObject *args, PyObject *kwa Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -3387,7 +3577,7 @@ static PyObject *_wrap_wxGauge_Create(PyObject *self, PyObject *args, PyObject * wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxGA_HORIZONTAL; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "gauge"; + wxString * _arg8 = (wxString *) &wxPyGaugeNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -3395,10 +3585,11 @@ static PyObject *_wrap_wxGauge_Create(PyObject *self, PyObject *args, PyObject * wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","range","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOii|OOlOs:wxGauge_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOii|OOlOO:wxGauge_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3433,13 +3624,23 @@ static PyObject *_wrap_wxGauge_Create(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxGauge_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxGauge_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj8) + delete _arg8; +} return _resultobj; } @@ -3713,18 +3914,19 @@ static PyObject *_wrap_new_wxStaticBox(PyObject *self, PyObject *args, PyObject wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "staticBox"; + wxString * _arg6 = (wxString *) &wxPyStaticBoxNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxStaticBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxStaticBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3749,10 +3951,16 @@ static PyObject *_wrap_new_wxStaticBox(PyObject *self, PyObject *args, PyObject _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStaticBox *)new_wxStaticBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxStaticBox *)new_wxStaticBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3766,6 +3974,10 @@ static PyObject *_wrap_new_wxStaticBox(PyObject *self, PyObject *args, PyObject { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -3807,7 +4019,7 @@ static PyObject *_wrap_wxStaticBox_Create(PyObject *self, PyObject *args, PyObje wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; - char * _arg7 = (char *) "staticBox"; + wxString * _arg7 = (wxString *) &wxPyStaticBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -3815,10 +4027,11 @@ static PyObject *_wrap_wxStaticBox_Create(PyObject *self, PyObject *args, PyObje PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxStaticBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxStaticBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3850,10 +4063,16 @@ static PyObject *_wrap_wxStaticBox_Create(PyObject *self, PyObject *args, PyObje _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxStaticBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxStaticBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3861,6 +4080,10 @@ static PyObject *_wrap_wxStaticBox_Create(PyObject *self, PyObject *args, PyObje { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -3906,17 +4129,18 @@ static PyObject *_wrap_new_wxStaticLine(PyObject *self, PyObject *args, PyObject wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxLI_HORIZONTAL; - char * _arg5 = (char *) "staticLine"; + wxString * _arg5 = (wxString *) &wxPyStaticTextNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxStaticLine",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxStaticLine",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3936,10 +4160,16 @@ static PyObject *_wrap_new_wxStaticLine(PyObject *self, PyObject *args, PyObject _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStaticLine *)new_wxStaticLine(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxStaticLine *)new_wxStaticLine(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3950,6 +4180,10 @@ static PyObject *_wrap_new_wxStaticLine(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -3989,17 +4223,18 @@ static PyObject *_wrap_wxStaticLine_Create(PyObject *self, PyObject *args, PyObj wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxLI_HORIZONTAL; - char * _arg6 = (char *) "staticLine"; + wxString * _arg6 = (wxString *) &wxPyStaticTextNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxStaticLine_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxStaticLine_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4026,14 +4261,24 @@ static PyObject *_wrap_wxStaticLine_Create(PyObject *self, PyObject *args, PyObj _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxStaticLine_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxStaticLine_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -4079,18 +4324,19 @@ static PyObject *_wrap_new_wxStaticText(PyObject *self, PyObject *args, PyObject wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "staticText"; + wxString * _arg6 = (wxString *) &wxPyStaticTextNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxStaticText",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxStaticText",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4115,10 +4361,16 @@ static PyObject *_wrap_new_wxStaticText(PyObject *self, PyObject *args, PyObject _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStaticText *)new_wxStaticText(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxStaticText *)new_wxStaticText(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -4132,6 +4384,10 @@ static PyObject *_wrap_new_wxStaticText(PyObject *self, PyObject *args, PyObject { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -4173,7 +4429,7 @@ static PyObject *_wrap_wxStaticText_Create(PyObject *self, PyObject *args, PyObj wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; - char * _arg7 = (char *) "staticText"; + wxString * _arg7 = (wxString *) &wxPyStaticTextNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -4181,10 +4437,11 @@ static PyObject *_wrap_wxStaticText_Create(PyObject *self, PyObject *args, PyObj PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxStaticText_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxStaticText_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4216,10 +4473,16 @@ static PyObject *_wrap_wxStaticText_Create(PyObject *self, PyObject *args, PyObj _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxStaticText_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxStaticText_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -4227,6 +4490,10 @@ static PyObject *_wrap_wxStaticText_Create(PyObject *self, PyObject *args, PyObj { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -4359,7 +4626,7 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k wxString * _arg5 = (wxString *) NULL; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "listBox"; + wxString * _arg8 = (wxString *) &wxPyListBoxNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; @@ -4367,11 +4634,12 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOs:new_wxListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOO:new_wxListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4406,6 +4674,12 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { if (_obj5) { _arg4 = PyList_Size(_obj5); @@ -4416,7 +4690,7 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxListBox *)new_wxListBox(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,_arg8); + _result = (wxListBox *)new_wxListBox(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -4429,6 +4703,10 @@ static PyObject *_wrap_new_wxListBox(PyObject *self, PyObject *args, PyObject *k } { delete [] _arg5; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -4472,7 +4750,7 @@ static PyObject *_wrap_wxListBox_Create(PyObject *self, PyObject *args, PyObject wxString * _arg6 = (wxString *) NULL; long _arg7 = (long ) 0; wxValidator * _arg8 = (wxValidator *) &wxDefaultValidator; - char * _arg9 = (char *) "listBox"; + wxString * _arg9 = (wxString *) &wxPyListBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -4481,10 +4759,11 @@ static PyObject *_wrap_wxListBox_Create(PyObject *self, PyObject *args, PyObject PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "self","parent","id","pos","size","choices","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOs:wxListBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOO:wxListBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4526,6 +4805,12 @@ static PyObject *_wrap_wxListBox_Create(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; +} { if (_obj6) { _arg5 = PyList_Size(_obj6); @@ -4536,13 +4821,17 @@ static PyObject *_wrap_wxListBox_Create(PyObject *self, PyObject *args, PyObject } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxListBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,_arg9); + _result = (bool )wxListBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { delete [] _arg6; +} +{ + if (_obj9) + delete _arg9; } return _resultobj; } @@ -5040,7 +5329,7 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje wxString * _arg5 = (wxString *) NULL; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "listBox"; + wxString * _arg8 = (wxString *) &wxPyListBoxNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; @@ -5048,11 +5337,12 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje PyObject * _obj3 = 0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "parent","id","pos","size","choices","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOs:new_wxCheckListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOO:new_wxCheckListBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5087,6 +5377,12 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { if (_obj5) { _arg4 = PyList_Size(_obj5); @@ -5097,7 +5393,7 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxCheckListBox *)new_wxCheckListBox(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,_arg8); + _result = (wxCheckListBox *)new_wxCheckListBox(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5110,6 +5406,10 @@ static PyObject *_wrap_new_wxCheckListBox(PyObject *self, PyObject *args, PyObje } { delete [] _arg5; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -5153,7 +5453,7 @@ static PyObject *_wrap_wxCheckListBox_Create(PyObject *self, PyObject *args, PyO wxString * _arg6 = (wxString *) NULL; long _arg7 = (long ) 0; wxValidator * _arg8 = (wxValidator *) &wxDefaultValidator; - char * _arg9 = (char *) "listBox"; + wxString * _arg9 = (wxString *) &wxPyListBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -5162,10 +5462,11 @@ static PyObject *_wrap_wxCheckListBox_Create(PyObject *self, PyObject *args, PyO PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "self","parent","id","pos","size","choices","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOs:wxCheckListBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOO:wxCheckListBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj6,&_arg7,&_argo8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5207,6 +5508,12 @@ static PyObject *_wrap_wxCheckListBox_Create(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; +} { if (_obj6) { _arg5 = PyList_Size(_obj6); @@ -5217,13 +5524,17 @@ static PyObject *_wrap_wxCheckListBox_Create(PyObject *self, PyObject *args, PyO } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxCheckListBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,_arg9); + _result = (bool )wxCheckListBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,*_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); { delete [] _arg6; +} +{ + if (_obj9) + delete _arg9; } return _resultobj; } @@ -5841,23 +6152,25 @@ static PyObject *_wrap_new_wxTextCtrl(PyObject *self, PyObject *args, PyObject * wxTextCtrl * _result; wxWindow * _arg0; wxWindowID _arg1; - char * _arg2 = (char *) ""; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "text"; + wxString * _arg7 = (wxString *) &wxPyTextCtrlNameStr; PyObject * _argo0 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","value","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|sOOlOs:new_wxTextCtrl",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOOlOO:new_wxTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5866,6 +6179,12 @@ static PyObject *_wrap_new_wxTextCtrl(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj3) { _arg3 = &temp; @@ -5885,9 +6204,15 @@ static PyObject *_wrap_new_wxTextCtrl(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxTextCtrl *)new_wxTextCtrl(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxTextCtrl *)new_wxTextCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5898,6 +6223,14 @@ static PyObject *_wrap_new_wxTextCtrl(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -5934,23 +6267,25 @@ static PyObject *_wrap_wxTextCtrl_Create(PyObject *self, PyObject *args, PyObjec wxTextCtrl * _arg0; wxWindow * _arg1; wxWindowID _arg2; - char * _arg3 = (char *) ""; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "text"; + wxString * _arg8 = (wxString *) &wxPyTextCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","value","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|sOOlOs:wxTextCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOOlOO:wxTextCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5966,6 +6301,12 @@ static PyObject *_wrap_wxTextCtrl_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -5985,13 +6326,27 @@ static PyObject *_wrap_wxTextCtrl_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxTextCtrl_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxTextCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj8) + delete _arg8; +} return _resultobj; } @@ -6489,7 +6844,7 @@ static PyObject *_wrap_wxTextCtrl_SaveFile(PyObject *self, PyObject *args, PyObj PyObject * _resultobj; bool _result; wxTextCtrl * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "self","file", NULL }; @@ -7485,18 +7840,19 @@ static PyObject *_wrap_new_wxScrollBar(PyObject *self, PyObject *args, PyObject wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxSB_HORIZONTAL; wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; - char * _arg6 = (char *) "scrollBar"; + wxString * _arg6 = (wxString *) &wxPyScrollBarNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; PyObject * _argo5 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOs:new_wxScrollBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOO:new_wxScrollBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7524,9 +7880,15 @@ static PyObject *_wrap_new_wxScrollBar(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxScrollBar *)new_wxScrollBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); + _result = (wxScrollBar *)new_wxScrollBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7537,6 +7899,10 @@ static PyObject *_wrap_new_wxScrollBar(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -7577,7 +7943,7 @@ static PyObject *_wrap_wxScrollBar_Create(PyObject *self, PyObject *args, PyObje wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxSB_HORIZONTAL; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "scrollBar"; + wxString * _arg7 = (wxString *) &wxPyScrollBarNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -7585,10 +7951,11 @@ static PyObject *_wrap_wxScrollBar_Create(PyObject *self, PyObject *args, PyObje wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOs:wxScrollBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOO:wxScrollBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7623,13 +7990,23 @@ static PyObject *_wrap_wxScrollBar_Create(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxScrollBar_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (bool )wxScrollBar_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -7878,17 +8255,18 @@ static PyObject *_wrap_new_wxSpinButton(PyObject *self, PyObject *args, PyObject wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxSP_HORIZONTAL; - char * _arg5 = (char *) "spinButton"; + wxString * _arg5 = (wxString *) &wxPySPIN_BUTTON_NAME; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOls:new_wxSpinButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlO:new_wxSpinButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7908,10 +8286,16 @@ static PyObject *_wrap_new_wxSpinButton(PyObject *self, PyObject *args, PyObject _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSpinButton *)new_wxSpinButton(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxSpinButton *)new_wxSpinButton(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7922,6 +8306,10 @@ static PyObject *_wrap_new_wxSpinButton(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -7961,17 +8349,18 @@ static PyObject *_wrap_wxSpinButton_Create(PyObject *self, PyObject *args, PyObj wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxSP_HORIZONTAL; - char * _arg6 = (char *) "spinButton"; + wxString * _arg6 = (wxString *) &wxPySPIN_BUTTON_NAME; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOls:wxSpinButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlO:wxSpinButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7998,14 +8387,24 @@ static PyObject *_wrap_wxSpinButton_Create(PyObject *self, PyObject *args, PyObj _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSpinButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxSpinButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -8194,18 +8593,19 @@ static PyObject *_wrap_new_wxStaticBitmap(PyObject *self, PyObject *args, PyObje wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "staticBitmap"; + wxString * _arg6 = (wxString *) &wxPyStaticBitmapNameStr; PyObject * _argo0 = 0; PyObject * _argo2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","bitmap","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxStaticBitmap",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxStaticBitmap",_kwnames,&_argo0,&_arg1,&_argo2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8232,10 +8632,16 @@ static PyObject *_wrap_new_wxStaticBitmap(PyObject *self, PyObject *args, PyObje _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStaticBitmap *)new_wxStaticBitmap(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxStaticBitmap *)new_wxStaticBitmap(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -8246,6 +8652,10 @@ static PyObject *_wrap_new_wxStaticBitmap(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -8286,7 +8696,7 @@ static PyObject *_wrap_wxStaticBitmap_Create(PyObject *self, PyObject *args, PyO wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; - char * _arg7 = (char *) "staticBitmap"; + wxString * _arg7 = (wxString *) &wxPyStaticBitmapNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo3 = 0; @@ -8294,10 +8704,11 @@ static PyObject *_wrap_wxStaticBitmap_Create(PyObject *self, PyObject *args, PyO PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","bitmap","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxStaticBitmap_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxStaticBitmap_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_argo3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8331,14 +8742,24 @@ static PyObject *_wrap_wxStaticBitmap_Create(PyObject *self, PyObject *args, PyO _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxStaticBitmap_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxStaticBitmap_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -8492,7 +8913,7 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * int _arg7 = (int ) 0; long _arg8 = (long ) wxRA_HORIZONTAL; wxValidator * _arg9 = (wxValidator *) &wxDefaultValidator; - char * _arg10 = (char *) "radioBox"; + wxString * _arg10 = (wxString *) &wxPyRadioBoxNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; @@ -8501,11 +8922,12 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * PyObject * _obj4 = 0; PyObject * _obj6 = 0; PyObject * _argo9 = 0; + PyObject * _obj10 = 0; char *_kwnames[] = { "parent","id","label","point","size","choices","majorDimension","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOOilOs:new_wxRadioBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_obj6,&_arg7,&_arg8,&_argo9,&_arg10)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOOilOO:new_wxRadioBox",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_obj6,&_arg7,&_arg8,&_argo9,&_obj10)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8545,6 +8967,12 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj10) +{ + _arg10 = wxString_in_helper(_obj10); + if (_arg10 == NULL) + return NULL; +} { if (_obj6) { _arg5 = PyList_Size(_obj6); @@ -8555,7 +8983,7 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxRadioBox *)new_wxRadioBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8,*_arg9,_arg10); + _result = (wxRadioBox *)new_wxRadioBox(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8,*_arg9,*_arg10); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -8572,6 +9000,10 @@ static PyObject *_wrap_new_wxRadioBox(PyObject *self, PyObject *args, PyObject * } { delete [] _arg6; +} +{ + if (_obj10) + delete _arg10; } return _resultobj; } @@ -8617,7 +9049,7 @@ static PyObject *_wrap_wxRadioBox_Create(PyObject *self, PyObject *args, PyObjec int _arg8 = (int ) 0; long _arg9 = (long ) wxRA_HORIZONTAL; wxValidator * _arg10 = (wxValidator *) &wxDefaultValidator; - char * _arg11 = (char *) "radioBox"; + wxString * _arg11 = (wxString *) &wxPyRadioBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -8627,10 +9059,11 @@ static PyObject *_wrap_wxRadioBox_Create(PyObject *self, PyObject *args, PyObjec PyObject * _obj5 = 0; PyObject * _obj7 = 0; PyObject * _argo10 = 0; + PyObject * _obj11 = 0; char *_kwnames[] = { "self","parent","id","label","point","size","choices","majorDimension","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOOilOs:wxRadioBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_obj7,&_arg8,&_arg9,&_argo10,&_arg11)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOOilOO:wxRadioBox_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_obj7,&_arg8,&_arg9,&_argo10,&_obj11)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -8677,6 +9110,12 @@ static PyObject *_wrap_wxRadioBox_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj11) +{ + _arg11 = wxString_in_helper(_obj11); + if (_arg11 == NULL) + return NULL; +} { if (_obj7) { _arg6 = PyList_Size(_obj7); @@ -8687,7 +9126,7 @@ static PyObject *_wrap_wxRadioBox_Create(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxRadioBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9,*_arg10,_arg11); + _result = (bool )wxRadioBox_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9,*_arg10,*_arg11); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -8698,6 +9137,10 @@ static PyObject *_wrap_wxRadioBox_Create(PyObject *self, PyObject *args, PyObjec } { delete [] _arg7; +} +{ + if (_obj11) + delete _arg11; } return _resultobj; } @@ -9205,7 +9648,7 @@ static PyObject *_wrap_new_wxRadioButton(PyObject *self, PyObject *args, PyObjec wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "radioButton"; + wxString * _arg7 = (wxString *) &wxPyRadioButtonNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; @@ -9213,11 +9656,12 @@ static PyObject *_wrap_new_wxRadioButton(PyObject *self, PyObject *args, PyObjec wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxRadioButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOO:new_wxRadioButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9250,9 +9694,15 @@ static PyObject *_wrap_new_wxRadioButton(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxRadioButton *)new_wxRadioButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxRadioButton *)new_wxRadioButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -9266,6 +9716,10 @@ static PyObject *_wrap_new_wxRadioButton(PyObject *self, PyObject *args, PyObjec { if (_obj2) delete _arg2; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -9308,7 +9762,7 @@ static PyObject *_wrap_wxRadioButton_Create(PyObject *self, PyObject *args, PyOb wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "radioButton"; + wxString * _arg8 = (wxString *) &wxPyRadioButtonNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -9317,10 +9771,11 @@ static PyObject *_wrap_wxRadioButton_Create(PyObject *self, PyObject *args, PyOb wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOs:wxRadioButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOO:wxRadioButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9360,9 +9815,15 @@ static PyObject *_wrap_wxRadioButton_Create(PyObject *self, PyObject *args, PyOb return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxRadioButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxRadioButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -9370,6 +9831,10 @@ static PyObject *_wrap_wxRadioButton_Create(PyObject *self, PyObject *args, PyOb { if (_obj3) delete _arg3; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } @@ -9478,18 +9943,19 @@ static PyObject *_wrap_new_wxSlider(PyObject *self, PyObject *args, PyObject *kw wxSize * _arg6 = (wxSize *) &wxDefaultSize; long _arg7 = (long ) wxSL_HORIZONTAL; wxValidator * _arg8 = (wxValidator *) &wxDefaultValidator; - char * _arg9 = (char *) "slider"; + wxString * _arg9 = (wxString *) &wxPySliderNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj5 = 0; wxSize temp0; PyObject * _obj6 = 0; PyObject * _argo8 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "parent","id","value","minValue","maxValue","point","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|OOlOs:new_wxSlider",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_obj5,&_obj6,&_arg7,&_argo8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|OOlOO:new_wxSlider",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_obj5,&_obj6,&_arg7,&_argo8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9517,9 +9983,15 @@ static PyObject *_wrap_new_wxSlider(PyObject *self, PyObject *args, PyObject *kw return NULL; } } + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSlider *)new_wxSlider(_arg0,_arg1,_arg2,_arg3,_arg4,*_arg5,*_arg6,_arg7,*_arg8,_arg9); + _result = (wxSlider *)new_wxSlider(_arg0,_arg1,_arg2,_arg3,_arg4,*_arg5,*_arg6,_arg7,*_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -9530,6 +10002,10 @@ static PyObject *_wrap_new_wxSlider(PyObject *self, PyObject *args, PyObject *kw Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj9) + delete _arg9; +} return _resultobj; } @@ -9573,7 +10049,7 @@ static PyObject *_wrap_wxSlider_Create(PyObject *self, PyObject *args, PyObject wxSize * _arg7 = (wxSize *) &wxDefaultSize; long _arg8 = (long ) wxSL_HORIZONTAL; wxValidator * _arg9 = (wxValidator *) &wxDefaultValidator; - char * _arg10 = (char *) "slider"; + wxString * _arg10 = (wxString *) &wxPySliderNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -9581,10 +10057,11 @@ static PyObject *_wrap_wxSlider_Create(PyObject *self, PyObject *args, PyObject wxSize temp0; PyObject * _obj7 = 0; PyObject * _argo9 = 0; + PyObject * _obj10 = 0; char *_kwnames[] = { "self","parent","id","value","minValue","maxValue","point","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiiii|OOlOs:wxSlider_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_arg4,&_arg5,&_obj6,&_obj7,&_arg8,&_argo9,&_arg10)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiiii|OOlOO:wxSlider_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_arg4,&_arg5,&_obj6,&_obj7,&_arg8,&_argo9,&_obj10)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9619,13 +10096,23 @@ static PyObject *_wrap_wxSlider_Create(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj10) +{ + _arg10 = wxString_in_helper(_obj10); + if (_arg10 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSlider_Create(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,*_arg6,*_arg7,_arg8,*_arg9,_arg10); + _result = (bool )wxSlider_Create(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,*_arg6,*_arg7,_arg8,*_arg9,*_arg10); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj10) + delete _arg10; +} return _resultobj; } @@ -10218,24 +10705,26 @@ static PyObject *_wrap_new_wxSpinCtrl(PyObject *self, PyObject *args, PyObject * wxSpinCtrl * _result; wxWindow * _arg0; wxWindowID _arg1 = (wxWindowID ) -1; - char * _arg2 = (char *) ""; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxSP_ARROW_KEYS; int _arg6 = (int ) 0; int _arg7 = (int ) 100; int _arg8 = (int ) 0; - char * _arg9 = (char *) "wxSpinCtrl"; + wxString * _arg9 = (wxString *) &wxPySpinCtrlNameStr; PyObject * _argo0 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "parent","id","value","pos","size","style","min","max","initial","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|isOOliiis:new_wxSpinCtrl",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_arg7,&_arg8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOOliiiO:new_wxSpinCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6,&_arg7,&_arg8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10244,6 +10733,12 @@ static PyObject *_wrap_new_wxSpinCtrl(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj3) { _arg3 = &temp; @@ -10255,10 +10750,16 @@ static PyObject *_wrap_new_wxSpinCtrl(PyObject *self, PyObject *args, PyObject * _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSpinCtrl *)new_wxSpinCtrl(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8,_arg9); + _result = (wxSpinCtrl *)new_wxSpinCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -10269,6 +10770,14 @@ static PyObject *_wrap_new_wxSpinCtrl(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj9) + delete _arg9; +} return _resultobj; } @@ -10305,24 +10814,26 @@ static PyObject *_wrap_wxSpinCtrl_Create(PyObject *self, PyObject *args, PyObjec wxSpinCtrl * _arg0; wxWindow * _arg1; wxWindowID _arg2 = (wxWindowID ) -1; - char * _arg3 = (char *) ""; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxSP_ARROW_KEYS; int _arg7 = (int ) 0; int _arg8 = (int ) 100; int _arg9 = (int ) 0; - char * _arg10 = (char *) "wxSpinCtrl"; + wxString * _arg10 = (wxString *) &wxPySpinCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj10 = 0; char *_kwnames[] = { "self","parent","id","value","pos","size","style","min","max","initial","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|isOOliiis:wxSpinCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_arg7,&_arg8,&_arg9,&_arg10)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOOliiiO:wxSpinCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7,&_arg8,&_arg9,&_obj10)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10338,6 +10849,12 @@ static PyObject *_wrap_wxSpinCtrl_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -10349,14 +10866,28 @@ static PyObject *_wrap_wxSpinCtrl_Create(PyObject *self, PyObject *args, PyObjec _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj10) +{ + _arg10 = wxString_in_helper(_obj10); + if (_arg10 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSpinCtrl_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9,_arg10); + _result = (bool )wxSpinCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9,*_arg10); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj10) + delete _arg10; +} return _resultobj; } @@ -10546,7 +11077,7 @@ static PyObject *_wrap_new_wxToggleButton(PyObject *self, PyObject *args, PyObje wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "toggle"; + wxString * _arg7 = (wxString *) &wxPyCheckBoxNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; @@ -10554,11 +11085,12 @@ static PyObject *_wrap_new_wxToggleButton(PyObject *self, PyObject *args, PyObje wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "parent","id","label","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxToggleButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOO:new_wxToggleButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10591,9 +11123,15 @@ static PyObject *_wrap_new_wxToggleButton(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxToggleButton *)new_wxToggleButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (wxToggleButton *)new_wxToggleButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -10607,6 +11145,10 @@ static PyObject *_wrap_new_wxToggleButton(PyObject *self, PyObject *args, PyObje { if (_obj2) delete _arg2; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -10649,7 +11191,7 @@ static PyObject *_wrap_wxToggleButton_Create(PyObject *self, PyObject *args, PyO wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) 0; wxValidator * _arg7 = (wxValidator *) &wxDefaultValidator; - char * _arg8 = (char *) "toggle"; + wxString * _arg8 = (wxString *) &wxPyCheckBoxNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -10658,10 +11200,11 @@ static PyObject *_wrap_wxToggleButton_Create(PyObject *self, PyObject *args, PyO wxSize temp0; PyObject * _obj5 = 0; PyObject * _argo7 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "self","parent","id","label","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOs:wxToggleButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlOO:wxToggleButton_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_argo7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10701,9 +11244,15 @@ static PyObject *_wrap_wxToggleButton_Create(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxToggleButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8); + _result = (bool )wxToggleButton_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -10711,6 +11260,10 @@ static PyObject *_wrap_wxToggleButton_Create(PyObject *self, PyObject *args, PyO { if (_obj3) delete _arg3; +} +{ + if (_obj8) + delete _arg8; } return _resultobj; } diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index 73aa999456..710194fcb2 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -90,6 +90,16 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + const wxChar* wxListCtrlNameStr = _T("wxListCtrl"); + DECLARE_DEF_STRING(ListCtrlNameStr); + + const wxChar* wx_TreeCtrlNameStr = _T("wxListCtrl"); + DECLARE_DEF_STRING(_TreeCtrlNameStr); + DECLARE_DEF_STRING(DirDialogDefaultFolderStr); + + static const wxString wxPyEmptyString(wxT("")); // C++ Version of a Python aware class class wxPyListCtrl : public wxListCtrl { DECLARE_ABSTRACT_CLASS(wxPyListCtrl); @@ -100,7 +110,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) : + const wxString& name) : wxListCtrl(parent, id, pos, size, style, validator, name) {} bool Create(wxWindow* parent, wxWindowID id, @@ -108,7 +118,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) { + const wxString& name) { return wxListCtrl::Create(parent, id, pos, size, style, validator, name); } @@ -183,7 +193,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) : + const wxString& name) : wxTreeCtrl(parent, id, pos, size, style, validator, name) {} bool Create(wxWindow *parent, wxWindowID id, @@ -191,7 +201,7 @@ public: const wxSize& size, long style, const wxValidator& validator, - char* name) { + const wxString& name) { return wxTreeCtrl::Create(parent, id, pos, size, style, validator, name); } @@ -2912,18 +2922,19 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) (wxLC_ICON); wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; - char * _arg6 = (char *) "listCtrl"; + wxString * _arg6 = (wxString *) &wxPyListCtrlNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; PyObject * _argo5 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOs:new_wxListCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOO:new_wxListCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2951,9 +2962,15 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPyListCtrl *)new_wxListCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); + _result = (wxPyListCtrl *)new_wxListCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2964,6 +2981,10 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -3004,7 +3025,7 @@ static PyObject *_wrap_wxListCtrl_Create(PyObject *self, PyObject *args, PyObjec wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxLC_ICON); wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "listCtrl"; + wxString * _arg7 = (wxString *) &wxPyListCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -3012,10 +3033,11 @@ static PyObject *_wrap_wxListCtrl_Create(PyObject *self, PyObject *args, PyObjec wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOs:wxListCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOO:wxListCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3050,13 +3072,23 @@ static PyObject *_wrap_wxListCtrl_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxListCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (bool )wxListCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -5105,7 +5137,7 @@ static PyObject *_wrap_new_wxListView(PyObject *self, PyObject *args, PyObject * wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) (wxLC_REPORT); wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; - wxString * _arg6 = (wxString *) &"listctrl"; + wxString * _arg6 = (wxString *) &wxPyListCtrlNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; @@ -5208,7 +5240,7 @@ static PyObject *_wrap_wxListView_Create(PyObject *self, PyObject *args, PyObjec wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxLC_REPORT); wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - wxString * _arg7 = (wxString *) &"listctrl"; + wxString * _arg7 = (wxString *) &wxPyListCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -6434,18 +6466,19 @@ static PyObject *_wrap_new_wxTreeCtrl(PyObject *self, PyObject *args, PyObject * wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) (wxTR_HAS_BUTTONS)|(wxTR_LINES_AT_ROOT); wxValidator * _arg5 = (wxValidator *) &wxDefaultValidator; - char * _arg6 = (char *) "wxTreeCtrl"; + wxString * _arg6 = (wxString *) &wxPy_TreeCtrlNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; PyObject * _argo5 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","pos","size","style","validator","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOs:new_wxTreeCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOO:new_wxTreeCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6473,9 +6506,15 @@ static PyObject *_wrap_new_wxTreeCtrl(PyObject *self, PyObject *args, PyObject * return NULL; } } + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPyTreeCtrl *)new_wxTreeCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); + _result = (wxPyTreeCtrl *)new_wxTreeCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -6486,6 +6525,10 @@ static PyObject *_wrap_new_wxTreeCtrl(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -6526,7 +6569,7 @@ static PyObject *_wrap_wxTreeCtrl_Create(PyObject *self, PyObject *args, PyObjec wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxTR_HAS_BUTTONS)|(wxTR_LINES_AT_ROOT); wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; - char * _arg7 = (char *) "wxTreeCtrl"; + wxString * _arg7 = (wxString *) &wxPy_TreeCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; @@ -6534,10 +6577,11 @@ static PyObject *_wrap_wxTreeCtrl_Create(PyObject *self, PyObject *args, PyObjec wxSize temp0; PyObject * _obj4 = 0; PyObject * _argo6 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","validator","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOs:wxTreeCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlOO:wxTreeCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_argo6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6572,13 +6616,23 @@ static PyObject *_wrap_wxTreeCtrl_Create(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxTreeCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + _result = (bool )wxTreeCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj7) + delete _arg7; +} return _resultobj; } @@ -9791,23 +9845,26 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb wxGenericDirCtrl * _result; wxWindow * _arg0; wxWindowID _arg1 = (wxWindowID ) -1; - char * _arg2 = (char *) wxDirDialogDefaultFolderStr; + wxString * _arg2 = (wxString *) &wxPyDirDialogDefaultFolderStr; wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxDIRCTRL_3D_INTERNAL)|wxSUNKEN_BORDER; - char * _arg6 = (char *) wxEmptyString; + wxString * _arg6 = (wxString *) &wxPyEmptyString; int _arg7 = (int ) 0; - char * _arg8 = (char *) "dirCtrl"; + wxString * _arg8 = (wxString *) &wxPy_TreeCtrlNameStr; PyObject * _argo0 = 0; + PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; + PyObject * _obj8 = 0; char *_kwnames[] = { "parent","id","dir","pos","size","style","filter","defaultFilter","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|isOOlsis:new_wxGenericDirCtrl",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_arg7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOOlOiO:new_wxGenericDirCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6,&_arg7,&_obj8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9816,6 +9873,12 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_obj3) { _arg3 = &temp; @@ -9827,10 +9890,22 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} + if (_obj8) +{ + _arg8 = wxString_in_helper(_obj8); + if (_arg8 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGenericDirCtrl *)new_wxGenericDirCtrl(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8); + _result = (wxGenericDirCtrl *)new_wxGenericDirCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -9841,6 +9916,18 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj6) + delete _arg6; +} +{ + if (_obj8) + delete _arg8; +} return _resultobj; } @@ -9877,23 +9964,26 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P wxGenericDirCtrl * _arg0; wxWindow * _arg1; wxWindowID _arg2 = (wxWindowID ) -1; - char * _arg3 = (char *) wxDirDialogDefaultFolderStr; + wxString * _arg3 = (wxString *) &wxPyDirDialogDefaultFolderStr; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) (wxDIRCTRL_3D_INTERNAL)|wxSUNKEN_BORDER; - char * _arg7 = (char *) wxEmptyString; + wxString * _arg7 = (wxString *) &wxPyEmptyString; int _arg8 = (int ) 0; - char * _arg9 = (char *) "dirCtrl"; + wxString * _arg9 = (wxString *) &wxPy_TreeCtrlNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; + PyObject * _obj9 = 0; char *_kwnames[] = { "self","parent","id","dir","pos","size","style","filter","defaultFilter","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|isOOlsis:wxGenericDirCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_arg7,&_arg8,&_arg9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOOlOiO:wxGenericDirCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7,&_arg8,&_obj9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9909,6 +9999,12 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} if (_obj4) { _arg4 = &temp; @@ -9920,14 +10016,38 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; +} + if (_obj9) +{ + _arg9 = wxString_in_helper(_obj9); + if (_arg9 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxGenericDirCtrl_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9); + _result = (bool )wxGenericDirCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8,*_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj7) + delete _arg7; +} +{ + if (_obj9) + delete _arg9; +} return _resultobj; } diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index a0f69d2014..b08e89e857 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -85,6 +85,12 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FrameNameStr); + DECLARE_DEF_STRING(DialogNameStr); + DECLARE_DEF_STRING(StatusLineNameStr); + DECLARE_DEF_STRING(ToolBarNameStr); #ifdef __cplusplus extern "C" { #endif @@ -122,18 +128,19 @@ static PyObject *_wrap_new_wxTopLevelWindow(PyObject *self, PyObject *args, PyOb wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxTopLevelWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxTopLevelWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -158,10 +165,16 @@ static PyObject *_wrap_new_wxTopLevelWindow(PyObject *self, PyObject *args, PyOb _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxTopLevelWindow *)new_wxTopLevelWindow(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxTopLevelWindow *)new_wxTopLevelWindow(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -175,6 +188,10 @@ static PyObject *_wrap_new_wxTopLevelWindow(PyObject *self, PyObject *args, PyOb { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -216,7 +233,7 @@ static PyObject *_wrap_wxTopLevelWindow_Create(PyObject *self, PyObject *args, P wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg7 = (char *) "frame"; + wxString * _arg7 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -224,10 +241,11 @@ static PyObject *_wrap_wxTopLevelWindow_Create(PyObject *self, PyObject *args, P PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxTopLevelWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxTopLevelWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -259,10 +277,16 @@ static PyObject *_wrap_wxTopLevelWindow_Create(PyObject *self, PyObject *args, P _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxTopLevelWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxTopLevelWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -270,6 +294,10 @@ static PyObject *_wrap_wxTopLevelWindow_Create(PyObject *self, PyObject *args, P { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -665,18 +693,19 @@ static PyObject *_wrap_new_wxFrame(PyObject *self, PyObject *args, PyObject *kwa wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -701,10 +730,16 @@ static PyObject *_wrap_new_wxFrame(PyObject *self, PyObject *args, PyObject *kwa _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxFrame *)new_wxFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxFrame *)new_wxFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -718,6 +753,10 @@ static PyObject *_wrap_new_wxFrame(PyObject *self, PyObject *args, PyObject *kwa { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -759,7 +798,7 @@ static PyObject *_wrap_wxFrame_Create(PyObject *self, PyObject *args, PyObject * wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg7 = (char *) "frame"; + wxString * _arg7 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -767,10 +806,11 @@ static PyObject *_wrap_wxFrame_Create(PyObject *self, PyObject *args, PyObject * PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -802,10 +842,16 @@ static PyObject *_wrap_wxFrame_Create(PyObject *self, PyObject *args, PyObject * _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -813,6 +859,10 @@ static PyObject *_wrap_wxFrame_Create(PyObject *self, PyObject *args, PyObject * { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -978,12 +1028,13 @@ static PyObject *_wrap_wxFrame_CreateStatusBar(PyObject *self, PyObject *args, P int _arg1 = (int ) 1; long _arg2 = (long ) wxST_SIZEGRIP; wxWindowID _arg3 = (wxWindowID ) -1; - char * _arg4 = (char *) "statusBar"; + wxString * _arg4 = (wxString *) &wxPyStatusLineNameStr; PyObject * _argo0 = 0; + PyObject * _obj4 = 0; char *_kwnames[] = { "self","number","style","id","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ilis:wxFrame_CreateStatusBar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iliO:wxFrame_CreateStatusBar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -992,13 +1043,23 @@ static PyObject *_wrap_wxFrame_CreateStatusBar(PyObject *self, PyObject *args, P return NULL; } } + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStatusBar *)wxFrame_CreateStatusBar(_arg0,_arg1,_arg2,_arg3,_arg4); + _result = (wxStatusBar *)wxFrame_CreateStatusBar(_arg0,_arg1,_arg2,_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj4) + delete _arg4; +} return _resultobj; } @@ -1163,12 +1224,13 @@ static PyObject *_wrap_wxFrame_CreateToolBar(PyObject *self, PyObject *args, PyO wxFrame * _arg0; long _arg1 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; wxWindowID _arg2 = (wxWindowID ) -1; - char * _arg3 = (char *) "toolBar"; + wxString * _arg3 = (wxString *) &wxPyToolBarNameStr; PyObject * _argo0 = 0; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","style","id","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|lis:wxFrame_CreateToolBar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|liO:wxFrame_CreateToolBar",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1177,13 +1239,23 @@ static PyObject *_wrap_wxFrame_CreateToolBar(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxToolBar *)wxFrame_CreateToolBar(_arg0,_arg1,_arg2,_arg3); + _result = (wxToolBar *)wxFrame_CreateToolBar(_arg0,_arg1,_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; }{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -1294,18 +1366,19 @@ static PyObject *_wrap_new_wxDialog(PyObject *self, PyObject *args, PyObject *kw wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_DIALOG_STYLE; - char * _arg6 = (char *) "dialogBox"; + wxString * _arg6 = (wxString *) &wxPyDialogNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxDialog",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxDialog",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1330,10 +1403,16 @@ static PyObject *_wrap_new_wxDialog(PyObject *self, PyObject *args, PyObject *kw _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxDialog *)new_wxDialog(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxDialog *)new_wxDialog(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1347,6 +1426,10 @@ static PyObject *_wrap_new_wxDialog(PyObject *self, PyObject *args, PyObject *kw { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -1388,7 +1471,7 @@ static PyObject *_wrap_wxDialog_Create(PyObject *self, PyObject *args, PyObject wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_DIALOG_STYLE; - char * _arg7 = (char *) "dialogBox"; + wxString * _arg7 = (wxString *) &wxPyDialogNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -1396,10 +1479,11 @@ static PyObject *_wrap_wxDialog_Create(PyObject *self, PyObject *args, PyObject PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxDialog_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxDialog_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1431,10 +1515,16 @@ static PyObject *_wrap_wxDialog_Create(PyObject *self, PyObject *args, PyObject _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxDialog_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxDialog_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1442,6 +1532,10 @@ static PyObject *_wrap_wxDialog_Create(PyObject *self, PyObject *args, PyObject { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -1766,18 +1860,19 @@ static PyObject *_wrap_new_wxMiniFrame(PyObject *self, PyObject *args, PyObject wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxMiniFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxMiniFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1802,10 +1897,16 @@ static PyObject *_wrap_new_wxMiniFrame(PyObject *self, PyObject *args, PyObject _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxMiniFrame *)new_wxMiniFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxMiniFrame *)new_wxMiniFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1819,6 +1920,10 @@ static PyObject *_wrap_new_wxMiniFrame(PyObject *self, PyObject *args, PyObject { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -1860,7 +1965,7 @@ static PyObject *_wrap_wxMiniFrame_Create(PyObject *self, PyObject *args, PyObje wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg7 = (char *) "frame"; + wxString * _arg7 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -1868,10 +1973,11 @@ static PyObject *_wrap_wxMiniFrame_Create(PyObject *self, PyObject *args, PyObje PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxMiniFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxMiniFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1903,10 +2009,16 @@ static PyObject *_wrap_wxMiniFrame_Create(PyObject *self, PyObject *args, PyObje _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxMiniFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxMiniFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1914,6 +2026,10 @@ static PyObject *_wrap_wxMiniFrame_Create(PyObject *self, PyObject *args, PyObje { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 2a6d42a641..2d804439da 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -89,6 +89,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); // Implementations of some alternate "constructors" wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) { @@ -3867,7 +3870,7 @@ static PyObject *_wrap_wxFontMapper_GetAltForEncoding(PyObject *self, PyObject * PyObject * _result; wxFontMapper * _arg0; wxFontEncoding _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; bool _arg3 = (bool ) TRUE; PyObject * _argo0 = 0; PyObject * _obj2 = 0; @@ -3913,7 +3916,7 @@ static PyObject *_wrap_wxFontMapper_IsEncodingAvailable(PyObject *self, PyObject bool _result; wxFontMapper * _arg0; wxFontEncoding _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; char *_kwnames[] = { "self","encoding","facename", NULL }; @@ -4200,7 +4203,7 @@ static PyObject *_wrap_wxFontMapper_SetConfigPath(PyObject *self, PyObject *args static PyObject *_wrap_wxFontMapper_GetDefaultConfigPath(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; char *_kwnames[] = { NULL }; self = self; @@ -4208,11 +4211,20 @@ static PyObject *_wrap_wxFontMapper_GetDefaultConfigPath(PyObject *self, PyObjec return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxFontMapper::GetDefaultConfigPath(); + _result = new wxString (wxFontMapper::GetDefaultConfigPath()); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} return _resultobj; } @@ -4241,17 +4253,24 @@ static PyObject *_wrap_new_wxFont(PyObject *self, PyObject *args, PyObject *kwar int _arg2; int _arg3; int _arg4 = (int ) FALSE; - char * _arg5 = (char *) ""; + wxString * _arg5 = (wxString *) &wxPyEmptyString; wxFontEncoding _arg6 = (wxFontEncoding ) (wxFONTENCODING_DEFAULT); + PyObject * _obj5 = 0; char *_kwnames[] = { "pointSize","family","style","weight","underline","faceName","encoding", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iiii|isi:new_wxFont",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iiii|iOi:new_wxFont",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_obj5,&_arg6)) + return NULL; + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6); + _result = (wxFont *)new_wxFont(_arg0,_arg1,_arg2,_arg3,_arg4,*_arg5,_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -4262,6 +4281,10 @@ static PyObject *_wrap_new_wxFont(PyObject *self, PyObject *args, PyObject *kwar Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -5192,15 +5215,16 @@ static PyObject *_wrap_wxFontList_FindOrCreateFont(PyObject *self, PyObject *arg int _arg3; int _arg4; bool _arg5 = (bool ) FALSE; - char * _arg6 = (char *) NULL; + wxString * _arg6 = (wxString *) &wxPyEmptyString; wxFontEncoding _arg7 = (wxFontEncoding ) (wxFONTENCODING_DEFAULT); PyObject * _argo0 = 0; int tempbool5 = (int) FALSE; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","point_size","family","style","weight","underline","facename","encoding", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|isi:wxFontList_FindOrCreateFont",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&tempbool5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oiiii|iOi:wxFontList_FindOrCreateFont",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&tempbool5,&_obj6,&_arg7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5210,9 +5234,15 @@ static PyObject *_wrap_wxFontList_FindOrCreateFont(PyObject *self, PyObject *arg } } _arg5 = (bool ) tempbool5; + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxFont *)wxFontList_FindOrCreateFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7); + _result = (wxFont *)wxFontList_FindOrCreateFont(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,*_arg6,_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5223,6 +5253,10 @@ static PyObject *_wrap_wxFontList_FindOrCreateFont(PyObject *self, PyObject *arg Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -10923,7 +10957,7 @@ static void *SwigwxMetaFileTowxObject(void *ptr) { static PyObject *_wrap_new_wxMetaFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMetaFile * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "filename", NULL }; char _ptemp[128]; @@ -11184,10 +11218,10 @@ static void *SwigwxMetaFileDCTowxObject(void *ptr) { static PyObject *_wrap_new_wxMetaFileDC(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMetaFileDC * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; int _arg1 = (int ) 0; int _arg2 = (int ) 0; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; PyObject * _obj3 = 0; char *_kwnames[] = { "filename","width","height","description", NULL }; diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index fa647926d9..1fbab3b304 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -86,6 +86,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(PanelNameStr); + #define PYCALLBACK_GCA_INTINTKIND(PCLASS, CBNAME) \ wxGridCellAttr* CBNAME(int a, int b, wxGridCellAttr::wxAttrKind c) { \ wxGridCellAttr* rval = NULL; \ @@ -7021,17 +7024,18 @@ static PyObject *_wrap_new_wxGrid(PyObject *self, PyObject *args, PyObject *kwar wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxWANTS_CHARS; - char * _arg5 = (char *) wxPanelNameStr; + wxString * _arg5 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxGrid",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxGrid",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -7051,10 +7055,16 @@ static PyObject *_wrap_new_wxGrid(PyObject *self, PyObject *args, PyObject *kwar _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGrid *)new_wxGrid(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxGrid *)new_wxGrid(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7065,6 +7075,10 @@ static PyObject *_wrap_new_wxGrid(PyObject *self, PyObject *args, PyObject *kwar Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index 22ba041e14..ddc7380854 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -92,6 +92,18 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxHtmlWindowNameStr = wxT("htmlWindow"); + DECLARE_DEF_STRING(HtmlWindowNameStr); + + static const wxChar* wxHtmlPrintoutTitleStr = wxT("Printout"); + DECLARE_DEF_STRING(HtmlPrintoutTitleStr); + + static const wxChar* wxHtmlPrintingTitleStr = wxT("Printing"); + DECLARE_DEF_STRING(HtmlPrintingTitleStr); + + static const wxString wxPyEmptyString(wxT("")); + class wxPyHtmlTagHandler : public wxHtmlTagHandler { DECLARE_DYNAMIC_CLASS(wxPyHtmlTagHandler); public: @@ -347,7 +359,7 @@ static PyObject *_wrap_new_wxHtmlLinkInfo(PyObject *self, PyObject *args, PyObje PyObject * _resultobj; wxHtmlLinkInfo * _result; wxString * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "href","target", NULL }; @@ -4047,17 +4059,18 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; int _arg4 = (int ) (wxHW_SCROLLBAR_AUTO); - char * _arg5 = (char *) "htmlWindow"; + wxString * _arg5 = (wxString *) &wxPyHtmlWindowNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","flags","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOis:new_wxHtmlWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOiO:new_wxHtmlWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4077,10 +4090,16 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPyHtmlWindow *)new_wxHtmlWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxPyHtmlWindow *)new_wxHtmlWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -4091,6 +4110,10 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -4130,17 +4153,18 @@ static PyObject *_wrap_wxHtmlWindow_Create(PyObject *self, PyObject *args, PyObj wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; int _arg5 = (int ) (wxHW_SCROLLBAR_AUTO); - char * _arg6 = (char *) "htmlWindow"; + wxString * _arg6 = (wxString *) &wxPyHtmlWindowNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","flags","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOis:wxHtmlWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOiO:wxHtmlWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4167,14 +4191,24 @@ static PyObject *_wrap_wxHtmlWindow_Create(PyObject *self, PyObject *args, PyObj _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxHtmlWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxHtmlWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -4449,13 +4483,14 @@ static PyObject *_wrap_wxHtmlWindow_SetRelatedFrame(PyObject *self, PyObject *ar PyObject * _resultobj; wxPyHtmlWindow * _arg0; wxFrame * _arg1; - char * _arg2; + wxString * _arg2; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","frame","format", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOs:wxHtmlWindow_SetRelatedFrame",_kwnames,&_argo0,&_argo1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxHtmlWindow_SetRelatedFrame",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4471,14 +4506,23 @@ static PyObject *_wrap_wxHtmlWindow_SetRelatedFrame(PyObject *self, PyObject *ar return NULL; } } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxHtmlWindow_SetRelatedFrame(_arg0,_arg1,_arg2); + wxHtmlWindow_SetRelatedFrame(_arg0,_arg1,*_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} return _resultobj; } @@ -4673,7 +4717,7 @@ static PyObject *_wrap_wxHtmlWindow_ReadCustomization(PyObject *self, PyObject * PyObject * _resultobj; wxPyHtmlWindow * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -4722,7 +4766,7 @@ static PyObject *_wrap_wxHtmlWindow_WriteCustomization(PyObject *self, PyObject PyObject * _resultobj; wxPyHtmlWindow * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -5095,12 +5139,13 @@ static PyObject *_wrap_wxHtmlWindow_base_OnLinkClicked(PyObject *self, PyObject static PyObject *_wrap_wxHtmlWindow_base_OnSetTitle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyHtmlWindow * _arg0; - char * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","title", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxHtmlWindow_base_OnSetTitle",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlWindow_base_OnSetTitle",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5109,14 +5154,23 @@ static PyObject *_wrap_wxHtmlWindow_base_OnSetTitle(PyObject *self, PyObject *ar return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxHtmlWindow_base_OnSetTitle(_arg0,_arg1); + wxHtmlWindow_base_OnSetTitle(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -5342,7 +5396,7 @@ static PyObject *_wrap_wxHtmlDCRenderer_SetHtmlText(PyObject *self, PyObject *ar PyObject * _resultobj; wxHtmlDCRenderer * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; bool _arg3 = (bool ) TRUE; PyObject * _argo0 = 0; PyObject * _obj1 = 0; @@ -5471,16 +5525,23 @@ static void *SwigwxHtmlPrintoutTowxObject(void *ptr) { static PyObject *_wrap_new_wxHtmlPrintout(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlPrintout * _result; - char * _arg0 = (char *) "Printout"; + wxString * _arg0 = (wxString *) &wxPyHtmlPrintoutTitleStr; + PyObject * _obj0 = 0; char *_kwnames[] = { "title", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|s:new_wxHtmlPrintout",_kwnames,&_arg0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxHtmlPrintout",_kwnames,&_obj0)) return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxHtmlPrintout *)new_wxHtmlPrintout(_arg0); + _result = (wxHtmlPrintout *)new_wxHtmlPrintout(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5491,6 +5552,10 @@ static PyObject *_wrap_new_wxHtmlPrintout(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj0) + delete _arg0; +} return _resultobj; } @@ -5499,7 +5564,7 @@ static PyObject *_wrap_wxHtmlPrintout_SetHtmlText(PyObject *self, PyObject *args PyObject * _resultobj; wxHtmlPrintout * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; bool _arg3 = (bool ) TRUE; PyObject * _argo0 = 0; PyObject * _obj1 = 0; @@ -5712,15 +5777,22 @@ static void *SwigwxHtmlEasyPrintingTowxObject(void *ptr) { static PyObject *_wrap_new_wxHtmlEasyPrinting(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlEasyPrinting * _result; - char * _arg0 = (char *) "Printing"; + wxString * _arg0 = (wxString *) &wxPyHtmlPrintingTitleStr; wxFrame * _arg1 = (wxFrame *) NULL; + PyObject * _obj0 = 0; PyObject * _argo1 = 0; char *_kwnames[] = { "name","parent_frame", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|sO:new_wxHtmlEasyPrinting",_kwnames,&_arg0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OO:new_wxHtmlEasyPrinting",_kwnames,&_obj0,&_argo1)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; +} if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFrame_p")) { @@ -5730,7 +5802,7 @@ static PyObject *_wrap_new_wxHtmlEasyPrinting(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxHtmlEasyPrinting *)new_wxHtmlEasyPrinting(_arg0,_arg1); + _result = (wxHtmlEasyPrinting *)new_wxHtmlEasyPrinting(*_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5741,6 +5813,10 @@ static PyObject *_wrap_new_wxHtmlEasyPrinting(PyObject *self, PyObject *args, Py Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj0) + delete _arg0; +} return _resultobj; } @@ -5816,7 +5892,7 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PreviewText(PyObject *self, PyObject * PyObject * _resultobj; wxHtmlEasyPrinting * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -5906,7 +5982,7 @@ static PyObject *_wrap_wxHtmlEasyPrinting_PrintText(PyObject *self, PyObject *ar PyObject * _resultobj; wxHtmlEasyPrinting * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index 2f981d5b21..2001d1d852 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -63,6 +63,9 @@ extern PyObject *SWIG_newvarlink(void); #include #include + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -569,36 +572,36 @@ static PyObject *_wrap_wxHtmlBookRecord_GetFullPath(PyObject *self, PyObject *ar return _resultobj; } -#define wxHtmlContentsItem_m_Level_get(_swigobj) ((short ) _swigobj->m_Level) -static PyObject *_wrap_wxHtmlContentsItem_m_Level_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static int wxHtmlContentsItem_GetLevel(wxHtmlContentsItem *self) { return self->m_Level; } +static PyObject *_wrap_wxHtmlContentsItem_GetLevel(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - short _result; + int _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Level_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetLevel",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Level_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetLevel. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (short )wxHtmlContentsItem_m_Level_get(_arg0); + _result = (int )wxHtmlContentsItem_GetLevel(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("h",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxHtmlContentsItem_m_ID_get(_swigobj) ((int ) _swigobj->m_ID) -static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static int wxHtmlContentsItem_GetID(wxHtmlContentsItem *self) { return self->m_ID; } +static PyObject *_wrap_wxHtmlContentsItem_GetID(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; wxHtmlContentsItem * _arg0; @@ -606,18 +609,18 @@ static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *arg char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_ID_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetID",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_ID_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetID. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (int )wxHtmlContentsItem_m_ID_get(_arg0); + _result = (int )wxHtmlContentsItem_GetID(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -625,64 +628,82 @@ static PyObject *_wrap_wxHtmlContentsItem_m_ID_get(PyObject *self, PyObject *arg return _resultobj; } -#define wxHtmlContentsItem_m_Name_get(_swigobj) ((wxChar *) _swigobj->m_Name) -static PyObject *_wrap_wxHtmlContentsItem_m_Name_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxString wxHtmlContentsItem_GetName(wxHtmlContentsItem *self) { return self->m_Name; } +static PyObject *_wrap_wxHtmlContentsItem_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Name_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetName",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Name_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetName. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxHtmlContentsItem_m_Name_get(_arg0); + _result = new wxString (wxHtmlContentsItem_GetName(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} return _resultobj; } -#define wxHtmlContentsItem_m_Page_get(_swigobj) ((wxChar *) _swigobj->m_Page) -static PyObject *_wrap_wxHtmlContentsItem_m_Page_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxString wxHtmlContentsItem_GetPage(wxHtmlContentsItem *self) { return self->m_Page; } +static PyObject *_wrap_wxHtmlContentsItem_GetPage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; wxHtmlContentsItem * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Page_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetPage",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Page_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetPage. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxHtmlContentsItem_m_Page_get(_arg0); + _result = new wxString (wxHtmlContentsItem_GetPage(_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + delete _result; +} return _resultobj; } -#define wxHtmlContentsItem_m_Book_get(_swigobj) ((wxHtmlBookRecord *) _swigobj->m_Book) -static PyObject *_wrap_wxHtmlContentsItem_m_Book_get(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxHtmlBookRecord * wxHtmlContentsItem_GetBook(wxHtmlContentsItem *self) { return self->m_Book; } +static PyObject *_wrap_wxHtmlContentsItem_GetBook(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlBookRecord * _result; wxHtmlContentsItem * _arg0; @@ -691,18 +712,18 @@ static PyObject *_wrap_wxHtmlContentsItem_m_Book_get(PyObject *self, PyObject *a char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_m_Book_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlContentsItem_GetBook",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlContentsItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_m_Book_get. Expected _wxHtmlContentsItem_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlContentsItem_GetBook. Expected _wxHtmlContentsItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxHtmlBookRecord *)wxHtmlContentsItem_m_Book_get(_arg0); + _result = (wxHtmlBookRecord *)wxHtmlContentsItem_GetBook(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1324,7 +1345,7 @@ static PyObject *_wrap_new_wxHtmlHelpFrame(PyObject *self, PyObject *args, PyObj wxHtmlHelpFrame * _result; wxWindow * _arg0; int _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; int _arg3 = (int ) wxHF_DEFAULTSTYLE; wxHtmlHelpData * _arg4 = (wxHtmlHelpData *) NULL; PyObject * _argo0 = 0; @@ -1618,7 +1639,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_UseConfig(PyObject *self, PyObject *args, PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -1667,7 +1688,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_ReadCustomization(PyObject *self, PyObjec PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -1716,7 +1737,7 @@ static PyObject *_wrap_wxHtmlHelpFrame_WriteCustomization(PyObject *self, PyObje PyObject * _resultobj; wxHtmlHelpFrame * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2117,7 +2138,7 @@ static PyObject *_wrap_wxHtmlHelpController_UseConfig(PyObject *self, PyObject * PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2166,7 +2187,7 @@ static PyObject *_wrap_wxHtmlHelpController_ReadCustomization(PyObject *self, Py PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2215,7 +2236,7 @@ static PyObject *_wrap_wxHtmlHelpController_WriteCustomization(PyObject *self, P PyObject * _resultobj; wxHtmlHelpController * _arg0; wxConfigBase * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -2337,11 +2358,11 @@ static PyMethodDef htmlhelpcMethods[] = { { "wxHtmlSearchStatus_GetCurIndex", (PyCFunction) _wrap_wxHtmlSearchStatus_GetCurIndex, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlSearchStatus_IsActive", (PyCFunction) _wrap_wxHtmlSearchStatus_IsActive, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlSearchStatus_Search", (PyCFunction) _wrap_wxHtmlSearchStatus_Search, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Book_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Book_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Page_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Page_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Name_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Name_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_ID_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_ID_get, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlContentsItem_m_Level_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Level_get, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetBook", (PyCFunction) _wrap_wxHtmlContentsItem_GetBook, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetPage", (PyCFunction) _wrap_wxHtmlContentsItem_GetPage, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetName", (PyCFunction) _wrap_wxHtmlContentsItem_GetName, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetID", (PyCFunction) _wrap_wxHtmlContentsItem_GetID, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlContentsItem_GetLevel", (PyCFunction) _wrap_wxHtmlContentsItem_GetLevel, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetFullPath", (PyCFunction) _wrap_wxHtmlBookRecord_GetFullPath, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_SetStart", (PyCFunction) _wrap_wxHtmlBookRecord_SetStart, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_SetBasePath", (PyCFunction) _wrap_wxHtmlBookRecord_SetBasePath, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/htmlhelp.py b/wxPython/src/msw/htmlhelp.py index e5b382edfd..3dc8c51812 100644 --- a/wxPython/src/msw/htmlhelp.py +++ b/wxPython/src/msw/htmlhelp.py @@ -91,35 +91,22 @@ class wxHtmlContentsItemPtr : def __init__(self,this): self.this = this self.thisown = 0 - def __setattr__(self,name,value): - if name == "m_Level" : - htmlhelpc.wxHtmlContentsItem_m_Level_set(self,value) - return - if name == "m_ID" : - htmlhelpc.wxHtmlContentsItem_m_ID_set(self,value) - return - if name == "m_Name" : - htmlhelpc.wxHtmlContentsItem_m_Name_set(self,value) - return - if name == "m_Page" : - htmlhelpc.wxHtmlContentsItem_m_Page_set(self,value) - return - if name == "m_Book" : - htmlhelpc.wxHtmlContentsItem_m_Book_set(self,value.this) - return - self.__dict__[name] = value - def __getattr__(self,name): - if name == "m_Level" : - return htmlhelpc.wxHtmlContentsItem_m_Level_get(self) - if name == "m_ID" : - return htmlhelpc.wxHtmlContentsItem_m_ID_get(self) - if name == "m_Name" : - return htmlhelpc.wxHtmlContentsItem_m_Name_get(self) - if name == "m_Page" : - return htmlhelpc.wxHtmlContentsItem_m_Page_get(self) - if name == "m_Book" : - return wxHtmlBookRecordPtr(htmlhelpc.wxHtmlContentsItem_m_Book_get(self)) - raise AttributeError,name + def GetLevel(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlContentsItem_GetLevel,(self,) + _args, _kwargs) + return val + def GetID(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlContentsItem_GetID,(self,) + _args, _kwargs) + return val + def GetName(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlContentsItem_GetName,(self,) + _args, _kwargs) + return val + def GetPage(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlContentsItem_GetPage,(self,) + _args, _kwargs) + return val + def GetBook(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlContentsItem_GetBook,(self,) + _args, _kwargs) + if val: val = wxHtmlBookRecordPtr(val) + return val def __repr__(self): return "" % (self.this,) class wxHtmlContentsItem(wxHtmlContentsItemPtr): diff --git a/wxPython/src/msw/mdi.cpp b/wxPython/src/msw/mdi.cpp index fc153dbca5..ebf0951e78 100644 --- a/wxPython/src/msw/mdi.cpp +++ b/wxPython/src/msw/mdi.cpp @@ -83,6 +83,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FrameNameStr); #ifdef __cplusplus extern "C" { #endif @@ -136,18 +139,19 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxMDIParentFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxMDIParentFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -172,10 +176,16 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxMDIParentFrame *)new_wxMDIParentFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxMDIParentFrame *)new_wxMDIParentFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -189,6 +199,10 @@ static PyObject *_wrap_new_wxMDIParentFrame(PyObject *self, PyObject *args, PyOb { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -230,7 +244,7 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_FRAME_STYLE|wxVSCROLL|wxHSCROLL; - char * _arg7 = (char *) "frame"; + wxString * _arg7 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -238,10 +252,11 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxMDIParentFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxMDIParentFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -273,10 +288,16 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxMDIParentFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxMDIParentFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -284,6 +305,10 @@ static PyObject *_wrap_wxMDIParentFrame_Create(PyObject *self, PyObject *args, P { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } @@ -664,18 +689,19 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "parent","id","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOls:new_wxMDIChildFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlO:new_wxMDIChildFrame",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -700,10 +726,16 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxMDIChildFrame *)new_wxMDIChildFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxMDIChildFrame *)new_wxMDIChildFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -717,6 +749,10 @@ static PyObject *_wrap_new_wxMDIChildFrame(PyObject *self, PyObject *args, PyObj { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } @@ -758,7 +794,7 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg7 = (char *) "frame"; + wxString * _arg7 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -766,10 +802,11 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; + PyObject * _obj7 = 0; char *_kwnames[] = { "self","parent","id","title","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOls:wxMDIChildFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_arg7)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiO|OOlO:wxMDIChildFrame_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -801,10 +838,16 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; +} + if (_obj7) +{ + _arg7 = wxString_in_helper(_obj7); + if (_arg7 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxMDIChildFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,_arg7); + _result = (bool )wxMDIChildFrame_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -812,6 +855,10 @@ static PyObject *_wrap_wxMDIChildFrame_Create(PyObject *self, PyObject *args, Py { if (_obj3) delete _arg3; +} +{ + if (_obj7) + delete _arg7; } return _resultobj; } diff --git a/wxPython/src/msw/misc.cpp b/wxPython/src/msw/misc.cpp index fd5981984e..89171c959a 100644 --- a/wxPython/src/msw/misc.cpp +++ b/wxPython/src/msw/misc.cpp @@ -87,6 +87,9 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); + PyObject* wxIntersectRect(wxRect* r1, wxRect* r2) { wxRegion reg1(*r1); wxRegion reg2(*r2); @@ -111,7 +114,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } wxString wxGetResource(const wxString& section, const wxString& entry, - const wxString& file = wxEmptyString) { + const wxString& file = wxPyEmptyString) { wxChar * retval; wxGetResource(section, entry, &retval, file); return retval; @@ -414,7 +417,7 @@ static PyObject *_wrap_wxNow(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxShell(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; char *_kwnames[] = { "command", NULL }; @@ -624,7 +627,7 @@ static PyObject *_wrap_wxGetResource(PyObject *self, PyObject *args, PyObject *k wxString * _result; wxString * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _obj0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -883,15 +886,22 @@ static PyObject *_wrap_wxGetHomeDir(PyObject *self, PyObject *args, PyObject *kw static PyObject *_wrap_wxGetUserHome(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; - char * _arg0 = (char *) ""; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + PyObject * _obj0 = 0; char *_kwnames[] = { "user", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|s:wxGetUserHome",_kwnames,&_arg0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:wxGetUserHome",_kwnames,&_obj0)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxGetUserHome(_arg0)); + _result = new wxString (wxGetUserHome(*_arg0)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -902,6 +912,10 @@ static PyObject *_wrap_wxGetUserHome(PyObject *self, PyObject *args, PyObject *k _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj0) + delete _arg0; +} { delete _result; } diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 87fc65a483..b2a2447034 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -101,6 +101,12 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FileSelectorPromptStr); + DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); + + static const wxString wxPyEmptyString(wxT("")); + int wxCaret_GetBlinkTime() { return wxCaret::GetBlinkTime(); } @@ -289,21 +295,56 @@ extern "C" { static PyObject *_wrap_wxFileSelector(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; - wxChar * _arg0 = (wxChar *) wxFileSelectorPromptStr; - wxChar * _arg1 = (wxChar *) NULL; - wxChar * _arg2 = (wxChar *) NULL; - wxChar * _arg3 = (wxChar *) NULL; - wxChar * _arg4 = (wxChar *) wxFileSelectorDefaultWildcardStr; + wxString * _arg0 = (wxString *) &wxPyFileSelectorPromptStr; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; + wxString * _arg4 = (wxString *) &wxPyFileSelectorDefaultWildcardStr; int _arg5 = (int ) 0; wxWindow * _arg6 = (wxWindow *) NULL; int _arg7 = (int ) -1; int _arg8 = (int ) -1; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; PyObject * _argo6 = 0; char *_kwnames[] = { "message","default_path","default_filename","default_extension","wildcard","flags","parent","x","y", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|sssssiOii:wxFileSelector",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_argo6,&_arg7,&_arg8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOOOOiOii:wxFileSelector",_kwnames,&_obj0,&_obj1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7,&_arg8)) return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxWindow_p")) { @@ -313,7 +354,7 @@ static PyObject *_wrap_wxFileSelector(PyObject *self, PyObject *args, PyObject * } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxFileSelector(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6,_arg7,_arg8)); + _result = new wxString (wxFileSelector(*_arg0,*_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -324,6 +365,26 @@ static PyObject *_wrap_wxFileSelector(PyObject *self, PyObject *args, PyObject * _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj4) + delete _arg4; +} { delete _result; } @@ -333,16 +394,35 @@ static PyObject *_wrap_wxFileSelector(PyObject *self, PyObject *args, PyObject * static PyObject *_wrap_wxLoadFileSelector(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; - wxChar * _arg0; - wxChar * _arg1; - wxChar * _arg2 = (wxChar *) NULL; + wxString * _arg0; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxWindow * _arg3 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; PyObject * _argo3 = 0; char *_kwnames[] = { "what","extension","default_name","parent", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"ss|sO:wxLoadFileSelector",_kwnames,&_arg0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxLoadFileSelector",_kwnames,&_obj0,&_obj1,&_obj2,&_argo3)) return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxWindow_p")) { @@ -352,7 +432,7 @@ static PyObject *_wrap_wxLoadFileSelector(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxLoadFileSelector(_arg0,_arg1,_arg2,_arg3)); + _result = new wxString (wxLoadFileSelector(*_arg0,*_arg1,*_arg2,_arg3)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -363,6 +443,18 @@ static PyObject *_wrap_wxLoadFileSelector(PyObject *self, PyObject *args, PyObje _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} { delete _result; } @@ -372,16 +464,35 @@ static PyObject *_wrap_wxLoadFileSelector(PyObject *self, PyObject *args, PyObje static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; - wxChar * _arg0; - wxChar * _arg1; - wxChar * _arg2 = (wxChar *) NULL; + wxString * _arg0; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxWindow * _arg3 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; PyObject * _argo3 = 0; char *_kwnames[] = { "what","extension","default_name","parent", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"ss|sO:wxSaveFileSelector",_kwnames,&_arg0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxSaveFileSelector",_kwnames,&_obj0,&_obj1,&_obj2,&_argo3)) + return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) return NULL; +} +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxWindow_p")) { @@ -391,7 +502,7 @@ static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxSaveFileSelector(_arg0,_arg1,_arg2,_arg3)); + _result = new wxString (wxSaveFileSelector(*_arg0,*_arg1,*_arg2,_arg3)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -402,6 +513,18 @@ static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObje _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} { delete _result; } @@ -412,8 +535,8 @@ static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObjec PyObject * _resultobj; wxString * _result; wxString * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxWindow * _arg3 = (wxWindow *) NULL; int _arg4 = (int ) -1; int _arg5 = (int ) -1; @@ -488,8 +611,8 @@ static PyObject *_wrap_wxGetPasswordFromUser(PyObject *self, PyObject *args, PyO PyObject * _resultobj; wxString * _result; wxString * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; wxWindow * _arg3 = (wxWindow *) NULL; PyObject * _obj0 = 0; PyObject * _obj1 = 0; @@ -722,7 +845,7 @@ static PyObject *_wrap_wxMessageBox(PyObject *self, PyObject *args, PyObject *kw PyObject * _resultobj; int _result; wxString * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; int _arg2 = (int ) wxOK|wxCENTRE; wxWindow * _arg3 = (wxWindow *) NULL; int _arg4 = (int ) -1; @@ -3111,12 +3234,13 @@ static PyObject *_wrap_wxFontEnumerator_EnumerateEncodings(PyObject *self, PyObj PyObject * _resultobj; bool _result; wxPyFontEnumerator * _arg0; - char * _arg1 = (char *) ""; + wxString * _arg1 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","facename", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|s:wxFontEnumerator_EnumerateEncodings",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFontEnumerator_EnumerateEncodings",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3125,13 +3249,23 @@ static PyObject *_wrap_wxFontEnumerator_EnumerateEncodings(PyObject *self, PyObj return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxFontEnumerator_EnumerateEncodings(_arg0,_arg1); + _result = (bool )wxFontEnumerator_EnumerateEncodings(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -4956,26 +5090,36 @@ static PyObject *_wrap_wxLog_ClearTraceMasks(PyObject *self, PyObject *args, PyO static PyObject *_wrap_wxLog_SetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _arg0; + wxString * _arg0; + PyObject * _obj0 = 0; char *_kwnames[] = { "ts", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"s:wxLog_SetTimestamp",_kwnames,&_arg0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxLog_SetTimestamp",_kwnames,&_obj0)) return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxLog::SetTimestamp(_arg0); + wxLog::SetTimestamp(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj0) + delete _arg0; +} return _resultobj; } static PyObject *_wrap_wxLog_GetTimestamp(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxChar * _result; + wxString * _result; char *_kwnames[] = { NULL }; self = self; @@ -4983,11 +5127,18 @@ static PyObject *_wrap_wxLog_GetTimestamp(PyObject *self, PyObject *args, PyObje return NULL; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxChar *)wxLog::GetTimestamp(); + const wxString & _result_ref = wxLog::GetTimestamp(); + _result = (wxString *) &_result_ref; wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} return _resultobj; } @@ -8549,7 +8700,7 @@ static PyObject *_wrap_wxFileType_GetOpenCommand(PyObject *self, PyObject *args, PyObject * _result; wxFileType * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -8612,7 +8763,7 @@ static PyObject *_wrap_wxFileType_GetPrintCommand(PyObject *self, PyObject *args PyObject * _result; wxFileType * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -8679,7 +8830,7 @@ static PyObject *_wrap_wxFileType_GetAllCommands(PyObject *self, PyObject *args, PyObject * _result; wxFileType * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -8784,7 +8935,7 @@ static PyObject *_wrap_wxFileType_SetDefaultIcon(PyObject *self, PyObject *args, PyObject * _resultobj; bool _result; wxFileType * _arg0; - wxString * _arg1 = (wxString *) &wxEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; int _arg2 = (int ) 0; PyObject * _argo0 = 0; PyObject * _obj1 = 0; @@ -8994,7 +9145,7 @@ static PyObject *_wrap_wxMimeTypesManager_Initialize(PyObject *self, PyObject *a PyObject * _resultobj; wxMimeTypesManager * _arg0; int _arg1 = (int ) (wxMAILCAP_STANDARD); - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; char *_kwnames[] = { "self","mailcapStyle","extraDir", NULL }; diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index 2626eeb658..7793e74f0c 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -62,6 +62,12 @@ extern PyObject *SWIG_newvarlink(void); #include "printfw.h" + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxPrintoutTitleStr = wxT("Printout"); + DECLARE_DEF_STRING(PrintoutTitleStr); + + DECLARE_DEF_STRING(FrameNameStr); + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -3803,16 +3809,23 @@ static void *SwigwxPyPrintoutTowxObject(void *ptr) { static PyObject *_wrap_new_wxPrintout(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPyPrintout * _result; - char * _arg0 = (char *) "Printout"; + wxString * _arg0 = (wxString *) &wxPyPrintoutTitleStr; + PyObject * _obj0 = 0; char *_kwnames[] = { "title", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|s:new_wxPrintout",_kwnames,&_arg0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxPrintout",_kwnames,&_obj0)) return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPyPrintout *)new_wxPrintout(_arg0); + _result = (wxPyPrintout *)new_wxPrintout(*_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3823,6 +3836,10 @@ static PyObject *_wrap_new_wxPrintout(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj0) + delete _arg0; +} return _resultobj; } @@ -4622,14 +4639,15 @@ static PyObject *_wrap_wxPrinter_ReportError(PyObject *self, PyObject *args, PyO wxPrinter * _arg0; wxWindow * _arg1; wxPyPrintout * _arg2; - char * _arg3; + wxString * _arg3; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _argo2 = 0; + PyObject * _obj3 = 0; char *_kwnames[] = { "self","parent","printout","message", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOs:wxPrinter_ReportError",_kwnames,&_argo0,&_argo1,&_argo2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:wxPrinter_ReportError",_kwnames,&_argo0,&_argo1,&_argo2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4652,14 +4670,23 @@ static PyObject *_wrap_wxPrinter_ReportError(PyObject *self, PyObject *args, PyO return NULL; } } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxPrinter_ReportError(_arg0,_arg1,_arg2,_arg3); + wxPrinter_ReportError(_arg0,_arg1,_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -5299,7 +5326,7 @@ static PyObject *_wrap_new_wxPreviewFrame(PyObject *self, PyObject *args, PyObje wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxDEFAULT_FRAME_STYLE; - char * _arg6 = (char *) "frame"; + wxString * _arg6 = (wxString *) &wxPyFrameNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj2 = 0; @@ -5307,11 +5334,12 @@ static PyObject *_wrap_new_wxPreviewFrame(PyObject *self, PyObject *args, PyObje PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "preview","parent","title","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|OOls:new_wxPreviewFrame",_kwnames,&_argo0,&_argo1,&_obj2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|OOlO:new_wxPreviewFrame",_kwnames,&_argo0,&_argo1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5343,10 +5371,16 @@ static PyObject *_wrap_new_wxPreviewFrame(PyObject *self, PyObject *args, PyObje _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPreviewFrame *)new_wxPreviewFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (wxPreviewFrame *)new_wxPreviewFrame(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5360,6 +5394,10 @@ static PyObject *_wrap_new_wxPreviewFrame(PyObject *self, PyObject *args, PyObje { if (_obj2) delete _arg2; +} +{ + if (_obj6) + delete _arg6; } return _resultobj; } diff --git a/wxPython/src/msw/stattool.cpp b/wxPython/src/msw/stattool.cpp index a964a81950..bc4d3ba928 100644 --- a/wxPython/src/msw/stattool.cpp +++ b/wxPython/src/msw/stattool.cpp @@ -85,6 +85,11 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { } return target; } + + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(StatusLineNameStr); + DECLARE_DEF_STRING(ToolBarNameStr); + static const wxString wxPyEmptyString(wxT("")); #ifdef __cplusplus extern "C" { #endif @@ -119,13 +124,14 @@ static PyObject *_wrap_new_wxStatusBar(PyObject *self, PyObject *args, PyObject wxWindow * _arg0; wxWindowID _arg1 = (wxWindowID ) -1; long _arg2 = (long ) wxST_SIZEGRIP; - char * _arg3 = (char *) "statusBar"; + wxString * _arg3 = (wxString *) &wxPyStatusLineNameStr; PyObject * _argo0 = 0; + PyObject * _obj3 = 0; char *_kwnames[] = { "parent","id","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ils:new_wxStatusBar",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ilO:new_wxStatusBar",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -134,9 +140,15 @@ static PyObject *_wrap_new_wxStatusBar(PyObject *self, PyObject *args, PyObject return NULL; } } + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxStatusBar *)new_wxStatusBar(_arg0,_arg1,_arg2,_arg3); + _result = (wxStatusBar *)new_wxStatusBar(_arg0,_arg1,_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -147,6 +159,10 @@ static PyObject *_wrap_new_wxStatusBar(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj3) + delete _arg3; +} return _resultobj; } @@ -184,13 +200,14 @@ static PyObject *_wrap_wxStatusBar_Create(PyObject *self, PyObject *args, PyObje wxWindow * _arg1; wxWindowID _arg2; long _arg3 = (long ) wxST_SIZEGRIP; - char * _arg4 = (char *) "statusBar"; + wxString * _arg4 = (wxString *) &wxPyStatusLineNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj4 = 0; char *_kwnames[] = { "self","parent","id","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|ls:wxStatusBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|lO:wxStatusBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -206,13 +223,23 @@ static PyObject *_wrap_wxStatusBar_Create(PyObject *self, PyObject *args, PyObje return NULL; } } + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxStatusBar_Create(_arg0,_arg1,_arg2,_arg3,_arg4); + _result = (bool )wxStatusBar_Create(_arg0,_arg1,_arg2,_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj4) + delete _arg4; +} return _resultobj; } @@ -1522,8 +1549,8 @@ static PyObject *_wrap_wxToolBarBase_AddTool(PyObject *self, PyObject *args, PyO wxBitmap * _arg3 = (wxBitmap *) &wxNullBitmap; int _arg4 = (int ) FALSE; PyObject * _arg5 = (PyObject *) NULL; - wxString * _arg6 = (wxString *) &wxEmptyString; - wxString * _arg7 = (wxString *) &wxEmptyString; + wxString * _arg6 = (wxString *) &wxPyEmptyString; + wxString * _arg7 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo2 = 0; PyObject * _argo3 = 0; @@ -1600,8 +1627,8 @@ static PyObject *_wrap_wxToolBarBase_AddSimpleTool(PyObject *self, PyObject *arg wxToolBarBase * _arg0; int _arg1; wxBitmap * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; int _arg5 = (int ) FALSE; PyObject * _argo0 = 0; PyObject * _argo2 = 0; @@ -1673,8 +1700,8 @@ static PyObject *_wrap_wxToolBarBase_InsertTool(PyObject *self, PyObject *args, wxBitmap * _arg4 = (wxBitmap *) &wxNullBitmap; int _arg5 = (int ) FALSE; PyObject * _arg6 = (PyObject *) NULL; - wxString * _arg7 = (wxString *) &wxEmptyString; - wxString * _arg8 = (wxString *) &wxEmptyString; + wxString * _arg7 = (wxString *) &wxPyEmptyString; + wxString * _arg8 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo3 = 0; PyObject * _argo4 = 0; @@ -1752,8 +1779,8 @@ static PyObject *_wrap_wxToolBarBase_InsertSimpleTool(PyObject *self, PyObject * size_t _arg1; int _arg2; wxBitmap * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; - wxString * _arg5 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; + wxString * _arg5 = (wxString *) &wxPyEmptyString; int _arg6 = (int ) FALSE; PyObject * _argo0 = 0; PyObject * _argo3 = 0; @@ -3027,17 +3054,18 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; - char * _arg5 = (char *) wxToolBarNameStr; + wxString * _arg5 = (wxString *) &wxPyToolBarNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxToolBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxToolBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3057,10 +3085,16 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxToolBar *)new_wxToolBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxToolBar *)new_wxToolBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3071,6 +3105,10 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -3110,17 +3148,18 @@ static PyObject *_wrap_wxToolBar_Create(PyObject *self, PyObject *args, PyObject wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; - char * _arg6 = (char *) wxToolBarNameStr; + wxString * _arg6 = (wxString *) &wxPyToolBarNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxToolBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxToolBar_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3147,14 +3186,24 @@ static PyObject *_wrap_wxToolBar_Create(PyObject *self, PyObject *args, PyObject _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxToolBar_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxToolBar_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -3237,17 +3286,18 @@ static PyObject *_wrap_new_wxToolBarSimple(PyObject *self, PyObject *args, PyObj wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; - char * _arg5 = (char *) wxToolBarNameStr; + wxString * _arg5 = (wxString *) &wxPyToolBarNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxToolBarSimple",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxToolBarSimple",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3267,10 +3317,16 @@ static PyObject *_wrap_new_wxToolBarSimple(PyObject *self, PyObject *args, PyObj _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxToolBarSimple *)new_wxToolBarSimple(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxToolBarSimple *)new_wxToolBarSimple(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -3281,6 +3337,10 @@ static PyObject *_wrap_new_wxToolBarSimple(PyObject *self, PyObject *args, PyObj Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -3320,17 +3380,18 @@ static PyObject *_wrap_wxToolBarSimple_Create(PyObject *self, PyObject *args, Py wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; - char * _arg6 = (char *) wxToolBarNameStr; + wxString * _arg6 = (wxString *) &wxPyToolBarNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxToolBarSimple_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxToolBarSimple_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -3357,14 +3418,24 @@ static PyObject *_wrap_wxToolBarSimple_Create(PyObject *self, PyObject *args, Py _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxToolBarSimple_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxToolBarSimple_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index 6356d1ec79..ee122f737a 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -60,6 +60,12 @@ extern PyObject *SWIG_newvarlink(void); #include #include + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxDateFormatStr = wxT("sashWindow"); + DECLARE_DEF_STRING(DateFormatStr); + static const wxString wxPyEmptyString(wxT("")); + + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -961,7 +967,7 @@ static PyObject *_wrap_wxConfigBase_Read(PyObject *self, PyObject *args, PyObjec wxString * _result; wxConfigBase * _arg0; wxString * _arg1; - wxString * _arg2 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; @@ -1756,10 +1762,10 @@ static void *SwigwxConfigTowxConfigBase(void *ptr) { static PyObject *_wrap_new_wxConfig(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxConfig * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; - wxString * _arg1 = (wxString *) &wxEmptyString; - wxString * _arg2 = (wxString *) &wxEmptyString; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; long _arg4 = (long ) 0; PyObject * _obj0 = 0; PyObject * _obj1 = 0; @@ -1867,10 +1873,10 @@ static void *SwigwxFileConfigTowxConfigBase(void *ptr) { static PyObject *_wrap_new_wxFileConfig(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxFileConfig * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; - wxString * _arg1 = (wxString *) &wxEmptyString; - wxString * _arg2 = (wxString *) &wxEmptyString; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; long _arg4 = (long ) 0; PyObject * _obj0 = 0; PyObject * _obj1 = 0; @@ -5124,14 +5130,15 @@ static PyObject *_wrap_wxDateTime___cmp__(PyObject *self, PyObject *args, PyObje #define wxDateTime_ParseRfc822Date(_swigobj,_swigarg0) (_swigobj->ParseRfc822Date(_swigarg0)) static PyObject *_wrap_wxDateTime_ParseRfc822Date(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + wxString * _result; wxDateTime * _arg0; - wxChar * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","date", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseRfc822Date",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseRfc822Date",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5140,30 +5147,50 @@ static PyObject *_wrap_wxDateTime_ParseRfc822Date(PyObject *self, PyObject *args return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (char *)wxDateTime_ParseRfc822Date(_arg0,_arg1); + _result = new wxString (wxDateTime_ParseRfc822Date(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} return _resultobj; } #define wxDateTime_ParseFormat(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->ParseFormat(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxDateTime_ParseFormat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + wxString * _result; wxDateTime * _arg0; - wxChar * _arg1; - wxChar * _arg2 = (wxChar *) "%c"; + wxString * _arg1; + wxString * _arg2 = (wxString *) &wxPyDateFormatStr; wxDateTime * _arg3 = (wxDateTime *) &wxDefaultDateTime; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; PyObject * _argo3 = 0; char *_kwnames[] = { "self","date","format","dateDef", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os|sO:wxDateTime_ParseFormat",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|OO:wxDateTime_ParseFormat",_kwnames,&_argo0,&_obj1,&_obj2,&_argo3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5172,6 +5199,17 @@ static PyObject *_wrap_wxDateTime_ParseFormat(PyObject *self, PyObject *args, Py return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxDateTime_p")) { @@ -5181,25 +5219,43 @@ static PyObject *_wrap_wxDateTime_ParseFormat(PyObject *self, PyObject *args, Py } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (char *)wxDateTime_ParseFormat(_arg0,_arg1,_arg2,*_arg3); + _result = new wxString (wxDateTime_ParseFormat(_arg0,*_arg1,*_arg2,*_arg3)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + delete _result; +} return _resultobj; } #define wxDateTime_ParseDateTime(_swigobj,_swigarg0) (_swigobj->ParseDateTime(_swigarg0)) static PyObject *_wrap_wxDateTime_ParseDateTime(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + wxString * _result; wxDateTime * _arg0; - wxChar * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","datetime", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseDateTime",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseDateTime",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5208,27 +5264,46 @@ static PyObject *_wrap_wxDateTime_ParseDateTime(PyObject *self, PyObject *args, return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (char *)wxDateTime_ParseDateTime(_arg0,_arg1); + _result = new wxString (wxDateTime_ParseDateTime(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} return _resultobj; } #define wxDateTime_ParseDate(_swigobj,_swigarg0) (_swigobj->ParseDate(_swigarg0)) static PyObject *_wrap_wxDateTime_ParseDate(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + wxString * _result; wxDateTime * _arg0; - wxChar * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","date", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseDate",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseDate",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5237,27 +5312,46 @@ static PyObject *_wrap_wxDateTime_ParseDate(PyObject *self, PyObject *args, PyOb return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (char *)wxDateTime_ParseDate(_arg0,_arg1); + _result = new wxString (wxDateTime_ParseDate(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} return _resultobj; } #define wxDateTime_ParseTime(_swigobj,_swigarg0) (_swigobj->ParseTime(_swigarg0)) static PyObject *_wrap_wxDateTime_ParseTime(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - char * _result; + wxString * _result; wxDateTime * _arg0; - wxChar * _arg1; + wxString * _arg1; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","time", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Os:wxDateTime_ParseTime",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateTime_ParseTime",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5266,13 +5360,31 @@ static PyObject *_wrap_wxDateTime_ParseTime(PyObject *self, PyObject *args, PyOb return NULL; } } +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (char *)wxDateTime_ParseTime(_arg0,_arg1); + _result = new wxString (wxDateTime_ParseTime(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("s", _result); +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} return _resultobj; } @@ -5281,14 +5393,15 @@ static PyObject *_wrap_wxDateTime_Format(PyObject *self, PyObject *args, PyObjec PyObject * _resultobj; wxString * _result; wxDateTime * _arg0; - wxChar * _arg1 = (wxChar *) "%c"; + wxString * _arg1 = (wxString *) &wxPyDateFormatStr; wxDateTime::TimeZone * _arg2 = (wxDateTime::TimeZone *) &LOCAL; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; PyObject * _obj2 = 0; char *_kwnames[] = { "self","format","tz", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|sO:wxDateTime_Format",_kwnames,&_argo0,&_arg1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OO:wxDateTime_Format",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -5297,13 +5410,19 @@ static PyObject *_wrap_wxDateTime_Format(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} if (_obj2) { _arg2 = new wxDateTime::TimeZone((wxDateTime::TZ)PyInt_AsLong(_obj2)); } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxDateTime_Format(_arg0,_arg1,*_arg2)); + _result = new wxString (wxDateTime_Format(_arg0,*_arg1,*_arg2)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -5314,6 +5433,10 @@ static PyObject *_wrap_wxDateTime_Format(PyObject *self, PyObject *args, PyObjec _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj1) + delete _arg1; +} { if (_arg2) delete _arg2; } @@ -6528,12 +6651,13 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec PyObject * _resultobj; wxString * _result; wxTimeSpan * _arg0; - wxChar * _arg1 = (wxChar *) "%c"; + wxString * _arg1 = (wxString *) &wxPyDateFormatStr; PyObject * _argo0 = 0; + PyObject * _obj1 = 0; char *_kwnames[] = { "self","format", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|s:wxTimeSpan_Format",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxTimeSpan_Format",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6542,9 +6666,15 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec return NULL; } } + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxString (wxTimeSpan_Format(_arg0,_arg1)); + _result = new wxString (wxTimeSpan_Format(_arg0,*_arg1)); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -6555,6 +6685,10 @@ static PyObject *_wrap_wxTimeSpan_Format(PyObject *self, PyObject *args, PyObjec _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); #endif } +{ + if (_obj1) + delete _arg1; +} { delete _result; } diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 2f23e6b3ec..75d7b9ad62 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -86,6 +86,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(PanelNameStr); + static const wxString wxPyEmptyString(wxT("")); + class wxPyValidator : public wxValidator { DECLARE_DYNAMIC_CLASS(wxPyValidator); public: @@ -864,17 +868,18 @@ static PyObject *_wrap_new_wxWindow(PyObject *self, PyObject *args, PyObject *kw wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5 = (char *) "panel"; + wxString * _arg5 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -894,10 +899,16 @@ static PyObject *_wrap_new_wxWindow(PyObject *self, PyObject *args, PyObject *kw _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxWindow *)new_wxWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxWindow *)new_wxWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -908,6 +919,10 @@ static PyObject *_wrap_new_wxWindow(PyObject *self, PyObject *args, PyObject *kw Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -947,17 +962,18 @@ static PyObject *_wrap_wxWindow_Create(PyObject *self, PyObject *args, PyObject wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "panel"; + wxString * _arg6 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -984,14 +1000,24 @@ static PyObject *_wrap_wxWindow_Create(PyObject *self, PyObject *args, PyObject _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -6171,17 +6197,18 @@ static PyObject *_wrap_new_wxPanel(PyObject *self, PyObject *args, PyObject *kwa wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxTAB_TRAVERSAL; - char * _arg5 = (char *) "panel"; + wxString * _arg5 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxPanel",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxPanel",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6201,10 +6228,16 @@ static PyObject *_wrap_new_wxPanel(PyObject *self, PyObject *args, PyObject *kwa _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxPanel *)new_wxPanel(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxPanel *)new_wxPanel(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -6215,6 +6248,10 @@ static PyObject *_wrap_new_wxPanel(PyObject *self, PyObject *args, PyObject *kwa Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -6254,17 +6291,18 @@ static PyObject *_wrap_wxPanel_Create(PyObject *self, PyObject *args, PyObject * wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxTAB_TRAVERSAL; - char * _arg6 = (char *) "panel"; + wxString * _arg6 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxPanel_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxPanel_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6291,14 +6329,24 @@ static PyObject *_wrap_wxPanel_Create(PyObject *self, PyObject *args, PyObject * _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxPanel_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxPanel_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -6371,17 +6419,18 @@ static PyObject *_wrap_new_wxScrolledWindow(PyObject *self, PyObject *args, PyOb wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxHSCROLL|wxVSCROLL; - char * _arg5 = (char *) "scrolledWindow"; + wxString * _arg5 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOls:new_wxScrolledWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlO:new_wxScrolledWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6401,10 +6450,16 @@ static PyObject *_wrap_new_wxScrolledWindow(PyObject *self, PyObject *args, PyOb _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxScrolledWindow *)new_wxScrolledWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxScrolledWindow *)new_wxScrolledWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -6415,6 +6470,10 @@ static PyObject *_wrap_new_wxScrolledWindow(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -6454,17 +6513,18 @@ static PyObject *_wrap_wxScrolledWindow_Create(PyObject *self, PyObject *args, P wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxHSCROLL|wxVSCROLL; - char * _arg6 = (char *) "scrolledWindow"; + wxString * _arg6 = (wxString *) &wxPyPanelNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOls:wxScrolledWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOlO:wxScrolledWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -6491,14 +6551,24 @@ static PyObject *_wrap_wxScrolledWindow_Create(PyObject *self, PyObject *args, P _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxScrolledWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxScrolledWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -7272,7 +7342,7 @@ static void *SwigwxMenuTowxObject(void *ptr) { static PyObject *_wrap_new_wxMenu(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMenu * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; + wxString * _arg0 = (wxString *) &wxPyEmptyString; long _arg1 = (long ) 0; PyObject * _obj0 = 0; char *_kwnames[] = { "title","style", NULL }; @@ -7313,7 +7383,7 @@ static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *k wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; PyObject * _argo0 = 0; PyObject * _obj2 = 0; @@ -7367,7 +7437,7 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec int _arg1; wxString * _arg2; wxMenu * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _argo3 = 0; @@ -7464,7 +7534,7 @@ static PyObject *_wrap_wxMenu_AppendCheckItem(PyObject *self, PyObject *args, Py wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; @@ -7516,7 +7586,7 @@ static PyObject *_wrap_wxMenu_AppendRadioItem(PyObject *self, PyObject *args, Py wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; @@ -7597,7 +7667,7 @@ static PyObject *_wrap_wxMenu_Insert(PyObject *self, PyObject *args, PyObject *k size_t _arg1; int _arg2; wxString * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; wxItemKind _arg5 = (wxItemKind ) wxItem_Normal; PyObject * _argo0 = 0; PyObject * _obj3 = 0; @@ -7680,7 +7750,7 @@ static PyObject *_wrap_wxMenu_InsertCheckItem(PyObject *self, PyObject *args, Py size_t _arg1; int _arg2; wxString * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj3 = 0; PyObject * _obj4 = 0; @@ -7733,7 +7803,7 @@ static PyObject *_wrap_wxMenu_InsertRadioItem(PyObject *self, PyObject *args, Py size_t _arg1; int _arg2; wxString * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj3 = 0; PyObject * _obj4 = 0; @@ -7787,7 +7857,7 @@ static PyObject *_wrap_wxMenu_InsertMenu(PyObject *self, PyObject *args, PyObjec int _arg2; wxString * _arg3; wxMenu * _arg4; - wxString * _arg5 = (wxString *) &wxEmptyString; + wxString * _arg5 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj3 = 0; PyObject * _argo4 = 0; @@ -7885,7 +7955,7 @@ static PyObject *_wrap_wxMenu_Prepend(PyObject *self, PyObject *args, PyObject * wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; PyObject * _argo0 = 0; PyObject * _obj2 = 0; @@ -7966,7 +8036,7 @@ static PyObject *_wrap_wxMenu_PrependCheckItem(PyObject *self, PyObject *args, P wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; @@ -8018,7 +8088,7 @@ static PyObject *_wrap_wxMenu_PrependRadioItem(PyObject *self, PyObject *args, P wxMenu * _arg0; int _arg1; wxString * _arg2; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; @@ -8071,7 +8141,7 @@ static PyObject *_wrap_wxMenu_PrependMenu(PyObject *self, PyObject *args, PyObje int _arg1; wxString * _arg2; wxMenu * _arg3; - wxString * _arg4 = (wxString *) &wxEmptyString; + wxString * _arg4 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _argo3 = 0; @@ -9990,8 +10060,8 @@ static PyObject *_wrap_new_wxMenuItem(PyObject *self, PyObject *args, PyObject * wxMenuItem * _result; wxMenu * _arg0 = (wxMenu *) NULL; int _arg1 = (int ) wxID_SEPARATOR; - wxString * _arg2 = (wxString *) &wxEmptyString; - wxString * _arg3 = (wxString *) &wxEmptyString; + wxString * _arg2 = (wxString *) &wxPyEmptyString; + wxString * _arg3 = (wxString *) &wxPyEmptyString; wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; wxMenu * _arg5 = (wxMenu *) NULL; PyObject * _argo0 = 0; diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index 4af1f81d08..0d84f02bdc 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -66,6 +66,13 @@ extern PyObject *SWIG_newvarlink(void); #include #endif + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(NOTEBOOK_NAME); + + static const wxChar* wxSplitterNameStr = wxT("splitter"); + DECLARE_DEF_STRING(SplitterNameStr); + static const wxString wxPyEmptyString(wxT("")); + static PyObject* t_output_helper(PyObject* target, PyObject* o) { PyObject* o2; @@ -312,17 +319,18 @@ static PyObject *_wrap_new_wxNotebook(PyObject *self, PyObject *args, PyObject * wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5 = (char *) "notebook"; + wxString * _arg5 = (wxString *) &wxPyNOTEBOOK_NAME; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxNotebook",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxNotebook",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -342,10 +350,16 @@ static PyObject *_wrap_new_wxNotebook(PyObject *self, PyObject *args, PyObject * _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxNotebook *)new_wxNotebook(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxNotebook *)new_wxNotebook(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -356,6 +370,10 @@ static PyObject *_wrap_new_wxNotebook(PyObject *self, PyObject *args, PyObject * Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -395,17 +413,18 @@ static PyObject *_wrap_wxNotebook_Create(PyObject *self, PyObject *args, PyObjec wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) 0; - char * _arg6 = (char *) "notebook"; + wxString * _arg6 = (wxString *) &wxPyNOTEBOOK_NAME; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxNotebook_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxNotebook_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -432,14 +451,24 @@ static PyObject *_wrap_wxNotebook_Create(PyObject *self, PyObject *args, PyObjec _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxNotebook_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxNotebook_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -1381,17 +1410,18 @@ static PyObject *_wrap_new_wxSplitterWindow(PyObject *self, PyObject *args, PyOb wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxSP_3D|wxCLIP_CHILDREN; - char * _arg5 = (char *) "splitterWindow"; + wxString * _arg5 = (wxString *) &wxPySplitterNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","point","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxSplitterWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxSplitterWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1411,10 +1441,16 @@ static PyObject *_wrap_new_wxSplitterWindow(PyObject *self, PyObject *args, PyOb _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSplitterWindow *)new_wxSplitterWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxSplitterWindow *)new_wxSplitterWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1425,6 +1461,10 @@ static PyObject *_wrap_new_wxSplitterWindow(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -1464,17 +1504,18 @@ static PyObject *_wrap_wxSplitterWindow_Create(PyObject *self, PyObject *args, P wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxSP_3D|wxCLIP_CHILDREN; - char * _arg6 = (char *) "splitterWindow"; + wxString * _arg6 = (wxString *) &wxPySplitterNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","point","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxSplitterWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxSplitterWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1501,14 +1542,24 @@ static PyObject *_wrap_wxSplitterWindow_Create(PyObject *self, PyObject *args, P _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSplitterWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxSplitterWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -2174,13 +2225,14 @@ static PyObject *_wrap_wxTaskBarIcon_SetIcon(PyObject *self, PyObject *args, PyO bool _result; wxTaskBarIcon * _arg0; wxIcon * _arg1; - char * _arg2 = (char *) ""; + wxString * _arg2 = (wxString *) &wxPyEmptyString; PyObject * _argo0 = 0; PyObject * _argo1 = 0; + PyObject * _obj2 = 0; char *_kwnames[] = { "self","icon","tooltip", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|s:wxTaskBarIcon_SetIcon",_kwnames,&_argo0,&_argo1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|O:wxTaskBarIcon_SetIcon",_kwnames,&_argo0,&_argo1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2196,13 +2248,23 @@ static PyObject *_wrap_wxTaskBarIcon_SetIcon(PyObject *self, PyObject *args, PyO return NULL; } } + if (_obj2) +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxTaskBarIcon_SetIcon(_arg0,*_arg1,_arg2); + _result = (bool )wxTaskBarIcon_SetIcon(_arg0,*_arg1,*_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj2) + delete _arg2; +} return _resultobj; } diff --git a/wxPython/src/msw/windows3.cpp b/wxPython/src/msw/windows3.cpp index f85b359096..2a7c6fe148 100644 --- a/wxPython/src/msw/windows3.cpp +++ b/wxPython/src/msw/windows3.cpp @@ -90,6 +90,12 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { return target; } + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxSashNameStr = wxT("sashWindow"); + DECLARE_DEF_STRING(SashNameStr); + static const wxChar* wxSashLayoutNameStr = wxT("layoutWindow"); + DECLARE_DEF_STRING(SashLayoutNameStr); + class wxPyPopupTransientWindow : public wxPopupTransientWindow { public: @@ -374,17 +380,18 @@ static PyObject *_wrap_new_wxSashWindow(PyObject *self, PyObject *args, PyObject wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxCLIP_CHILDREN|(wxSW_3D); - char * _arg5 = (char *) "sashWindow"; + wxString * _arg5 = (wxString *) &wxPySashNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxSashWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxSashWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -404,10 +411,16 @@ static PyObject *_wrap_new_wxSashWindow(PyObject *self, PyObject *args, PyObject _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSashWindow *)new_wxSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxSashWindow *)new_wxSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -418,6 +431,10 @@ static PyObject *_wrap_new_wxSashWindow(PyObject *self, PyObject *args, PyObject Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -457,17 +474,18 @@ static PyObject *_wrap_wxSashWindow_Create(PyObject *self, PyObject *args, PyObj wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxCLIP_CHILDREN|(wxSW_3D); - char * _arg6 = (char *) "sashWindow"; + wxString * _arg6 = (wxString *) &wxPySashNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxSashWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxSashWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -494,14 +512,24 @@ static PyObject *_wrap_wxSashWindow_Create(PyObject *self, PyObject *args, PyObj _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } @@ -1542,17 +1570,18 @@ static PyObject *_wrap_new_wxSashLayoutWindow(PyObject *self, PyObject *args, Py wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) wxCLIP_CHILDREN|(wxSW_3D); - char * _arg5 = (char *) "layoutWindow"; + wxString * _arg5 = (wxString *) &wxPySashLayoutNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; + PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxSashLayoutWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxSashLayoutWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1572,10 +1601,16 @@ static PyObject *_wrap_new_wxSashLayoutWindow(PyObject *self, PyObject *args, Py _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; +} + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxSashLayoutWindow *)new_wxSashLayoutWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + _result = (wxSashLayoutWindow *)new_wxSashLayoutWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1586,6 +1621,10 @@ static PyObject *_wrap_new_wxSashLayoutWindow(PyObject *self, PyObject *args, Py Py_INCREF(Py_None); _resultobj = Py_None; } +{ + if (_obj5) + delete _arg5; +} return _resultobj; } @@ -1625,17 +1664,18 @@ static PyObject *_wrap_wxSashLayoutWindow_Create(PyObject *self, PyObject *args, wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) wxCLIP_CHILDREN|(wxSW_3D); - char * _arg6 = (char *) "layoutWindow"; + wxString * _arg6 = (wxString *) &wxPySashLayoutNameStr; PyObject * _argo0 = 0; PyObject * _argo1 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; + PyObject * _obj6 = 0; char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxSashLayoutWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOlO:wxSashLayoutWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1662,14 +1702,24 @@ static PyObject *_wrap_wxSashLayoutWindow_Create(PyObject *self, PyObject *args, _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; +} + if (_obj6) +{ + _arg6 = wxString_in_helper(_obj6); + if (_arg6 == NULL) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxSashLayoutWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + _result = (bool )wxSashLayoutWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,*_arg6); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj6) + delete _arg6; +} return _resultobj; } diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 29656823bb..4cde3bba8e 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -2516,7 +2516,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"false", PyInt_FromLong((long) 0)); PyDict_SetItemString(d,"TRUE", PyInt_FromLong((long) 1)); PyDict_SetItemString(d,"true", PyInt_FromLong((long) 1)); - PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString("wxVERSION_STRING")); PyDict_SetItemString(d,"wxEVT_NULL", PyInt_FromLong((long) wxEVT_NULL)); PyDict_SetItemString(d,"wxEVT_FIRST", PyInt_FromLong((long) wxEVT_FIRST)); PyDict_SetItemString(d,"wxEVT_COMMAND_BUTTON_CLICKED", PyInt_FromLong((long) wxEVT_COMMAND_BUTTON_CLICKED)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 194cc7320d..e09da1bd31 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -777,7 +777,6 @@ FALSE = wxc.FALSE false = wxc.false TRUE = wxc.TRUE true = wxc.true -wxVERSION_STRING = wxc.wxVERSION_STRING wxEVT_NULL = wxc.wxEVT_NULL wxEVT_FIRST = wxc.wxEVT_FIRST wxEVT_COMMAND_BUTTON_CLICKED = wxc.wxEVT_COMMAND_BUTTON_CLICKED diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i index bd02f63860..74a74ed6af 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -23,6 +23,16 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxPrintoutTitleStr = wxT("Printout"); + DECLARE_DEF_STRING(PrintoutTitleStr); + + DECLARE_DEF_STRING(FrameNameStr); +%} + +//---------------------------------------------------------------------- + %include typemaps.i %include my_typemaps.i @@ -294,7 +304,7 @@ IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage); // Now define the custom class for SWIGging %name(wxPrintout) class wxPyPrintout : public wxObject { public: - wxPyPrintout(const char* title = "Printout"); + wxPyPrintout(const wxString& title = wxPyPrintoutTitleStr); void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPrintout)" @@ -331,7 +341,7 @@ public: wxPrintDialogData& GetPrintDialogData(); bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=TRUE); wxDC* PrintDialog(wxWindow *parent); - void ReportError(wxWindow *parent, wxPyPrintout *printout, char* message); + void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message); bool Setup(wxWindow *parent); }; @@ -368,7 +378,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, - char* name = "frame"); + const wxString& name = wxPyFrameNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" diff --git a/wxPython/src/stattool.i b/wxPython/src/stattool.i index 55f29ef21d..d26338a596 100644 --- a/wxPython/src/stattool.i +++ b/wxPython/src/stattool.i @@ -33,18 +33,27 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(StatusLineNameStr); + DECLARE_DEF_STRING(ToolBarNameStr); + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- class wxStatusBar : public wxWindow { public: wxStatusBar(wxWindow* parent, wxWindowID id = -1, long style = wxST_SIZEGRIP, - char* name = "statusBar"); + const wxString& name = wxPyStatusLineNameStr); %name(wxPreStatusBar)wxStatusBar(); bool Create(wxWindow* parent, wxWindowID id, long style = wxST_SIZEGRIP, - char* name = "statusBar"); + const wxString& name = wxPyStatusLineNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreStatusBar:val._setOORInfo(val)" @@ -89,8 +98,8 @@ public: // const wxBitmap& bitmap2 = wxNullBitmap, // bool toggle = FALSE, // wxObject *clientData = (wxObject *) NULL, -// const wxString& shortHelpString = wxEmptyString, -// const wxString& longHelpString = wxEmptyString); +// const wxString& shortHelpString = wxPyEmptyString, +// const wxString& longHelpString = wxPyEmptyString); // wxToolBarToolBase(wxToolBarBase *tbar, wxControl *control); // ~wxToolBarToolBase(); @@ -164,8 +173,8 @@ public: const wxBitmap& pushedBitmap = wxNullBitmap, int isToggle = FALSE, PyObject *clientData = NULL, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString) { + const wxString& shortHelpString = wxPyEmptyString, + const wxString& longHelpString = wxPyEmptyString) { wxPyUserData* udata = NULL; if (clientData) udata = new wxPyUserData(clientData); @@ -176,8 +185,8 @@ public: // This one is easier to use... wxToolBarToolBase *AddSimpleTool(int id, const wxBitmap& bitmap, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString, + const wxString& shortHelpString = wxPyEmptyString, + const wxString& longHelpString = wxPyEmptyString, int isToggle = FALSE) { return self->AddTool(id, bitmap, wxNullBitmap, isToggle, NULL, shortHelpString, longHelpString); @@ -191,8 +200,8 @@ public: const wxBitmap& pushedBitmap = wxNullBitmap, int isToggle = FALSE, PyObject *clientData = NULL, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString) { + const wxString& shortHelpString = wxPyEmptyString, + const wxString& longHelpString = wxPyEmptyString) { wxPyUserData* udata = NULL; if (clientData) udata = new wxPyUserData(clientData); @@ -204,8 +213,8 @@ public: wxToolBarToolBase *InsertSimpleTool(size_t pos, int id, const wxBitmap& bitmap, - const wxString& shortHelpString = wxEmptyString, - const wxString& longHelpString = wxEmptyString, + const wxString& shortHelpString = wxPyEmptyString, + const wxString& longHelpString = wxPyEmptyString, int isToggle = FALSE) { return self->InsertTool(pos, id, bitmap, wxNullBitmap, isToggle, NULL, shortHelpString, longHelpString); @@ -293,7 +302,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const char* name = wxToolBarNameStr); + const wxString& name = wxPyToolBarNameStr); %name(wxPreToolBar)wxToolBar(); bool Create(wxWindow *parent, @@ -301,7 +310,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const char* name = wxToolBarNameStr); + const wxString& name = wxPyToolBarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreToolBar:val._setOORInfo(val)" @@ -319,7 +328,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const char* name = wxToolBarNameStr); + const wxString& name = wxPyToolBarNameStr); %name(wxPreToolBarSimple)wxToolBarSimple(); bool Create(wxWindow *parent, @@ -327,7 +336,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const char* name = wxToolBarNameStr); + const wxString& name = wxPyToolBarNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreToolBarSimple:val._setOORInfo(val)" diff --git a/wxPython/src/utils.i b/wxPython/src/utils.i index 67821cbaba..a037def99f 100644 --- a/wxPython/src/utils.i +++ b/wxPython/src/utils.i @@ -20,6 +20,14 @@ #include %} +//--------------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxDateFormatStr = wxT("sashWindow"); + DECLARE_DEF_STRING(DateFormatStr); + static const wxString wxPyEmptyString(wxT("")); + +%} //--------------------------------------------------------------------------- %include typemaps.i @@ -62,10 +70,10 @@ enum class wxConfigBase { public: -// wxConfigBase(const wxString& appName = wxEmptyString, **** An ABC -// const wxString& vendorName = wxEmptyString, -// const wxString& localFilename = wxEmptyString, -// const wxString& globalFilename = wxEmptyString, +// wxConfigBase(const wxString& appName = wxPyEmptyString, **** An ABC +// const wxString& vendorName = wxPyEmptyString, +// const wxString& localFilename = wxPyEmptyString, +// const wxString& globalFilename = wxPyEmptyString, // long style = 0); ~wxConfigBase(); @@ -150,7 +158,7 @@ public: bool IsExpandingEnvVars(); bool IsRecordingDefaults(); - wxString Read(const wxString& key, const wxString& defaultVal = wxEmptyString); + wxString Read(const wxString& key, const wxString& defaultVal = wxPyEmptyString); %addmethods { long ReadInt(const wxString& key, long defaultVal = 0) { @@ -200,10 +208,10 @@ public: // This will be a wxRegConfig on Win32 and wxFileConfig otherwise. class wxConfig : public wxConfigBase { public: - wxConfig(const wxString& appName = wxEmptyString, - const wxString& vendorName = wxEmptyString, - const wxString& localFilename = wxEmptyString, - const wxString& globalFilename = wxEmptyString, + wxConfig(const wxString& appName = wxPyEmptyString, + const wxString& vendorName = wxPyEmptyString, + const wxString& localFilename = wxPyEmptyString, + const wxString& globalFilename = wxPyEmptyString, long style = 0); ~wxConfig(); }; @@ -212,10 +220,10 @@ public: // Sometimes it's nice to explicitly have a wxFileConfig too. class wxFileConfig : public wxConfigBase { public: - wxFileConfig(const wxString& appName = wxEmptyString, - const wxString& vendorName = wxEmptyString, - const wxString& localFilename = wxEmptyString, - const wxString& globalFilename = wxEmptyString, + wxFileConfig(const wxString& appName = wxPyEmptyString, + const wxString& vendorName = wxPyEmptyString, + const wxString& localFilename = wxPyEmptyString, + const wxString& globalFilename = wxPyEmptyString, long style = 0); ~wxFileConfig(); }; @@ -771,32 +779,32 @@ public: // parse a string in RFC 822 format (found e.g. in mail headers and // having the form "Wed, 10 Feb 1999 19:07:07 +0100") - const char *ParseRfc822Date(const wxChar* date); + wxString ParseRfc822Date(const wxString& date); // parse a date/time in the given format (see strptime(3)), fill in // the missing (in the string) fields with the values of dateDef (by // default, they will not change if they had valid values or will // default to Today() otherwise) - const char *ParseFormat(const wxChar *date, - const wxChar *format = "%c", - const wxDateTime& dateDef = wxDefaultDateTime); + wxString ParseFormat(const wxString& date, + const wxString& format = wxPyDateFormatStr, + const wxDateTime& dateDef = wxDefaultDateTime); // parse a string containing the date/time in "free" format, this // function will try to make an educated guess at the string contents - const char *ParseDateTime(const wxChar *datetime); + wxString ParseDateTime(const wxString& datetime); // parse a string containing the date only in "free" format (less // flexible than ParseDateTime) - const char *ParseDate(const wxChar *date); + wxString ParseDate(const wxString& date); // parse a string containing the time only in "free" format - const char *ParseTime(const wxChar *time); + wxString ParseTime(const wxString& time); // this function accepts strftime()-like format string (default // argument corresponds to the preferred date and time representation // for the current locale) and returns the string containing the // resulting text representation - wxString Format(const wxChar *format = "%c", + wxString Format(const wxString& format = wxPyDateFormatStr, const wxDateTime::TimeZone& tz = LOCAL) const; // preferred date representation for the current locale @@ -946,7 +954,7 @@ public: // resulting text representation. Notice that only some of format // specifiers valid for wxDateTime are valid for wxTimeSpan: hours, // minutes and seconds make sense, but not "PM/AM" string for example. - wxString Format(const wxChar *format = "%c") const; + wxString Format(const wxString& format = wxPyDateFormatStr) const; // // preferred date representation for the current locale // wxString FormatDate() const; diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index c245360dc6..61f45be466 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -33,6 +33,14 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(PanelNameStr); + static const wxString wxPyEmptyString(wxT("")); +%} + //--------------------------------------------------------------------------- class wxEvtHandler : public wxObject { @@ -174,14 +182,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "panel"); + const wxString& name = wxPyPanelNameStr); %name(wxPreWindow)wxWindow(); bool Create(wxWindow* parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "panel"); + const wxString& name = wxPyPanelNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreWindow:val._setOORInfo(val)" @@ -471,7 +479,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, - const char* name = "panel"); + const wxString& name = wxPyPanelNameStr); %name(wxPrePanel)wxPanel(); bool Create(wxWindow* parent, @@ -479,7 +487,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, - const char* name = "panel"); + const wxString& name = wxPyPanelNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPrePanel:val._setOORInfo(val)" @@ -502,7 +510,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHSCROLL | wxVSCROLL, - char* name = "scrolledWindow"); + const wxString& name = wxPyPanelNameStr); %name(wxPreScrolledWindow)wxScrolledWindow(); bool Create(wxWindow* parent, @@ -510,7 +518,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHSCROLL | wxVSCROLL, - char* name = "scrolledWindow"); + const wxString& name = wxPyPanelNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreScrolledWindow:val._setOORInfo(val)" @@ -569,62 +577,62 @@ public: class wxMenu : public wxEvtHandler { public: - wxMenu(const wxString& title = wxEmptyString, long style = 0); + wxMenu(const wxString& title = wxPyEmptyString, long style = 0); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" void Append(int id, const wxString& item, - const wxString& helpString = wxEmptyString, + const wxString& helpString = wxPyEmptyString, wxItemKind kind = wxItem_Normal); %name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu, - const wxString& helpString = wxEmptyString); + const wxString& helpString = wxPyEmptyString); %name(AppendItem)void Append(const wxMenuItem* item); void AppendCheckItem(int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); void AppendRadioItem(int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); void AppendSeparator(); void Insert(size_t pos, int id, const wxString& text, - const wxString& help = wxEmptyString, + const wxString& help = wxPyEmptyString, wxItemKind kind = wxItem_Normal); void InsertSeparator(size_t pos); void InsertCheckItem(size_t pos, int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); void InsertRadioItem(size_t pos, int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); %name(InsertMenu)void Insert(size_t pos, int id, const wxString& text, wxMenu *submenu, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); %name(InsertItem)bool Insert(size_t pos, wxMenuItem *item); void Prepend(int id, const wxString& text, - const wxString& help = wxEmptyString, + const wxString& help = wxPyEmptyString, wxItemKind kind = wxItem_Normal); void PrependSeparator(); void PrependCheckItem(int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); void PrependRadioItem(int id, const wxString& text, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); %name(PrependMenu)void Prepend(int id, const wxString& text, wxMenu *submenu, - const wxString& help = wxEmptyString); + const wxString& help = wxPyEmptyString); %name(PrependItem)void Prepend(wxMenuItem *item); @@ -724,8 +732,8 @@ public: class wxMenuItem : public wxObject { public: wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR, - const wxString& text = wxEmptyString, - const wxString& help = wxEmptyString, + const wxString& text = wxPyEmptyString, + const wxString& help = wxPyEmptyString, wxItemKind kind = wxItem_Normal, wxMenu* subMenu = NULL); diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index c05e23d81e..8965938e88 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -27,6 +27,17 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(NOTEBOOK_NAME); + + static const wxChar* wxSplitterNameStr = wxT("splitter"); + DECLARE_DEF_STRING(SplitterNameStr); + static const wxString wxPyEmptyString(wxT("")); +%} + +//---------------------------------------------------------------------- + %include typemaps.i %include my_typemaps.i @@ -69,7 +80,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "notebook"); + const wxString& name = wxPyNOTEBOOK_NAME); %name(wxPreNotebook)wxNotebook(); bool Create(wxWindow *parent, @@ -77,7 +88,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - char* name = "notebook"); + const wxString& name = wxPyNOTEBOOK_NAME); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)" @@ -167,14 +178,14 @@ public: const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=wxSP_3D|wxCLIP_CHILDREN, - char* name = "splitterWindow"); + const wxString& name = wxPySplitterNameStr); %name(wxPreSplitterWindow)wxSplitterWindow(); bool Create(wxWindow* parent, wxWindowID id, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=wxSP_3D|wxCLIP_CHILDREN, - char* name = "splitterWindow"); + const wxString& name = wxPySplitterNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)" @@ -273,7 +284,7 @@ public: %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)" %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)" - bool SetIcon(const wxIcon& icon, const char* tooltip = ""); + bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString); bool RemoveIcon(void); bool PopupMenu(wxMenu *menu); bool IsIconInstalled(); diff --git a/wxPython/src/windows3.i b/wxPython/src/windows3.i index 3b8704adf3..bb2b7300d5 100644 --- a/wxPython/src/windows3.i +++ b/wxPython/src/windows3.i @@ -38,6 +38,15 @@ %pragma(python) code = "import wx" +//---------------------------------------------------------------------- + +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxChar* wxSashNameStr = wxT("sashWindow"); + DECLARE_DEF_STRING(SashNameStr); + static const wxChar* wxSashLayoutNameStr = wxT("layoutWindow"); + DECLARE_DEF_STRING(SashLayoutNameStr); +%} //--------------------------------------------------------------------------- enum wxSashEdgePosition { @@ -83,14 +92,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, - const char* name = "sashWindow"); + const wxString& name = wxPySashNameStr); %name(wxPreSashWindow)wxSashWindow(); bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, - const char* name = "sashWindow"); + const wxString& name = wxPySashNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)" @@ -173,14 +182,14 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, - const char* name = "layoutWindow"); + const wxString& name = wxPySashLayoutNameStr); %name(wxPreSashLayoutWindow)wxSashLayoutWindow(); bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, - const char* name = "layoutWindow"); + const wxString& name = wxPySashLayoutNameStr); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)" -- 2.45.2