From ae5bc7f372d20d4786346a75945a8c19e3092034 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 9 Sep 2006 19:55:17 +0000 Subject: [PATCH] reSWIGtged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/_controls.py | 4 ++ wxPython/src/gtk/_controls_wrap.cpp | 28 ++++++++++++ wxPython/src/gtk/_core.py | 61 ++++++++++++++++++------- wxPython/src/gtk/_core_wrap.cpp | 8 ---- wxPython/src/gtk/_windows.py | 18 ++++++++ wxPython/src/gtk/_windows_wrap.cpp | 70 +++++++++++++++++++++++++++++ wxPython/src/gtk/xrc.py | 6 ++- 7 files changed, 169 insertions(+), 26 deletions(-) diff --git a/wxPython/src/gtk/_controls.py b/wxPython/src/gtk/_controls.py index cc84ea32c1..870ee54057 100644 --- a/wxPython/src/gtk/_controls.py +++ b/wxPython/src/gtk/_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/gtk/_controls_wrap.cpp b/wxPython/src/gtk/_controls_wrap.cpp index 3e25f2bfde..58c611e9c9 100644 --- a/wxPython/src/gtk/_controls_wrap.cpp +++ b/wxPython/src/gtk/_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 ; @@ -45252,6 +45279,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/gtk/_core.py b/wxPython/src/gtk/_core.py index 22f5770d1d..0f58511d30 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_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/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index d40aed18c8..c9cbda4e64 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -56928,14 +56928,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/gtk/_windows.py b/wxPython/src/gtk/_windows.py index 03a6fb9a4d..3ca2280352 100644 --- a/wxPython/src/gtk/_windows.py +++ b/wxPython/src/gtk/_windows.py @@ -2787,6 +2787,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 @@ -2825,6 +2833,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/gtk/_windows_wrap.cpp b/wxPython/src/gtk/_windows_wrap.cpp index 7bd9848b7d..f1cf81ba3a 100644 --- a/wxPython/src/gtk/_windows_wrap.cpp +++ b/wxPython/src/gtk/_windows_wrap.cpp @@ -19571,6 +19571,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 ; @@ -31310,6 +31371,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}, @@ -34009,6 +34071,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/gtk/xrc.py b/wxPython/src/gtk/xrc.py index a6df549366..ecac915e01 100644 --- a/wxPython/src/gtk/xrc.py +++ b/wxPython/src/gtk/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) -- 2.45.2