From 7e63a44037515f18fc68b3d0bcc8c42d0dae3dcf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 14 Sep 2004 02:58:48 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp | 13 +-- wxPython/contrib/gizmos/msw/gizmos_wrap.cpp | 13 +-- wxPython/contrib/ogl/gtk/ogl_wrap.cpp | 13 +-- wxPython/contrib/ogl/msw/ogl_wrap.cpp | 13 +-- wxPython/contrib/stc/gtk/stc_wrap.cpp | 13 +-- wxPython/contrib/stc/msw/stc_wrap.cpp | 13 +-- wxPython/src/gtk/_controls_wrap.cpp | 13 +-- wxPython/src/gtk/_core.py | 27 ++++-- wxPython/src/gtk/_core_wrap.cpp | 97 ++++++++++++++++++--- wxPython/src/gtk/_gdi_wrap.cpp | 13 +-- wxPython/src/gtk/_misc.py | 15 +++- wxPython/src/gtk/_misc_wrap.cpp | 76 ++++++++++++++-- wxPython/src/gtk/_windows_wrap.cpp | 13 +-- wxPython/src/gtk/calendar.py | 27 +++--- wxPython/src/gtk/grid_wrap.cpp | 13 +-- wxPython/src/gtk/html_wrap.cpp | 13 +-- wxPython/src/gtk/wizard_wrap.cpp | 13 +-- wxPython/src/msw/_controls_wrap.cpp | 13 +-- wxPython/src/msw/_core_wrap.cpp | 97 ++++++++++++++++++--- wxPython/src/msw/_gdi_wrap.cpp | 13 +-- wxPython/src/msw/_misc_wrap.cpp | 76 ++++++++++++++-- wxPython/src/msw/_windows_wrap.cpp | 13 +-- wxPython/src/msw/grid_wrap.cpp | 13 +-- wxPython/src/msw/html_wrap.cpp | 13 +-- wxPython/src/msw/wizard_wrap.cpp | 13 +-- wxPython/wxPython/_misc.py | 2 + 26 files changed, 485 insertions(+), 166 deletions(-) diff --git a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp index 1ef7ca7463..bb74927d3c 100644 --- a/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/gtk/gizmos_wrap.cpp @@ -790,11 +790,12 @@ PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId cons } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -804,7 +805,7 @@ PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId cons Py_DECREF(o3); } return target; -} + } PyObject *wxPyTreeListCtrl_GetBoundingRect(wxPyTreeListCtrl *self,wxTreeItemId const &item,bool textOnly){ diff --git a/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp b/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp index 91e689d042..dd38ad1915 100644 --- a/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp +++ b/wxPython/contrib/gizmos/msw/gizmos_wrap.cpp @@ -790,11 +790,12 @@ PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId cons } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -804,7 +805,7 @@ PyObject *wxPyTreeListCtrl_GetNextChild(wxPyTreeListCtrl *self,wxTreeItemId cons Py_DECREF(o3); } return target; -} + } PyObject *wxPyTreeListCtrl_GetBoundingRect(wxPyTreeListCtrl *self,wxTreeItemId const &item,bool textOnly){ diff --git a/wxPython/contrib/ogl/gtk/ogl_wrap.cpp b/wxPython/contrib/ogl/gtk/ogl_wrap.cpp index b2faec9de0..2b2debc4df 100644 --- a/wxPython/contrib/ogl/gtk/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/gtk/ogl_wrap.cpp @@ -475,11 +475,12 @@ SWIG_Check_int(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -489,7 +490,7 @@ SWIG_Check_int(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/contrib/ogl/msw/ogl_wrap.cpp b/wxPython/contrib/ogl/msw/ogl_wrap.cpp index d5340c81d6..055b674be0 100644 --- a/wxPython/contrib/ogl/msw/ogl_wrap.cpp +++ b/wxPython/contrib/ogl/msw/ogl_wrap.cpp @@ -475,11 +475,12 @@ SWIG_Check_int(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -489,7 +490,7 @@ SWIG_Check_int(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/contrib/stc/gtk/stc_wrap.cpp b/wxPython/contrib/stc/gtk/stc_wrap.cpp index 7f829b3a8d..4285e31c7e 100644 --- a/wxPython/contrib/stc/gtk/stc_wrap.cpp +++ b/wxPython/contrib/stc/gtk/stc_wrap.cpp @@ -482,11 +482,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -496,7 +497,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/contrib/stc/msw/stc_wrap.cpp b/wxPython/contrib/stc/msw/stc_wrap.cpp index f64d360a1c..b467eefb27 100644 --- a/wxPython/contrib/stc/msw/stc_wrap.cpp +++ b/wxPython/contrib/stc/msw/stc_wrap.cpp @@ -482,11 +482,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -496,7 +497,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/gtk/_controls_wrap.cpp b/wxPython/src/gtk/_controls_wrap.cpp index 6c92f57d8b..4632259cab 100644 --- a/wxPython/src/gtk/_controls_wrap.cpp +++ b/wxPython/src/gtk/_controls_wrap.cpp @@ -599,11 +599,12 @@ void wxListBox_SetItemFont(wxListBox *self,int item,wxFont const &f){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -613,7 +614,7 @@ void wxListBox_SetItemFont(wxListBox *self,int item,wxFont const &f){ Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index 7e40ca8240..5ff26d96e1 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -7260,6 +7260,22 @@ class Window(EvtHandler): """ return _core_.Window_GetHandle(*args, **kwargs) + def AssociateHandle(*args, **kwargs): + """ + AssociateHandle(self, long handle) + + Associate the window with a new native handle + """ + return _core_.Window_AssociateHandle(*args, **kwargs) + + def DissociateHandle(*args, **kwargs): + """ + DissociateHandle(self) + + Dissociate the current native handle from the window + """ + return _core_.Window_DissociateHandle(*args, **kwargs) + def HasScrollbar(*args, **kwargs): """ HasScrollbar(self, int orient) -> bool @@ -9308,12 +9324,13 @@ class Sizer(Object): def Show(*args, **kwargs): """ - Show(self, item, bool show=True) + Show(self, item, bool show=True, bool recursive=False) -> bool Shows or hides an item managed by the sizer. To make a sizer item disappear or reappear, use Show followed by `Layout`. The *item* parameter can be either a window, a sizer, or the zero-based index of - the item. + the item. Use the recursive parameter to show or hide an item in a + subsizer. Returns True if the item was found. """ return _core_.Sizer_Show(*args, **kwargs) @@ -9328,11 +9345,11 @@ class Sizer(Object): """ return _core_.Sizer_IsShown(*args, **kwargs) - def Hide(self, item): + def Hide(self, item, recursive=False): """ - A convenience method for Show(item, False). + A convenience method for Show(item, False, recursive). """ - self.Show(item, False) + return self.Show(item, False, recursive) def ShowItems(*args, **kwargs): """ diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index 81d329267c..b94d147f1d 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -865,11 +865,12 @@ PyObject *wxRect_Get(wxRect *self){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -879,7 +880,7 @@ PyObject *wxRect_Get(wxRect *self){ Py_DECREF(o3); } return target; -} + } void wxPoint2D_Set(wxPoint2D *self,double x,double y){ @@ -1555,6 +1556,9 @@ bool wxWindow_UnregisterHotKey(wxWindow *self,int hotkeyId){ long wxWindow_GetHandle(wxWindow *self){ return wxPyGetWinHandle(self); } +void wxWindow_AssociateHandle(wxWindow *self,long handle){ + self->AssociateHandle((WXWidget)handle); + } wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) { return wxWindow::FindWindowById(id, parent); @@ -1908,16 +1912,16 @@ PyObject *wxSizer_GetChildren(wxSizer *self){ wxSizerItemList& list = self->GetChildren(); return wxPy_ConvertList(&list); } -void wxSizer_Show(wxSizer *self,PyObject *item,bool show){ +bool wxSizer_Show(wxSizer *self,PyObject *item,bool show,bool recursive){ bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); wxPyEndBlockThreads(blocked); if ( info.window ) - self->Show(info.window, show); + return self->Show(info.window, show, recursive); else if ( info.sizer ) - self->Show(info.sizer, show); + return self->Show(info.sizer, show, recursive); else if ( info.gotPos ) - self->Show(info.pos, show); + return self->Show(info.pos, show); } bool wxSizer_IsShown(wxSizer *self,PyObject *item){ bool blocked = wxPyBeginBlockThreads(); @@ -27453,6 +27457,60 @@ static PyObject *_wrap_Window_GetHandle(PyObject *, PyObject *args, PyObject *kw } +static PyObject *_wrap_Window_AssociateHandle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + long arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "handle", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_AssociateHandle",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (long)SWIG_As_long(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_AssociateHandle(arg1,arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Window_DissociateHandle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Window_DissociateHandle",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->DissociateHandle(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Window_HasScrollbar(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; @@ -35922,14 +35980,17 @@ static PyObject *_wrap_Sizer_Show(PyObject *, PyObject *args, PyObject *kwargs) wxSizer *arg1 = (wxSizer *) 0 ; PyObject *arg2 = (PyObject *) 0 ; bool arg3 = (bool) True ; + bool arg4 = (bool) False ; + bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "item",(char *) "show", NULL + (char *) "self",(char *) "item",(char *) "show",(char *) "recursive", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:Sizer_Show",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Sizer_Show",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSizer, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; arg2 = obj1; @@ -35937,14 +35998,20 @@ static PyObject *_wrap_Sizer_Show(PyObject *, PyObject *args, PyObject *kwargs) arg3 = (bool)SWIG_As_bool(obj2); if (PyErr_Occurred()) SWIG_fail; } + if (obj3) { + arg4 = (bool)SWIG_As_bool(obj3); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxSizer_Show(arg1,arg2,arg3); + result = (bool)wxSizer_Show(arg1,arg2,arg3,arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - Py_INCREF(Py_None); resultobj = Py_None; + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } return resultobj; fail: return NULL; @@ -41132,6 +41199,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Window_PopupMenuXY", (PyCFunction) _wrap_Window_PopupMenuXY, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_PopupMenu", (PyCFunction) _wrap_Window_PopupMenu, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_GetHandle", (PyCFunction) _wrap_Window_GetHandle, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Window_AssociateHandle", (PyCFunction) _wrap_Window_AssociateHandle, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Window_DissociateHandle", (PyCFunction) _wrap_Window_DissociateHandle, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_HasScrollbar", (PyCFunction) _wrap_Window_HasScrollbar, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_SetScrollbar", (PyCFunction) _wrap_Window_SetScrollbar, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_SetScrollPos", (PyCFunction) _wrap_Window_SetScrollPos, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/gtk/_gdi_wrap.cpp b/wxPython/src/gtk/_gdi_wrap.cpp index 3040f9e6ae..c9e2ebdd7e 100644 --- a/wxPython/src/gtk/_gdi_wrap.cpp +++ b/wxPython/src/gtk/_gdi_wrap.cpp @@ -621,11 +621,12 @@ SWIG_Check_int(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -635,7 +636,7 @@ SWIG_Check_int(PyObject* obj) Py_DECREF(o3); } return target; -} + } PyObject *wxPen_GetDashes(wxPen *self){ diff --git a/wxPython/src/gtk/_misc.py b/wxPython/src/gtk/_misc.py index 1eb58a367b..abfe7c0b71 100644 --- a/wxPython/src/gtk/_misc.py +++ b/wxPython/src/gtk/_misc.py @@ -205,6 +205,8 @@ class SystemOptionsPtr(SystemOptions): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = SystemOptions _misc_.SystemOptions_swigregister(SystemOptionsPtr) +cvar = _misc_.cvar +WINDOW_DEFAULT_VARIANT = cvar.WINDOW_DEFAULT_VARIANT def SystemOptions_SetOption(*args, **kwargs): """SystemOptions_SetOption(String name, String value)""" @@ -544,7 +546,6 @@ class MutexGuiLockerPtr(MutexGuiLocker): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = MutexGuiLocker _misc_.MutexGuiLocker_swigregister(MutexGuiLockerPtr) -cvar = _misc_.cvar FileSelectorPromptStr = cvar.FileSelectorPromptStr FileSelectorDefaultWildcardStr = cvar.FileSelectorDefaultWildcardStr DirSelectorPromptStr = cvar.DirSelectorPromptStr @@ -3440,6 +3441,14 @@ class DateTime(object): """GetWeek(self, int numWeek, int weekday=Mon, int flags=Monday_First) -> DateTime""" return _misc_.DateTime_GetWeek(*args, **kwargs) + SetToTheWeek = wx._deprecated(SetToTheWeek, "SetToTheWeek is deprecated, use (static) SetToWeekOfYear instead") + GetWeek = wx._deprecated(GetWeek, "GetWeek is deprecated, use GetWeekOfYear instead") + + def SetToWeekOfYear(*args, **kwargs): + """SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime""" + return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs) + + SetToWeekOfYear = staticmethod(SetToWeekOfYear) def SetToLastMonthDay(*args, **kwargs): """SetToLastMonthDay(self, int month=Inv_Month, int year=Inv_Year) -> DateTime""" return _misc_.DateTime_SetToLastMonthDay(*args, **kwargs) @@ -3827,6 +3836,10 @@ def DateTimeFromDMY(*args, **kwargs): val.thisown = 1 return val +def DateTime_SetToWeekOfYear(*args, **kwargs): + """DateTime_SetToWeekOfYear(int year, int numWeek, int weekday=Mon) -> DateTime""" + return _misc_.DateTime_SetToWeekOfYear(*args, **kwargs) + class TimeSpan(object): def __repr__(self): return "<%s.%s; proxy of C++ wxTimeSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) diff --git a/wxPython/src/gtk/_misc_wrap.cpp b/wxPython/src/gtk/_misc_wrap.cpp index 3be76181ec..f56059129d 100644 --- a/wxPython/src/gtk/_misc_wrap.cpp +++ b/wxPython/src/gtk/_misc_wrap.cpp @@ -469,6 +469,7 @@ SWIG_Check_int(PyObject* obj) return SWIG_AsVal_int(obj, (int*)0); } + static const wxString wxPyWINDOW_DEFAULT_VARIANT(wxWINDOW_DEFAULT_VARIANT); #include @@ -555,11 +556,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -569,7 +571,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } @@ -1943,6 +1945,26 @@ static PyObject * SystemSettings_swigregister(PyObject *, PyObject *args) { Py_INCREF(obj); return Py_BuildValue((char *)""); } +static int _wrap_WINDOW_DEFAULT_VARIANT_set(PyObject *) { + PyErr_SetString(PyExc_TypeError,"Variable WINDOW_DEFAULT_VARIANT is read-only."); + return 1; +} + + +static PyObject *_wrap_WINDOW_DEFAULT_VARIANT_get() { + PyObject *pyobj; + + { +#if wxUSE_UNICODE + pyobj = PyUnicode_FromWideChar((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len()); +#else + pyobj = PyString_FromStringAndSize((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len()); +#endif + } + return pyobj; +} + + static PyObject *_wrap_new_SystemOptions(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxSystemOptions *result; @@ -18811,6 +18833,46 @@ static PyObject *_wrap_DateTime_GetWeek(PyObject *, PyObject *args, PyObject *kw } +static PyObject *_wrap_DateTime_SetToWeekOfYear(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + int arg1 ; + int arg2 ; + int arg3 = (int) wxDateTime::Mon ; + wxDateTime result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "year",(char *) "numWeek",(char *) "weekday", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:DateTime_SetToWeekOfYear",kwnames,&obj0,&obj1,&obj2)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (int)SWIG_As_int(obj1); + if (PyErr_Occurred()) SWIG_fail; + if (obj2) { + arg3 = (int)SWIG_As_int(obj2); + if (PyErr_Occurred()) SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = wxDateTime::SetToWeekOfYear(arg1,arg2,(wxDateTime::WeekDay )arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxDateTime * resultptr; + resultptr = new wxDateTime((wxDateTime &) result); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxDateTime, 1); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_DateTime_SetToLastMonthDay(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; @@ -28974,6 +29036,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"DateTime_GetLastWeekDay", (PyCFunction) _wrap_DateTime_GetLastWeekDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToTheWeek", (PyCFunction) _wrap_DateTime_SetToTheWeek, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_GetWeek", (PyCFunction) _wrap_DateTime_GetWeek, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"DateTime_SetToWeekOfYear", (PyCFunction) _wrap_DateTime_SetToWeekOfYear, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToLastMonthDay", (PyCFunction) _wrap_DateTime_SetToLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_GetLastMonthDay", (PyCFunction) _wrap_DateTime_GetLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToYearDay", (PyCFunction) _wrap_DateTime_SetToYearDay, METH_VARARGS | METH_KEYWORDS, NULL }, @@ -30077,6 +30140,7 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"SYS_SCREEN_SMALL", SWIG_From_int((int)wxSYS_SCREEN_SMALL)); PyDict_SetItemString(d,"SYS_SCREEN_DESKTOP", SWIG_From_int((int)wxSYS_SCREEN_DESKTOP)); PyDict_SetItemString(d,(char*)"cvar", SWIG_globals); + SWIG_addvarlink(SWIG_globals,(char*)"WINDOW_DEFAULT_VARIANT",_wrap_WINDOW_DEFAULT_VARIANT_get, _wrap_WINDOW_DEFAULT_VARIANT_set); SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorPromptStr",_wrap_FileSelectorPromptStr_get, _wrap_FileSelectorPromptStr_set); SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorDefaultWildcardStr",_wrap_FileSelectorDefaultWildcardStr_get, _wrap_FileSelectorDefaultWildcardStr_set); SWIG_addvarlink(SWIG_globals,(char*)"DirSelectorPromptStr",_wrap_DirSelectorPromptStr_get, _wrap_DirSelectorPromptStr_set); diff --git a/wxPython/src/gtk/_windows_wrap.cpp b/wxPython/src/gtk/_windows_wrap.cpp index 4335be2359..3df90d3c41 100644 --- a/wxPython/src/gtk/_windows_wrap.cpp +++ b/wxPython/src/gtk/_windows_wrap.cpp @@ -551,11 +551,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -565,7 +566,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/gtk/calendar.py b/wxPython/src/gtk/calendar.py index 64a43d13f8..71b85d2a05 100644 --- a/wxPython/src/gtk/calendar.py +++ b/wxPython/src/gtk/calendar.py @@ -149,11 +149,11 @@ class CalendarEvent(_core.CommandEvent): def PySetDate(self, date): """takes datetime.datetime or datetime.date object""" - self.SetDate(_py2wx(date)) + self.SetDate(_pydate2wxdate(date)) def PyGetDate(self): """returns datetime.date object""" - return _wx2py(self.GetDate()) + return _wxdate2pydate(self.GetDate()) class CalendarEventPtr(CalendarEvent): @@ -476,19 +476,19 @@ class CalendarCtrl(_core.Control): GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) def PySetDate(self, date): """takes datetime.datetime or datetime.date object""" - self.SetDate(_py2wx(date)) + self.SetDate(_pydate2wxdate(date)) def PyGetDate(self): """returns datetime.date object""" - return _wx2py(self.GetDate()) + return _wxdate2pydate(self.GetDate()) def PySetLowerDateLimit(self, date): """takes datetime.datetime or datetime.date object""" - self.SetLowerDateLimit(_py2wx(date)) + self.SetLowerDateLimit(_pydate2wxdate(date)) def PySetUpperDateLimit(self, date): """takes datetime.datetime or datetime.date object""" - self.SetUpperDateLimit(_py2wx(date)) + self.SetUpperDateLimit(_pydate2wxdate(date)) def PySetDateRange(self, lowerdate, upperdate): """takes datetime.datetime or datetime.date objects""" @@ -497,11 +497,11 @@ class CalendarCtrl(_core.Control): def PyGetLowerDateLimit(self): """returns datetime.date object""" - return _wx2py(self.GetLowerDateLimit()) + return _wxdate2pydate(self.GetLowerDateLimit()) def PyGetUpperDateLimit(self): """returns datetime.date object""" - return _wx2py(self.GetUpperDateLimit()) + return _wxdate2pydate(self.GetUpperDateLimit()) class CalendarCtrlPtr(CalendarCtrl): @@ -540,17 +540,20 @@ def CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs): """ return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs) -def _py2wx(date): +def _pydate2wxdate(date): import datetime assert isinstance(date, (datetime.datetime, datetime.date)) tt = date.timetuple() dmy = (tt[2], tt[1]-1, tt[0]) return wx.DateTimeFromDMY(*dmy) -def _wx2py(date): +def _wxdate2pydate(date): import datetime assert isinstance(date, wx.DateTime) - ymd = map(int, date.FormatISODate().split('-')) - return datetime.date(*ymd) + if date.IsValid(): + ymd = map(int, date.FormatISODate().split('-')) + return datetime.date(*ymd) + else: + return None diff --git a/wxPython/src/gtk/grid_wrap.cpp b/wxPython/src/gtk/grid_wrap.cpp index 90afbcb962..1bbfcd6ef1 100644 --- a/wxPython/src/gtk/grid_wrap.cpp +++ b/wxPython/src/gtk/grid_wrap.cpp @@ -1203,11 +1203,12 @@ void wxGridCellAttr__setOORInfo(wxGridCellAttr *self,PyObject *_self){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -1217,7 +1218,7 @@ void wxGridCellAttr__setOORInfo(wxGridCellAttr *self,PyObject *_self){ Py_DECREF(o3); } return target; -} + } void wxGridCellAttrProvider__setOORInfo(wxGridCellAttrProvider *self,PyObject *_self){ diff --git a/wxPython/src/gtk/html_wrap.cpp b/wxPython/src/gtk/html_wrap.cpp index 5cfe3270f7..e5ef64cc9b 100644 --- a/wxPython/src/gtk/html_wrap.cpp +++ b/wxPython/src/gtk/html_wrap.cpp @@ -561,11 +561,12 @@ private: } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -575,7 +576,7 @@ private: Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/gtk/wizard_wrap.cpp b/wxPython/src/gtk/wizard_wrap.cpp index 9024c88915..0db174886f 100644 --- a/wxPython/src/gtk/wizard_wrap.cpp +++ b/wxPython/src/gtk/wizard_wrap.cpp @@ -553,11 +553,12 @@ bool wxPyWizardPage_Create(wxPyWizardPage *self,wxWizard *parent,wxBitmap const } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -567,7 +568,7 @@ bool wxPyWizardPage_Create(wxPyWizardPage *self,wxWizard *parent,wxBitmap const Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/msw/_controls_wrap.cpp b/wxPython/src/msw/_controls_wrap.cpp index 91b8aa4d9e..6870a49948 100644 --- a/wxPython/src/msw/_controls_wrap.cpp +++ b/wxPython/src/msw/_controls_wrap.cpp @@ -599,11 +599,12 @@ void wxListBox_SetItemFont(wxListBox *self,int item,wxFont const &f){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -613,7 +614,7 @@ void wxListBox_SetItemFont(wxListBox *self,int item,wxFont const &f){ Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index aa1fa209ce..3b648e08a3 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -865,11 +865,12 @@ PyObject *wxRect_Get(wxRect *self){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -879,7 +880,7 @@ PyObject *wxRect_Get(wxRect *self){ Py_DECREF(o3); } return target; -} + } void wxPoint2D_Set(wxPoint2D *self,double x,double y){ @@ -1554,6 +1555,9 @@ bool wxWindow_UnregisterHotKey(wxWindow *self,int hotkeyId){ long wxWindow_GetHandle(wxWindow *self){ return wxPyGetWinHandle(self); } +void wxWindow_AssociateHandle(wxWindow *self,long handle){ + self->AssociateHandle((WXWidget)handle); + } wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) { return wxWindow::FindWindowById(id, parent); @@ -1906,16 +1910,16 @@ PyObject *wxSizer_GetChildren(wxSizer *self){ wxSizerItemList& list = self->GetChildren(); return wxPy_ConvertList(&list); } -void wxSizer_Show(wxSizer *self,PyObject *item,bool show){ +bool wxSizer_Show(wxSizer *self,PyObject *item,bool show,bool recursive){ bool blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); wxPyEndBlockThreads(blocked); if ( info.window ) - self->Show(info.window, show); + return self->Show(info.window, show, recursive); else if ( info.sizer ) - self->Show(info.sizer, show); + return self->Show(info.sizer, show, recursive); else if ( info.gotPos ) - self->Show(info.pos, show); + return self->Show(info.pos, show); } bool wxSizer_IsShown(wxSizer *self,PyObject *item){ bool blocked = wxPyBeginBlockThreads(); @@ -27451,6 +27455,60 @@ static PyObject *_wrap_Window_GetHandle(PyObject *, PyObject *args, PyObject *kw } +static PyObject *_wrap_Window_AssociateHandle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + long arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "handle", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_AssociateHandle",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (long)SWIG_As_long(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_AssociateHandle(arg1,arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Window_DissociateHandle(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Window_DissociateHandle",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->DissociateHandle(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Window_OnPaint(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; @@ -36422,14 +36480,17 @@ static PyObject *_wrap_Sizer_Show(PyObject *, PyObject *args, PyObject *kwargs) wxSizer *arg1 = (wxSizer *) 0 ; PyObject *arg2 = (PyObject *) 0 ; bool arg3 = (bool) True ; + bool arg4 = (bool) False ; + bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "item",(char *) "show", NULL + (char *) "self",(char *) "item",(char *) "show",(char *) "recursive", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:Sizer_Show",kwnames,&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Sizer_Show",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSizer, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; arg2 = obj1; @@ -36437,14 +36498,20 @@ static PyObject *_wrap_Sizer_Show(PyObject *, PyObject *args, PyObject *kwargs) arg3 = (bool)SWIG_As_bool(obj2); if (PyErr_Occurred()) SWIG_fail; } + if (obj3) { + arg4 = (bool)SWIG_As_bool(obj3); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxSizer_Show(arg1,arg2,arg3); + result = (bool)wxSizer_Show(arg1,arg2,arg3,arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - Py_INCREF(Py_None); resultobj = Py_None; + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } return resultobj; fail: return NULL; @@ -41632,6 +41699,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"Window_PopupMenuXY", (PyCFunction) _wrap_Window_PopupMenuXY, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_PopupMenu", (PyCFunction) _wrap_Window_PopupMenu, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_GetHandle", (PyCFunction) _wrap_Window_GetHandle, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Window_AssociateHandle", (PyCFunction) _wrap_Window_AssociateHandle, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Window_DissociateHandle", (PyCFunction) _wrap_Window_DissociateHandle, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_OnPaint", (PyCFunction) _wrap_Window_OnPaint, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_HasScrollbar", (PyCFunction) _wrap_Window_HasScrollbar, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Window_SetScrollbar", (PyCFunction) _wrap_Window_SetScrollbar, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/msw/_gdi_wrap.cpp b/wxPython/src/msw/_gdi_wrap.cpp index e3c13b0177..5c92db055a 100644 --- a/wxPython/src/msw/_gdi_wrap.cpp +++ b/wxPython/src/msw/_gdi_wrap.cpp @@ -621,11 +621,12 @@ SWIG_Check_int(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -635,7 +636,7 @@ SWIG_Check_int(PyObject* obj) Py_DECREF(o3); } return target; -} + } PyObject *wxPen_GetDashes(wxPen *self){ diff --git a/wxPython/src/msw/_misc_wrap.cpp b/wxPython/src/msw/_misc_wrap.cpp index 9484d00ac2..a981b178de 100644 --- a/wxPython/src/msw/_misc_wrap.cpp +++ b/wxPython/src/msw/_misc_wrap.cpp @@ -470,6 +470,7 @@ SWIG_Check_int(PyObject* obj) return SWIG_AsVal_int(obj, (int*)0); } + static const wxString wxPyWINDOW_DEFAULT_VARIANT(wxWINDOW_DEFAULT_VARIANT); #include @@ -556,11 +557,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -570,7 +572,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } @@ -1932,6 +1934,26 @@ static PyObject * SystemSettings_swigregister(PyObject *, PyObject *args) { Py_INCREF(obj); return Py_BuildValue((char *)""); } +static int _wrap_WINDOW_DEFAULT_VARIANT_set(PyObject *) { + PyErr_SetString(PyExc_TypeError,"Variable WINDOW_DEFAULT_VARIANT is read-only."); + return 1; +} + + +static PyObject *_wrap_WINDOW_DEFAULT_VARIANT_get() { + PyObject *pyobj; + + { +#if wxUSE_UNICODE + pyobj = PyUnicode_FromWideChar((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len()); +#else + pyobj = PyString_FromStringAndSize((&wxPyWINDOW_DEFAULT_VARIANT)->c_str(), (&wxPyWINDOW_DEFAULT_VARIANT)->Len()); +#endif + } + return pyobj; +} + + static PyObject *_wrap_new_SystemOptions(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxSystemOptions *result; @@ -18800,6 +18822,46 @@ static PyObject *_wrap_DateTime_GetWeek(PyObject *, PyObject *args, PyObject *kw } +static PyObject *_wrap_DateTime_SetToWeekOfYear(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + int arg1 ; + int arg2 ; + int arg3 = (int) wxDateTime::Mon ; + wxDateTime result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "year",(char *) "numWeek",(char *) "weekday", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:DateTime_SetToWeekOfYear",kwnames,&obj0,&obj1,&obj2)) goto fail; + arg1 = (int)SWIG_As_int(obj0); + if (PyErr_Occurred()) SWIG_fail; + arg2 = (int)SWIG_As_int(obj1); + if (PyErr_Occurred()) SWIG_fail; + if (obj2) { + arg3 = (int)SWIG_As_int(obj2); + if (PyErr_Occurred()) SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = wxDateTime::SetToWeekOfYear(arg1,arg2,(wxDateTime::WeekDay )arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxDateTime * resultptr; + resultptr = new wxDateTime((wxDateTime &) result); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxDateTime, 1); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_DateTime_SetToLastMonthDay(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; @@ -29027,6 +29089,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"DateTime_GetLastWeekDay", (PyCFunction) _wrap_DateTime_GetLastWeekDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToTheWeek", (PyCFunction) _wrap_DateTime_SetToTheWeek, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_GetWeek", (PyCFunction) _wrap_DateTime_GetWeek, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"DateTime_SetToWeekOfYear", (PyCFunction) _wrap_DateTime_SetToWeekOfYear, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToLastMonthDay", (PyCFunction) _wrap_DateTime_SetToLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_GetLastMonthDay", (PyCFunction) _wrap_DateTime_GetLastMonthDay, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DateTime_SetToYearDay", (PyCFunction) _wrap_DateTime_SetToYearDay, METH_VARARGS | METH_KEYWORDS, NULL }, @@ -30134,6 +30197,7 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"SYS_SCREEN_SMALL", SWIG_From_int((int)wxSYS_SCREEN_SMALL)); PyDict_SetItemString(d,"SYS_SCREEN_DESKTOP", SWIG_From_int((int)wxSYS_SCREEN_DESKTOP)); PyDict_SetItemString(d,(char*)"cvar", SWIG_globals); + SWIG_addvarlink(SWIG_globals,(char*)"WINDOW_DEFAULT_VARIANT",_wrap_WINDOW_DEFAULT_VARIANT_get, _wrap_WINDOW_DEFAULT_VARIANT_set); SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorPromptStr",_wrap_FileSelectorPromptStr_get, _wrap_FileSelectorPromptStr_set); SWIG_addvarlink(SWIG_globals,(char*)"FileSelectorDefaultWildcardStr",_wrap_FileSelectorDefaultWildcardStr_get, _wrap_FileSelectorDefaultWildcardStr_set); SWIG_addvarlink(SWIG_globals,(char*)"DirSelectorPromptStr",_wrap_DirSelectorPromptStr_get, _wrap_DirSelectorPromptStr_set); diff --git a/wxPython/src/msw/_windows_wrap.cpp b/wxPython/src/msw/_windows_wrap.cpp index acb3535b45..25a8b1ddf5 100644 --- a/wxPython/src/msw/_windows_wrap.cpp +++ b/wxPython/src/msw/_windows_wrap.cpp @@ -551,11 +551,12 @@ SWIG_Check_bool(PyObject* obj) } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -565,7 +566,7 @@ SWIG_Check_bool(PyObject* obj) Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/msw/grid_wrap.cpp b/wxPython/src/msw/grid_wrap.cpp index d991c8de68..751e83e3df 100644 --- a/wxPython/src/msw/grid_wrap.cpp +++ b/wxPython/src/msw/grid_wrap.cpp @@ -1203,11 +1203,12 @@ void wxGridCellAttr__setOORInfo(wxGridCellAttr *self,PyObject *_self){ } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -1217,7 +1218,7 @@ void wxGridCellAttr__setOORInfo(wxGridCellAttr *self,PyObject *_self){ Py_DECREF(o3); } return target; -} + } void wxGridCellAttrProvider__setOORInfo(wxGridCellAttrProvider *self,PyObject *_self){ diff --git a/wxPython/src/msw/html_wrap.cpp b/wxPython/src/msw/html_wrap.cpp index 4780525fcd..a1b4bc2942 100644 --- a/wxPython/src/msw/html_wrap.cpp +++ b/wxPython/src/msw/html_wrap.cpp @@ -561,11 +561,12 @@ private: } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -575,7 +576,7 @@ private: Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/src/msw/wizard_wrap.cpp b/wxPython/src/msw/wizard_wrap.cpp index bc0c86b745..43a58b397a 100644 --- a/wxPython/src/msw/wizard_wrap.cpp +++ b/wxPython/src/msw/wizard_wrap.cpp @@ -553,11 +553,12 @@ bool wxPyWizardPage_Create(wxPyWizardPage *self,wxWizard *parent,wxBitmap const } else if (target == Py_None) { Py_DECREF(Py_None); target = o; - } else { - o2 = target; - target = PyTuple_New(1); - PyTuple_SetItem(target, 0, o2); - + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } o3 = PyTuple_New(1); PyTuple_SetItem(o3, 0, o); @@ -567,7 +568,7 @@ bool wxPyWizardPage_Create(wxPyWizardPage *self,wxWizard *parent,wxBitmap const Py_DECREF(o3); } return target; -} + } diff --git a/wxPython/wxPython/_misc.py b/wxPython/wxPython/_misc.py index df06fcc1e2..d9a4334a78 100644 --- a/wxPython/wxPython/_misc.py +++ b/wxPython/wxPython/_misc.py @@ -118,6 +118,7 @@ wxSystemSettings_GetMetric = wx._misc.SystemSettings_GetMetric wxSystemSettings_HasFeature = wx._misc.SystemSettings_HasFeature wxSystemSettings_GetScreenType = wx._misc.SystemSettings_GetScreenType wxSystemSettings_SetScreenType = wx._misc.SystemSettings_SetScreenType +wxWINDOW_DEFAULT_VARIANT = wx._misc.WINDOW_DEFAULT_VARIANT wxSystemOptions = wx._misc.SystemOptions wxSystemOptionsPtr = wx._misc.SystemOptionsPtr wxSystemOptions_SetOption = wx._misc.SystemOptions_SetOption @@ -473,6 +474,7 @@ wxDateTimeFromTimeT = wx._misc.DateTimeFromTimeT wxDateTimeFromJDN = wx._misc.DateTimeFromJDN wxDateTimeFromHMS = wx._misc.DateTimeFromHMS wxDateTimeFromDMY = wx._misc.DateTimeFromDMY +wxDateTime_SetToWeekOfYear = wx._misc.DateTime_SetToWeekOfYear wxTimeSpan = wx._misc.TimeSpan wxTimeSpanPtr = wx._misc.TimeSpanPtr wxTimeSpan_Seconds = wx._misc.TimeSpan_Seconds -- 2.45.2