From 5917d04127f414f0c2cd400581cb1c47395a3479 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 4 Dec 2006 20:40:05 +0000 Subject: [PATCH] Add ToggleWindowStyle git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_window.i | 6 +++++ wxPython/src/gtk/_core.py | 9 +++++++ wxPython/src/gtk/_core_wrap.cpp | 42 +++++++++++++++++++++++++++++++++ wxPython/src/mac/_core.py | 9 +++++++ wxPython/src/mac/_core_wrap.cpp | 42 +++++++++++++++++++++++++++++++++ wxPython/src/msw/_core.py | 9 +++++++ wxPython/src/msw/_core_wrap.cpp | 42 +++++++++++++++++++++++++++++++++ 7 files changed, 159 insertions(+) diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index dae385ad55..b10681fce7 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -812,6 +812,12 @@ method.", ""); windows are only available on X platforms.", ""); + DocDeclStr( + bool , ToggleWindowStyle(int flag), + "Turn the flag on if it had been turned off before and vice versa, +returns True if the flag is turned on by this function call.", ""); + + DocDeclStr( virtual void , SetExtraStyle(long exStyle), diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index a9d60cfe2a..e3e8e8d163 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -8921,6 +8921,15 @@ class Window(EvtHandler): """ return _core_.Window_IsRetained(*args, **kwargs) + def ToggleWindowStyle(*args, **kwargs): + """ + ToggleWindowStyle(self, int flag) -> bool + + Turn the flag on if it had been turned off before and vice versa, + returns True if the flag is turned on by this function call. + """ + return _core_.Window_ToggleWindowStyle(*args, **kwargs) + def SetExtraStyle(*args, **kwargs): """ SetExtraStyle(self, long exStyle) diff --git a/wxPython/src/gtk/_core_wrap.cpp b/wxPython/src/gtk/_core_wrap.cpp index 9b3ae37203..1cc12dc0b7 100644 --- a/wxPython/src/gtk/_core_wrap.cpp +++ b/wxPython/src/gtk/_core_wrap.cpp @@ -35844,6 +35844,47 @@ fail: } +SWIGINTERN PyObject *_wrap_Window_ToggleWindowStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxWindow *arg1 = (wxWindow *) 0 ; + int arg2 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flag", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_ToggleWindowStyle",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxWindow, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_ToggleWindowStyle" "', expected argument " "1"" of type '" "wxWindow *""'"); + } + arg1 = reinterpret_cast< wxWindow * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Window_ToggleWindowStyle" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->ToggleWindowStyle(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Window_SetExtraStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxWindow *arg1 = (wxWindow *) 0 ; @@ -57390,6 +57431,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Window_GetWindowStyleFlag", (PyCFunction)_wrap_Window_GetWindowStyleFlag, METH_O, NULL}, { (char *)"Window_HasFlag", (PyCFunction) _wrap_Window_HasFlag, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_IsRetained", (PyCFunction)_wrap_Window_IsRetained, METH_O, NULL}, + { (char *)"Window_ToggleWindowStyle", (PyCFunction) _wrap_Window_ToggleWindowStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_SetExtraStyle", (PyCFunction) _wrap_Window_SetExtraStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_GetExtraStyle", (PyCFunction)_wrap_Window_GetExtraStyle, METH_O, NULL}, { (char *)"Window_MakeModal", (PyCFunction) _wrap_Window_MakeModal, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index a9d60cfe2a..e3e8e8d163 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -8921,6 +8921,15 @@ class Window(EvtHandler): """ return _core_.Window_IsRetained(*args, **kwargs) + def ToggleWindowStyle(*args, **kwargs): + """ + ToggleWindowStyle(self, int flag) -> bool + + Turn the flag on if it had been turned off before and vice versa, + returns True if the flag is turned on by this function call. + """ + return _core_.Window_ToggleWindowStyle(*args, **kwargs) + def SetExtraStyle(*args, **kwargs): """ SetExtraStyle(self, long exStyle) diff --git a/wxPython/src/mac/_core_wrap.cpp b/wxPython/src/mac/_core_wrap.cpp index 31fb92c888..7ed88a16e5 100644 --- a/wxPython/src/mac/_core_wrap.cpp +++ b/wxPython/src/mac/_core_wrap.cpp @@ -35843,6 +35843,47 @@ fail: } +SWIGINTERN PyObject *_wrap_Window_ToggleWindowStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxWindow *arg1 = (wxWindow *) 0 ; + int arg2 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flag", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_ToggleWindowStyle",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxWindow, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_ToggleWindowStyle" "', expected argument " "1"" of type '" "wxWindow *""'"); + } + arg1 = reinterpret_cast< wxWindow * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Window_ToggleWindowStyle" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->ToggleWindowStyle(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Window_SetExtraStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxWindow *arg1 = (wxWindow *) 0 ; @@ -57389,6 +57430,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Window_GetWindowStyleFlag", (PyCFunction)_wrap_Window_GetWindowStyleFlag, METH_O, NULL}, { (char *)"Window_HasFlag", (PyCFunction) _wrap_Window_HasFlag, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_IsRetained", (PyCFunction)_wrap_Window_IsRetained, METH_O, NULL}, + { (char *)"Window_ToggleWindowStyle", (PyCFunction) _wrap_Window_ToggleWindowStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_SetExtraStyle", (PyCFunction) _wrap_Window_SetExtraStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_GetExtraStyle", (PyCFunction)_wrap_Window_GetExtraStyle, METH_O, NULL}, { (char *)"Window_MakeModal", (PyCFunction) _wrap_Window_MakeModal, METH_VARARGS | METH_KEYWORDS, NULL}, diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index 0d64933d7c..e5794e1ae4 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -8921,6 +8921,15 @@ class Window(EvtHandler): """ return _core_.Window_IsRetained(*args, **kwargs) + def ToggleWindowStyle(*args, **kwargs): + """ + ToggleWindowStyle(self, int flag) -> bool + + Turn the flag on if it had been turned off before and vice versa, + returns True if the flag is turned on by this function call. + """ + return _core_.Window_ToggleWindowStyle(*args, **kwargs) + def SetExtraStyle(*args, **kwargs): """ SetExtraStyle(self, long exStyle) diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index 9feb750fa6..c6a7b1bc0d 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -35828,6 +35828,47 @@ fail: } +SWIGINTERN PyObject *_wrap_Window_ToggleWindowStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { + PyObject *resultobj = 0; + wxWindow *arg1 = (wxWindow *) 0 ; + int arg2 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char * kwnames[] = { + (char *) "self",(char *) "flag", NULL + }; + + if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Window_ToggleWindowStyle",kwnames,&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxWindow, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Window_ToggleWindowStyle" "', expected argument " "1"" of type '" "wxWindow *""'"); + } + arg1 = reinterpret_cast< wxWindow * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Window_ToggleWindowStyle" "', expected argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->ToggleWindowStyle(arg2); + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Window_SetExtraStyle(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; wxWindow *arg1 = (wxWindow *) 0 ; @@ -57415,6 +57456,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Window_GetWindowStyleFlag", (PyCFunction)_wrap_Window_GetWindowStyleFlag, METH_O, NULL}, { (char *)"Window_HasFlag", (PyCFunction) _wrap_Window_HasFlag, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_IsRetained", (PyCFunction)_wrap_Window_IsRetained, METH_O, NULL}, + { (char *)"Window_ToggleWindowStyle", (PyCFunction) _wrap_Window_ToggleWindowStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_SetExtraStyle", (PyCFunction) _wrap_Window_SetExtraStyle, METH_VARARGS | METH_KEYWORDS, NULL}, { (char *)"Window_GetExtraStyle", (PyCFunction)_wrap_Window_GetExtraStyle, METH_O, NULL}, { (char *)"Window_MakeModal", (PyCFunction) _wrap_Window_MakeModal, METH_VARARGS | METH_KEYWORDS, NULL}, -- 2.45.2