From 0d2c9713ecc2a9b0d98d9710940018002aaaaed2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 9 Sep 2006 19:57:09 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/mac/_controls.py | 4 ++ wxPython/src/mac/_controls_wrap.cpp | 28 ++++++++++++ wxPython/src/mac/_core.py | 61 ++++++++++++++++++------- wxPython/src/mac/_core_wrap.cpp | 8 ---- wxPython/src/mac/_windows.py | 18 ++++++++ wxPython/src/mac/_windows_wrap.cpp | 70 +++++++++++++++++++++++++++++ wxPython/src/mac/xrc.py | 6 ++- wxPython/src/mac/xrc_wrap.cpp | 36 ++++++++++++++- wxPython/src/msw/_controls.py | 4 ++ wxPython/src/msw/_controls_wrap.cpp | 28 ++++++++++++ wxPython/src/msw/_core.py | 61 ++++++++++++++++++------- wxPython/src/msw/_core_wrap.cpp | 8 ---- wxPython/src/msw/_windows.py | 18 ++++++++ wxPython/src/msw/_windows_wrap.cpp | 70 +++++++++++++++++++++++++++++ wxPython/src/msw/xrc.py | 6 ++- wxPython/src/msw/xrc_wrap.cpp | 36 ++++++++++++++- 16 files changed, 406 insertions(+), 56 deletions(-) diff --git a/wxPython/src/mac/_controls.py b/wxPython/src/mac/_controls.py index a5b3c45864..b25b2ece19 100644 --- a/wxPython/src/mac/_controls.py +++ b/wxPython/src/mac/_controls.py @@ -904,6 +904,10 @@ class Gauge(_core.Control): """GetValue(self) -> int""" return _controls_.Gauge_GetValue(*args, **kwargs) + def Pulse(*args, **kwargs): + """Pulse(self)""" + return _controls_.Gauge_Pulse(*args, **kwargs) + def IsVertical(*args, **kwargs): """IsVertical(self) -> bool""" return _controls_.Gauge_IsVertical(*args, **kwargs) diff --git a/wxPython/src/mac/_controls_wrap.cpp b/wxPython/src/mac/_controls_wrap.cpp index 32cfe070fe..5db7a6c0e9 100644 --- a/wxPython/src/mac/_controls_wrap.cpp +++ b/wxPython/src/mac/_controls_wrap.cpp @@ -7146,6 +7146,33 @@ fail: } +SWIGINTERN PyObject *_wrap_Gauge_Pulse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxGauge *arg1 = (wxGauge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGauge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Gauge_Pulse" "', expected argument " "1"" of type '" "wxGauge *""'"); + } + arg1 = reinterpret_cast< wxGauge * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->Pulse(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Gauge_IsVertical(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxGauge *arg1 = (wxGauge *) 0 ; @@ -45176,6 +45203,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Gauge_GetRange", (PyCFunction)_wrap_Gauge_GetRange, METH_O, NULL}, { (char *)"Gauge_SetValue", (PyCFunction) _wrap_Gauge_SetValue, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Gauge_GetValue", (PyCFunction)_wrap_Gauge_GetValue, METH_O, NULL}, + { (char *)"Gauge_Pulse", (PyCFunction)_wrap_Gauge_Pulse, METH_O, NULL}, { (char *)"Gauge_IsVertical", (PyCFunction)_wrap_Gauge_IsVertical, METH_O, NULL}, { (char *)"Gauge_SetShadowWidth", (PyCFunction) _wrap_Gauge_SetShadowWidth, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Gauge_GetShadowWidth", (PyCFunction)_wrap_Gauge_GetShadowWidth, METH_O, NULL}, diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index 22f5770d1d..0f58511d30 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -277,14 +277,6 @@ ID_ZOOM_OUT = _core_.ID_ZOOM_OUT ID_UNDELETE = _core_.ID_UNDELETE ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED ID_HIGHEST = _core_.ID_HIGHEST -PD_AUTO_HIDE = _core_.PD_AUTO_HIDE -PD_APP_MODAL = _core_.PD_APP_MODAL -PD_CAN_ABORT = _core_.PD_CAN_ABORT -PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME -PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME -PD_REMAINING_TIME = _core_.PD_REMAINING_TIME -PD_SMOOTH = _core_.PD_SMOOTH -PD_CAN_SKIP = _core_.PD_CAN_SKIP MENU_TEAROFF = _core_.MENU_TEAROFF MB_DOCKABLE = _core_.MB_DOCKABLE NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE @@ -11619,6 +11611,50 @@ class Sizer(Object): item = (item, ) self.Add(*item) + def AddSpacer(self, *args, **kw): + """AddSpacer(int size) --> SizerItem + + Add a spacer that is (size,size) pixels. + """ + if args and type(args[0]) == int: + return self.Add( (args[0],args[0] ), 0) + else: # otherwise stay compatible with old AddSpacer + return self.Add(*args, **kw) + def PrependSpacer(self, *args, **kw): + """PrependSpacer(int size) --> SizerItem + + Prepend a spacer that is (size, size) pixels.""" + if args and type(args[0]) == int: + return self.Prepend( (args[0],args[0] ), 0) + else: # otherwise stay compatible with old PrependSpacer + return self.Prepend(*args, **kw) + def InsertSpacer(self, index, *args, **kw): + """InsertSpacer(int index, int size) --> SizerItem + + Insert a spacer at position index that is (size, size) pixels.""" + if args and type(args[0]) == int: + return self.Insert( index, (args[0],args[0] ), 0) + else: # otherwise stay compatible with old InsertSpacer + return self.Insert(index, *args, **kw) + + + def AddStretchSpacer(self, prop=1): + """AddStretchSpacer(int prop=1) --> SizerItem + + Add a stretchable spacer.""" + return self.Add((0,0), prop) + def PrependStretchSpacer(self, prop=1): + """PrependStretchSpacer(int prop=1) --> SizerItem + + Prepend a stretchable spacer.""" + return self.Prepend((0,0), prop) + def InsertStretchSpacer(self, index, prop=1): + """InsertStretchSpacer(int index, int prop=1) --> SizerItem + + Insert a stretchable spacer.""" + return self.Insert(index, (0,0), prop) + + # for backwards compatibility only, please do not use in new code def AddWindow(self, *args, **kw): """Compatibility alias for `Add`.""" @@ -11626,9 +11662,6 @@ class Sizer(Object): def AddSizer(self, *args, **kw): """Compatibility alias for `Add`.""" return self.Add(*args, **kw) - def AddSpacer(self, *args, **kw): - """Compatibility alias for `Add`.""" - return self.Add(*args, **kw) def PrependWindow(self, *args, **kw): """Compatibility alias for `Prepend`.""" @@ -11636,9 +11669,6 @@ class Sizer(Object): def PrependSizer(self, *args, **kw): """Compatibility alias for `Prepend`.""" return self.Prepend(*args, **kw) - def PrependSpacer(self, *args, **kw): - """Compatibility alias for `Prepend`.""" - return self.Prepend(*args, **kw) def InsertWindow(self, *args, **kw): """Compatibility alias for `Insert`.""" @@ -11646,9 +11676,6 @@ class Sizer(Object): def InsertSizer(self, *args, **kw): """Compatibility alias for `Insert`.""" return self.Insert(*args, **kw) - def InsertSpacer(self, *args, **kw): - """Compatibility alias for `Insert`.""" - return self.Insert(*args, **kw) def RemoveWindow(self, *args, **kw): """Compatibility alias for `Remove`.""" diff --git a/wxPython/src/mac/_core_wrap.cpp b/wxPython/src/mac/_core_wrap.cpp index d8242f3dae..1cae14ad01 100644 --- a/wxPython/src/mac/_core_wrap.cpp +++ b/wxPython/src/mac/_core_wrap.cpp @@ -56927,14 +56927,6 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "ID_UNDELETE",SWIG_From_int(static_cast< int >(wxID_UNDELETE))); SWIG_Python_SetConstant(d, "ID_REVERT_TO_SAVED",SWIG_From_int(static_cast< int >(wxID_REVERT_TO_SAVED))); SWIG_Python_SetConstant(d, "ID_HIGHEST",SWIG_From_int(static_cast< int >(wxID_HIGHEST))); - SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE))); - SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL))); - SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT))); - SWIG_Python_SetConstant(d, "PD_ELAPSED_TIME",SWIG_From_int(static_cast< int >(wxPD_ELAPSED_TIME))); - SWIG_Python_SetConstant(d, "PD_ESTIMATED_TIME",SWIG_From_int(static_cast< int >(wxPD_ESTIMATED_TIME))); - SWIG_Python_SetConstant(d, "PD_REMAINING_TIME",SWIG_From_int(static_cast< int >(wxPD_REMAINING_TIME))); - SWIG_Python_SetConstant(d, "PD_SMOOTH",SWIG_From_int(static_cast< int >(wxPD_SMOOTH))); - SWIG_Python_SetConstant(d, "PD_CAN_SKIP",SWIG_From_int(static_cast< int >(wxPD_CAN_SKIP))); SWIG_Python_SetConstant(d, "MENU_TEAROFF",SWIG_From_int(static_cast< int >(wxMENU_TEAROFF))); SWIG_Python_SetConstant(d, "MB_DOCKABLE",SWIG_From_int(static_cast< int >(wxMB_DOCKABLE))); SWIG_Python_SetConstant(d, "NO_FULL_REPAINT_ON_RESIZE",SWIG_From_int(static_cast< int >(wxNO_FULL_REPAINT_ON_RESIZE))); diff --git a/wxPython/src/mac/_windows.py b/wxPython/src/mac/_windows.py index 2c5a01a809..76c3fc9fcc 100644 --- a/wxPython/src/mac/_windows.py +++ b/wxPython/src/mac/_windows.py @@ -2767,6 +2767,14 @@ class MessageDialog(Dialog): _windows_.MessageDialog_swigregister(MessageDialog) +PD_AUTO_HIDE = _windows_.PD_AUTO_HIDE +PD_APP_MODAL = _windows_.PD_APP_MODAL +PD_CAN_ABORT = _windows_.PD_CAN_ABORT +PD_ELAPSED_TIME = _windows_.PD_ELAPSED_TIME +PD_ESTIMATED_TIME = _windows_.PD_ESTIMATED_TIME +PD_REMAINING_TIME = _windows_.PD_REMAINING_TIME +PD_SMOOTH = _windows_.PD_SMOOTH +PD_CAN_SKIP = _windows_.PD_CAN_SKIP class ProgressDialog(Frame): """ A dialog that shows a short message and a progress bar. Optionally, it @@ -2805,6 +2813,16 @@ class ProgressDialog(Frame): """ return _windows_.ProgressDialog_Update(*args, **kwargs) + def UpdatePulse(*args, **kwargs): + """ + UpdatePulse(self, String newmsg) --> (continue, skip) + + Just like `Update` but switches the dialog to use a gauge in + interminante mode and calls `wx.Gauge.Pulse` to show the user a bit of + progress. + """ + return _windows_.ProgressDialog_UpdatePulse(*args, **kwargs) + def Resume(*args, **kwargs): """ Resume(self) diff --git a/wxPython/src/mac/_windows_wrap.cpp b/wxPython/src/mac/_windows_wrap.cpp index 1c192cc928..9d54e2d372 100644 --- a/wxPython/src/mac/_windows_wrap.cpp +++ b/wxPython/src/mac/_windows_wrap.cpp @@ -19435,6 +19435,67 @@ fail: } +SWIGINTERN PyObject *_wrap_ProgressDialog_UpdatePulse(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxProgressDialog *arg1 = (wxProgressDialog *) 0 ; + wxString const &arg2_defvalue = wxPyEmptyString ; + wxString *arg2 = (wxString *) &arg2_defvalue ; + bool *arg3 = (bool *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + bool temp2 = false ; + bool temp3 ; + int res3 = SWIG_TMPOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "newmsg", NULL + }; + + arg3 = &temp3; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ProgressDialog_UpdatePulse",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxProgressDialog, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProgressDialog_UpdatePulse" "', expected argument " "1"" of type '" "wxProgressDialog *""'"); + } + arg1 = reinterpret_cast< wxProgressDialog * >(argp1); + if (obj1) { + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = true; + } + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->UpdatePulse((wxString const &)*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + if (SWIG_IsTmpObj(res3)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_bool((*arg3))); + } else { + int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_bool, new_flags)); + } + { + if (temp2) + delete arg2; + } + return resultobj; +fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_ProgressDialog_Resume(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxProgressDialog *arg1 = (wxProgressDialog *) 0 ; @@ -31171,6 +31232,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"MessageDialog_swiginit", MessageDialog_swiginit, METH_VARARGS, NULL}, { (char *)"new_ProgressDialog", (PyCFunction) _wrap_new_ProgressDialog, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"ProgressDialog_Update", (PyCFunction) _wrap_ProgressDialog_Update, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"ProgressDialog_UpdatePulse", (PyCFunction) _wrap_ProgressDialog_UpdatePulse, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"ProgressDialog_Resume", (PyCFunction)_wrap_ProgressDialog_Resume, METH_O, NULL}, { (char *)"ProgressDialog_swigregister", ProgressDialog_swigregister, METH_VARARGS, NULL}, { (char *)"ProgressDialog_swiginit", ProgressDialog_swiginit, METH_VARARGS, NULL}, @@ -33870,6 +33932,14 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "CHOICEDLG_STYLE",SWIG_From_int(static_cast< int >(wxCHOICEDLG_STYLE))); SWIG_Python_SetConstant(d, "TextEntryDialogStyle",SWIG_From_int(static_cast< int >(wxTextEntryDialogStyle))); SWIG_addvarlink(SWIG_globals(),(char*)"GetPasswordFromUserPromptStr",GetPasswordFromUserPromptStr_get, GetPasswordFromUserPromptStr_set); + SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE))); + SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL))); + SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT))); + SWIG_Python_SetConstant(d, "PD_ELAPSED_TIME",SWIG_From_int(static_cast< int >(wxPD_ELAPSED_TIME))); + SWIG_Python_SetConstant(d, "PD_ESTIMATED_TIME",SWIG_From_int(static_cast< int >(wxPD_ESTIMATED_TIME))); + SWIG_Python_SetConstant(d, "PD_REMAINING_TIME",SWIG_From_int(static_cast< int >(wxPD_REMAINING_TIME))); + SWIG_Python_SetConstant(d, "PD_SMOOTH",SWIG_From_int(static_cast< int >(wxPD_SMOOTH))); + SWIG_Python_SetConstant(d, "PD_CAN_SKIP",SWIG_From_int(static_cast< int >(wxPD_CAN_SKIP))); SWIG_Python_SetConstant(d, "FR_DOWN",SWIG_From_int(static_cast< int >(wxFR_DOWN))); SWIG_Python_SetConstant(d, "FR_WHOLEWORD",SWIG_From_int(static_cast< int >(wxFR_WHOLEWORD))); SWIG_Python_SetConstant(d, "FR_MATCHCASE",SWIG_From_int(static_cast< int >(wxFR_MATCHCASE))); diff --git a/wxPython/src/mac/xrc.py b/wxPython/src/mac/xrc.py index a6df549366..ecac915e01 100644 --- a/wxPython/src/mac/xrc.py +++ b/wxPython/src/mac/xrc.py @@ -335,7 +335,7 @@ class XmlNode(object): return _xrc.XmlNode_AddChild(*args, **kwargs) def InsertChild(*args, **kwargs): - """InsertChild(self, XmlNode child, XmlNode before_node)""" + """InsertChild(self, XmlNode child, XmlNode before_node) -> bool""" return _xrc.XmlNode_InsertChild(*args, **kwargs) def RemoveChild(*args, **kwargs): @@ -466,6 +466,10 @@ class XmlDocument(_core.Object): """GetFileEncoding(self) -> String""" return _xrc.XmlDocument_GetFileEncoding(*args, **kwargs) + def DetachRoot(*args, **kwargs): + """DetachRoot(self) -> XmlNode""" + return _xrc.XmlDocument_DetachRoot(*args, **kwargs) + def SetRoot(*args, **kwargs): """SetRoot(self, XmlNode node)""" return _xrc.XmlDocument_SetRoot(*args, **kwargs) diff --git a/wxPython/src/mac/xrc_wrap.cpp b/wxPython/src/mac/xrc_wrap.cpp index a45d2e8cef..b16bbb0b07 100644 --- a/wxPython/src/mac/xrc_wrap.cpp +++ b/wxPython/src/mac/xrc_wrap.cpp @@ -5339,6 +5339,7 @@ SWIGINTERN PyObject *_wrap_XmlNode_InsertChild(PyObject *SWIGUNUSEDPARM(self), P wxXmlNode *arg1 = (wxXmlNode *) 0 ; wxXmlNode *arg2 = (wxXmlNode *) 0 ; wxXmlNode *arg3 = (wxXmlNode *) 0 ; + bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -5370,11 +5371,13 @@ SWIGINTERN PyObject *_wrap_XmlNode_InsertChild(PyObject *SWIGUNUSEDPARM(self), P arg3 = reinterpret_cast< wxXmlNode * >(argp3); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->InsertChild(arg2,arg3); + result = (bool)(arg1)->InsertChild(arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_Py_Void(); + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } return resultobj; fail: return NULL; @@ -6710,6 +6713,34 @@ fail: } +SWIGINTERN PyObject *_wrap_XmlDocument_DetachRoot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxXmlDocument *arg1 = (wxXmlDocument *) 0 ; + wxXmlNode *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxXmlDocument, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmlDocument_DetachRoot" "', expected argument " "1"" of type '" "wxXmlDocument *""'"); + } + arg1 = reinterpret_cast< wxXmlDocument * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxXmlNode *)(arg1)->DetachRoot(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wxXmlNode, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_XmlDocument_SetRoot(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxXmlDocument *arg1 = (wxXmlDocument *) 0 ; @@ -8554,6 +8585,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"XmlDocument_GetRoot", (PyCFunction)_wrap_XmlDocument_GetRoot, METH_O, NULL}, { (char *)"XmlDocument_GetVersion", (PyCFunction)_wrap_XmlDocument_GetVersion, METH_O, NULL}, { (char *)"XmlDocument_GetFileEncoding", (PyCFunction)_wrap_XmlDocument_GetFileEncoding, METH_O, NULL}, + { (char *)"XmlDocument_DetachRoot", (PyCFunction)_wrap_XmlDocument_DetachRoot, METH_O, NULL}, { (char *)"XmlDocument_SetRoot", (PyCFunction) _wrap_XmlDocument_SetRoot, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"XmlDocument_SetVersion", (PyCFunction) _wrap_XmlDocument_SetVersion, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"XmlDocument_SetFileEncoding", (PyCFunction) _wrap_XmlDocument_SetFileEncoding, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/wxPython/src/msw/_controls.py b/wxPython/src/msw/_controls.py index 1e14bbefe4..f3db67ccf1 100644 --- a/wxPython/src/msw/_controls.py +++ b/wxPython/src/msw/_controls.py @@ -910,6 +910,10 @@ class Gauge(_core.Control): """GetValue(self) -> int""" return _controls_.Gauge_GetValue(*args, **kwargs) + def Pulse(*args, **kwargs): + """Pulse(self)""" + return _controls_.Gauge_Pulse(*args, **kwargs) + def IsVertical(*args, **kwargs): """IsVertical(self) -> bool""" return _controls_.Gauge_IsVertical(*args, **kwargs) diff --git a/wxPython/src/msw/_controls_wrap.cpp b/wxPython/src/msw/_controls_wrap.cpp index f179ec2177..981f2aef49 100644 --- a/wxPython/src/msw/_controls_wrap.cpp +++ b/wxPython/src/msw/_controls_wrap.cpp @@ -7193,6 +7193,33 @@ fail: } +SWIGINTERN PyObject *_wrap_Gauge_Pulse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxGauge *arg1 = (wxGauge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxGauge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Gauge_Pulse" "', expected argument " "1"" of type '" "wxGauge *""'"); + } + arg1 = reinterpret_cast< wxGauge * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->Pulse(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Gauge_IsVertical(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxGauge *arg1 = (wxGauge *) 0 ; @@ -45464,6 +45491,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Gauge_GetRange", (PyCFunction)_wrap_Gauge_GetRange, METH_O, NULL}, { (char *)"Gauge_SetValue", (PyCFunction) _wrap_Gauge_SetValue, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Gauge_GetValue", (PyCFunction)_wrap_Gauge_GetValue, METH_O, NULL}, + { (char *)"Gauge_Pulse", (PyCFunction)_wrap_Gauge_Pulse, METH_O, NULL}, { (char *)"Gauge_IsVertical", (PyCFunction)_wrap_Gauge_IsVertical, METH_O, NULL}, { (char *)"Gauge_SetShadowWidth", (PyCFunction) _wrap_Gauge_SetShadowWidth, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Gauge_GetShadowWidth", (PyCFunction)_wrap_Gauge_GetShadowWidth, METH_O, NULL}, diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index 9b1c84df36..5ada107ae2 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -277,14 +277,6 @@ ID_ZOOM_OUT = _core_.ID_ZOOM_OUT ID_UNDELETE = _core_.ID_UNDELETE ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED ID_HIGHEST = _core_.ID_HIGHEST -PD_AUTO_HIDE = _core_.PD_AUTO_HIDE -PD_APP_MODAL = _core_.PD_APP_MODAL -PD_CAN_ABORT = _core_.PD_CAN_ABORT -PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME -PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME -PD_REMAINING_TIME = _core_.PD_REMAINING_TIME -PD_SMOOTH = _core_.PD_SMOOTH -PD_CAN_SKIP = _core_.PD_CAN_SKIP MENU_TEAROFF = _core_.MENU_TEAROFF MB_DOCKABLE = _core_.MB_DOCKABLE NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE @@ -11623,6 +11615,50 @@ class Sizer(Object): item = (item, ) self.Add(*item) + def AddSpacer(self, *args, **kw): + """AddSpacer(int size) --> SizerItem + + Add a spacer that is (size,size) pixels. + """ + if args and type(args[0]) == int: + return self.Add( (args[0],args[0] ), 0) + else: # otherwise stay compatible with old AddSpacer + return self.Add(*args, **kw) + def PrependSpacer(self, *args, **kw): + """PrependSpacer(int size) --> SizerItem + + Prepend a spacer that is (size, size) pixels.""" + if args and type(args[0]) == int: + return self.Prepend( (args[0],args[0] ), 0) + else: # otherwise stay compatible with old PrependSpacer + return self.Prepend(*args, **kw) + def InsertSpacer(self, index, *args, **kw): + """InsertSpacer(int index, int size) --> SizerItem + + Insert a spacer at position index that is (size, size) pixels.""" + if args and type(args[0]) == int: + return self.Insert( index, (args[0],args[0] ), 0) + else: # otherwise stay compatible with old InsertSpacer + return self.Insert(index, *args, **kw) + + + def AddStretchSpacer(self, prop=1): + """AddStretchSpacer(int prop=1) --> SizerItem + + Add a stretchable spacer.""" + return self.Add((0,0), prop) + def PrependStretchSpacer(self, prop=1): + """PrependStretchSpacer(int prop=1) --> SizerItem + + Prepend a stretchable spacer.""" + return self.Prepend((0,0), prop) + def InsertStretchSpacer(self, index, prop=1): + """InsertStretchSpacer(int index, int prop=1) --> SizerItem + + Insert a stretchable spacer.""" + return self.Insert(index, (0,0), prop) + + # for backwards compatibility only, please do not use in new code def AddWindow(self, *args, **kw): """Compatibility alias for `Add`.""" @@ -11630,9 +11666,6 @@ class Sizer(Object): def AddSizer(self, *args, **kw): """Compatibility alias for `Add`.""" return self.Add(*args, **kw) - def AddSpacer(self, *args, **kw): - """Compatibility alias for `Add`.""" - return self.Add(*args, **kw) def PrependWindow(self, *args, **kw): """Compatibility alias for `Prepend`.""" @@ -11640,9 +11673,6 @@ class Sizer(Object): def PrependSizer(self, *args, **kw): """Compatibility alias for `Prepend`.""" return self.Prepend(*args, **kw) - def PrependSpacer(self, *args, **kw): - """Compatibility alias for `Prepend`.""" - return self.Prepend(*args, **kw) def InsertWindow(self, *args, **kw): """Compatibility alias for `Insert`.""" @@ -11650,9 +11680,6 @@ class Sizer(Object): def InsertSizer(self, *args, **kw): """Compatibility alias for `Insert`.""" return self.Insert(*args, **kw) - def InsertSpacer(self, *args, **kw): - """Compatibility alias for `Insert`.""" - return self.Insert(*args, **kw) def RemoveWindow(self, *args, **kw): """Compatibility alias for `Remove`.""" diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index 9122579b19..ec26a8c32f 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -56954,14 +56954,6 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "ID_UNDELETE",SWIG_From_int(static_cast< int >(wxID_UNDELETE))); SWIG_Python_SetConstant(d, "ID_REVERT_TO_SAVED",SWIG_From_int(static_cast< int >(wxID_REVERT_TO_SAVED))); SWIG_Python_SetConstant(d, "ID_HIGHEST",SWIG_From_int(static_cast< int >(wxID_HIGHEST))); - SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE))); - SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL))); - SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT))); - SWIG_Python_SetConstant(d, "PD_ELAPSED_TIME",SWIG_From_int(static_cast< int >(wxPD_ELAPSED_TIME))); - SWIG_Python_SetConstant(d, "PD_ESTIMATED_TIME",SWIG_From_int(static_cast< int >(wxPD_ESTIMATED_TIME))); - SWIG_Python_SetConstant(d, "PD_REMAINING_TIME",SWIG_From_int(static_cast< int >(wxPD_REMAINING_TIME))); - SWIG_Python_SetConstant(d, "PD_SMOOTH",SWIG_From_int(static_cast< int >(wxPD_SMOOTH))); - SWIG_Python_SetConstant(d, "PD_CAN_SKIP",SWIG_From_int(static_cast< int >(wxPD_CAN_SKIP))); SWIG_Python_SetConstant(d, "MENU_TEAROFF",SWIG_From_int(static_cast< int >(wxMENU_TEAROFF))); SWIG_Python_SetConstant(d, "MB_DOCKABLE",SWIG_From_int(static_cast< int >(wxMB_DOCKABLE))); SWIG_Python_SetConstant(d, "NO_FULL_REPAINT_ON_RESIZE",SWIG_From_int(static_cast< int >(wxNO_FULL_REPAINT_ON_RESIZE))); diff --git a/wxPython/src/msw/_windows.py b/wxPython/src/msw/_windows.py index 30e35fc853..483b40a0f9 100644 --- a/wxPython/src/msw/_windows.py +++ b/wxPython/src/msw/_windows.py @@ -2795,6 +2795,14 @@ class MessageDialog(Dialog): _windows_.MessageDialog_swigregister(MessageDialog) +PD_AUTO_HIDE = _windows_.PD_AUTO_HIDE +PD_APP_MODAL = _windows_.PD_APP_MODAL +PD_CAN_ABORT = _windows_.PD_CAN_ABORT +PD_ELAPSED_TIME = _windows_.PD_ELAPSED_TIME +PD_ESTIMATED_TIME = _windows_.PD_ESTIMATED_TIME +PD_REMAINING_TIME = _windows_.PD_REMAINING_TIME +PD_SMOOTH = _windows_.PD_SMOOTH +PD_CAN_SKIP = _windows_.PD_CAN_SKIP class ProgressDialog(Frame): """ A dialog that shows a short message and a progress bar. Optionally, it @@ -2833,6 +2841,16 @@ class ProgressDialog(Frame): """ return _windows_.ProgressDialog_Update(*args, **kwargs) + def UpdatePulse(*args, **kwargs): + """ + UpdatePulse(self, String newmsg) --> (continue, skip) + + Just like `Update` but switches the dialog to use a gauge in + interminante mode and calls `wx.Gauge.Pulse` to show the user a bit of + progress. + """ + return _windows_.ProgressDialog_UpdatePulse(*args, **kwargs) + def Resume(*args, **kwargs): """ Resume(self) diff --git a/wxPython/src/msw/_windows_wrap.cpp b/wxPython/src/msw/_windows_wrap.cpp index ab57bee34a..9fcfff09fa 100644 --- a/wxPython/src/msw/_windows_wrap.cpp +++ b/wxPython/src/msw/_windows_wrap.cpp @@ -19634,6 +19634,67 @@ fail: } +SWIGINTERN PyObject *_wrap_ProgressDialog_UpdatePulse(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxProgressDialog *arg1 = (wxProgressDialog *) 0 ; + wxString const &arg2_defvalue = wxPyEmptyString ; + wxString *arg2 = (wxString *) &arg2_defvalue ; + bool *arg3 = (bool *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + bool temp2 = false ; + bool temp3 ; + int res3 = SWIG_TMPOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "newmsg", NULL + }; + + arg3 = &temp3; + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ProgressDialog_UpdatePulse",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxProgressDialog, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProgressDialog_UpdatePulse" "', expected argument " "1"" of type '" "wxProgressDialog *""'"); + } + arg1 = reinterpret_cast< wxProgressDialog * >(argp1); + if (obj1) { + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = true; + } + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->UpdatePulse((wxString const &)*arg2,arg3); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + if (SWIG_IsTmpObj(res3)) { + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_bool((*arg3))); + } else { + int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN | 0 ) : 0 ; + resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_bool, new_flags)); + } + { + if (temp2) + delete arg2; + } + return resultobj; +fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + SWIGINTERN PyObject *_wrap_ProgressDialog_Resume(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; wxProgressDialog *arg1 = (wxProgressDialog *) 0 ; @@ -31443,6 +31504,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"MessageDialog_swiginit", MessageDialog_swiginit, METH_VARARGS, NULL}, { (char *)"new_ProgressDialog", (PyCFunction) _wrap_new_ProgressDialog, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"ProgressDialog_Update", (PyCFunction) _wrap_ProgressDialog_Update, METH_VARARGS | METH_KEYWORDS, NULL}, + { (char *)"ProgressDialog_UpdatePulse", (PyCFunction) _wrap_ProgressDialog_UpdatePulse, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"ProgressDialog_Resume", (PyCFunction)_wrap_ProgressDialog_Resume, METH_O, NULL}, { (char *)"ProgressDialog_swigregister", ProgressDialog_swigregister, METH_VARARGS, NULL}, { (char *)"ProgressDialog_swiginit", ProgressDialog_swiginit, METH_VARARGS, NULL}, @@ -34144,6 +34206,14 @@ SWIGEXPORT void SWIG_init(void) { SWIG_Python_SetConstant(d, "CHOICEDLG_STYLE",SWIG_From_int(static_cast< int >(wxCHOICEDLG_STYLE))); SWIG_Python_SetConstant(d, "TextEntryDialogStyle",SWIG_From_int(static_cast< int >(wxTextEntryDialogStyle))); SWIG_addvarlink(SWIG_globals(),(char*)"GetPasswordFromUserPromptStr",GetPasswordFromUserPromptStr_get, GetPasswordFromUserPromptStr_set); + SWIG_Python_SetConstant(d, "PD_AUTO_HIDE",SWIG_From_int(static_cast< int >(wxPD_AUTO_HIDE))); + SWIG_Python_SetConstant(d, "PD_APP_MODAL",SWIG_From_int(static_cast< int >(wxPD_APP_MODAL))); + SWIG_Python_SetConstant(d, "PD_CAN_ABORT",SWIG_From_int(static_cast< int >(wxPD_CAN_ABORT))); + SWIG_Python_SetConstant(d, "PD_ELAPSED_TIME",SWIG_From_int(static_cast< int >(wxPD_ELAPSED_TIME))); + SWIG_Python_SetConstant(d, "PD_ESTIMATED_TIME",SWIG_From_int(static_cast< int >(wxPD_ESTIMATED_TIME))); + SWIG_Python_SetConstant(d, "PD_REMAINING_TIME",SWIG_From_int(static_cast< int >(wxPD_REMAINING_TIME))); + SWIG_Python_SetConstant(d, "PD_SMOOTH",SWIG_From_int(static_cast< int >(wxPD_SMOOTH))); + SWIG_Python_SetConstant(d, "PD_CAN_SKIP",SWIG_From_int(static_cast< int >(wxPD_CAN_SKIP))); SWIG_Python_SetConstant(d, "FR_DOWN",SWIG_From_int(static_cast< int >(wxFR_DOWN))); SWIG_Python_SetConstant(d, "FR_WHOLEWORD",SWIG_From_int(static_cast< int >(wxFR_WHOLEWORD))); SWIG_Python_SetConstant(d, "FR_MATCHCASE",SWIG_From_int(static_cast< int >(wxFR_MATCHCASE))); diff --git a/wxPython/src/msw/xrc.py b/wxPython/src/msw/xrc.py index a6df549366..ecac915e01 100644 --- a/wxPython/src/msw/xrc.py +++ b/wxPython/src/msw/xrc.py @@ -335,7 +335,7 @@ class XmlNode(object): return _xrc.XmlNode_AddChild(*args, **kwargs) def InsertChild(*args, **kwargs): - """InsertChild(self, XmlNode child, XmlNode before_node)""" + """InsertChild(self, XmlNode child, XmlNode before_node) -> bool""" return _xrc.XmlNode_InsertChild(*args, **kwargs) def RemoveChild(*args, **kwargs): @@ -466,6 +466,10 @@ class XmlDocument(_core.Object): """GetFileEncoding(self) -> String""" return _xrc.XmlDocument_GetFileEncoding(*args, **kwargs) + def DetachRoot(*args, **kwargs): + """DetachRoot(self) -> XmlNode""" + return _xrc.XmlDocument_DetachRoot(*args, **kwargs) + def SetRoot(*args, **kwargs): """SetRoot(self, XmlNode node)""" return _xrc.XmlDocument_SetRoot(*args, **kwargs) diff --git a/wxPython/src/msw/xrc_wrap.cpp b/wxPython/src/msw/xrc_wrap.cpp index a45d2e8cef..b16bbb0b07 100644 --- a/wxPython/src/msw/xrc_wrap.cpp +++ b/wxPython/src/msw/xrc_wrap.cpp @@ -5339,6 +5339,7 @@ SWIGINTERN PyObject *_wrap_XmlNode_InsertChild(PyObject *SWIGUNUSEDPARM(self), P wxXmlNode *arg1 = (wxXmlNode *) 0 ; wxXmlNode *arg2 = (wxXmlNode *) 0 ; wxXmlNode *arg3 = (wxXmlNode *) 0 ; + bool result; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; @@ -5370,11 +5371,13 @@ SWIGINTERN PyObject *_wrap_XmlNode_InsertChild(PyObject *SWIGUNUSEDPARM(self), P arg3 = reinterpret_cast< wxXmlNode * >(argp3); { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->InsertChild(arg2,arg3); + result = (bool)(arg1)->InsertChild(arg2,arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_Py_Void(); + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } return resultobj; fail: return NULL; @@ -6710,6 +6713,34 @@ fail: } +SWIGINTERN PyObject *_wrap_XmlDocument_DetachRoot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + wxXmlDocument *arg1 = (wxXmlDocument *) 0 ; + wxXmlNode *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxXmlDocument, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "XmlDocument_DetachRoot" "', expected argument " "1"" of type '" "wxXmlDocument *""'"); + } + arg1 = reinterpret_cast< wxXmlDocument * >(argp1); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxXmlNode *)(arg1)->DetachRoot(); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wxXmlNode, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_XmlDocument_SetRoot(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxXmlDocument *arg1 = (wxXmlDocument *) 0 ; @@ -8554,6 +8585,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"XmlDocument_GetRoot", (PyCFunction)_wrap_XmlDocument_GetRoot, METH_O, NULL}, { (char *)"XmlDocument_GetVersion", (PyCFunction)_wrap_XmlDocument_GetVersion, METH_O, NULL}, { (char *)"XmlDocument_GetFileEncoding", (PyCFunction)_wrap_XmlDocument_GetFileEncoding, METH_O, NULL}, + { (char *)"XmlDocument_DetachRoot", (PyCFunction)_wrap_XmlDocument_DetachRoot, METH_O, NULL}, { (char *)"XmlDocument_SetRoot", (PyCFunction) _wrap_XmlDocument_SetRoot, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"XmlDocument_SetVersion", (PyCFunction) _wrap_XmlDocument_SetVersion, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"XmlDocument_SetFileEncoding", (PyCFunction) _wrap_XmlDocument_SetFileEncoding, METH_VARARGS | METH_KEYWORDS, NULL}, -- 2.45.2