From b519803b436486ca933d750c990ef64a29551221 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 14 Dec 2004 22:49:50 +0000 Subject: [PATCH 1/1] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/msw/_controls.py | 80 +++++++++ wxPython/src/msw/_controls_wrap.cpp | 252 ++++++++++++++++++++++++++++ wxPython/src/msw/_core.py | 14 +- wxPython/src/msw/_core_wrap.cpp | 51 +++++- wxPython/src/msw/_gdi.py | 34 ++-- wxPython/src/msw/_gdi_wrap.cpp | 86 +++------- wxPython/src/msw/_windows.py | 47 +++++- wxPython/src/msw/_windows_wrap.cpp | 119 ++++++++++++- wxPython/src/msw/grid.py | 1 - wxPython/src/msw/media_wrap.cpp | 2 +- 10 files changed, 587 insertions(+), 99 deletions(-) diff --git a/wxPython/src/msw/_controls.py b/wxPython/src/msw/_controls.py index 826df2a570..046853bdb6 100644 --- a/wxPython/src/msw/_controls.py +++ b/wxPython/src/msw/_controls.py @@ -709,6 +709,84 @@ class ComboBox(Choice): """ return _controls_.ComboBox_Remove(*args, **kwargs) + def IsEditable(*args, **kwargs): + """ + IsEditable(self) -> bool + + Returns True if the combo is ediatable (not read-only.) + """ + return _controls_.ComboBox_IsEditable(*args, **kwargs) + + def Undo(*args, **kwargs): + """ + Undo(self) + + Redoes the last undo in the text field. Windows only. + """ + return _controls_.ComboBox_Undo(*args, **kwargs) + + def Redo(*args, **kwargs): + """ + Redo(self) + + Undoes the last edit in the text field. Windows only. + """ + return _controls_.ComboBox_Redo(*args, **kwargs) + + def SelectAll(*args, **kwargs): + """ + SelectAll(self) + + Select all the text in the combo's text field. + """ + return _controls_.ComboBox_SelectAll(*args, **kwargs) + + def CanCopy(*args, **kwargs): + """ + CanCopy(self) -> bool + + Returns True if the combobox is editable and there is a text selection + to copy to the clipboard. Only available on Windows. + """ + return _controls_.ComboBox_CanCopy(*args, **kwargs) + + def CanCut(*args, **kwargs): + """ + CanCut(self) -> bool + + Returns True if the combobox is editable and there is a text selection + to copy to the clipboard. Only available on Windows. + """ + return _controls_.ComboBox_CanCut(*args, **kwargs) + + def CanPaste(*args, **kwargs): + """ + CanPaste(self) -> bool + + Returns True if the combobox is editable and there is text on the + clipboard that can be pasted into the text field. Only available on + Windows. + """ + return _controls_.ComboBox_CanPaste(*args, **kwargs) + + def CanUndo(*args, **kwargs): + """ + CanUndo(self) -> bool + + Returns True if the combobox is editable and the last edit can be + undone. Only available on Windows. + """ + return _controls_.ComboBox_CanUndo(*args, **kwargs) + + def CanRedo(*args, **kwargs): + """ + CanRedo(self) -> bool + + Returns True if the combobox is editable and the last undo can be + redone. Only available on Windows. + """ + return _controls_.ComboBox_CanRedo(*args, **kwargs) + def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes @@ -3365,6 +3443,8 @@ class NotebookSizerPtr(NotebookSizer): self.__class__ = NotebookSizer _controls_.NotebookSizer_swigregister(NotebookSizerPtr) +NotebookSizer = wx._deprecated(NotebookSizer, "NotebookSizer is no longer needed.") +BookCtrlSizer = wx._deprecated(BookCtrlSizer, "BookCtrlSizer is no longer needed.") #--------------------------------------------------------------------------- TOOL_STYLE_BUTTON = _controls_.TOOL_STYLE_BUTTON diff --git a/wxPython/src/msw/_controls_wrap.cpp b/wxPython/src/msw/_controls_wrap.cpp index b205686c7e..3334c1a69c 100644 --- a/wxPython/src/msw/_controls_wrap.cpp +++ b/wxPython/src/msw/_controls_wrap.cpp @@ -3934,6 +3934,249 @@ static PyObject *_wrap_ComboBox_Remove(PyObject *, PyObject *args, PyObject *kwa } +static PyObject *_wrap_ComboBox_IsEditable(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_IsEditable",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->IsEditable(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_Undo(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_Undo",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->Undo(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_Redo(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_Redo",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->Redo(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_SelectAll(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_SelectAll",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SelectAll(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_CanCopy(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_CanCopy",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->CanCopy(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_CanCut(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_CanCut",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->CanCut(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_CanPaste(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_CanPaste",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->CanPaste(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_CanUndo(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_CanUndo",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->CanUndo(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ComboBox_CanRedo(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ComboBox_CanRedo",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxComboBox, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxComboBox const *)arg1)->CanRedo(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + } + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_ComboBox_GetClassDefaultAttributes(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 = (int) wxWINDOW_VARIANT_NORMAL ; @@ -32039,6 +32282,15 @@ static PyMethodDef SwigMethods[] = { { (char *)"ComboBox_SetEditable", (PyCFunction) _wrap_ComboBox_SetEditable, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"ComboBox_SetInsertionPointEnd", (PyCFunction) _wrap_ComboBox_SetInsertionPointEnd, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"ComboBox_Remove", (PyCFunction) _wrap_ComboBox_Remove, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_IsEditable", (PyCFunction) _wrap_ComboBox_IsEditable, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_Undo", (PyCFunction) _wrap_ComboBox_Undo, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_Redo", (PyCFunction) _wrap_ComboBox_Redo, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_SelectAll", (PyCFunction) _wrap_ComboBox_SelectAll, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_CanCopy", (PyCFunction) _wrap_ComboBox_CanCopy, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_CanCut", (PyCFunction) _wrap_ComboBox_CanCut, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_CanPaste", (PyCFunction) _wrap_ComboBox_CanPaste, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_CanUndo", (PyCFunction) _wrap_ComboBox_CanUndo, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"ComboBox_CanRedo", (PyCFunction) _wrap_ComboBox_CanRedo, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"ComboBox_GetClassDefaultAttributes", (PyCFunction) _wrap_ComboBox_GetClassDefaultAttributes, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"ComboBox_swigregister", ComboBox_swigregister, METH_VARARGS, NULL }, { (char *)"new_Gauge", (PyCFunction) _wrap_new_Gauge, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/msw/_core.py b/wxPython/src/msw/_core.py index 48f8e86e92..ae05c5f67d 100644 --- a/wxPython/src/msw/_core.py +++ b/wxPython/src/msw/_core.py @@ -1160,7 +1160,7 @@ class Rect(object): Inflate(self, int dx, int dy) -> Rect Increase the rectangle size by dx in x direction and dy in y - direction. Both or one of) parameters may be negative to decrease the + direction. Both (or one of) parameters may be negative to decrease the rectangle size. """ return _core_.Rect_Inflate(*args, **kwargs) @@ -1170,7 +1170,7 @@ class Rect(object): Deflate(self, int dx, int dy) -> Rect Decrease the rectangle size by dx in x direction and dy in y - direction. Both or one of) parameters may be negative to increase the + direction. Both (or one of) parameters may be negative to increase the rectngle size. This method is the opposite of Inflate. """ return _core_.Rect_Deflate(*args, **kwargs) @@ -1197,10 +1197,18 @@ class Rect(object): """ Intersect(self, Rect rect) -> Rect - Return the intersectsion of this rectangle and rect. + Returns the intersectsion of this rectangle and rect. """ return _core_.Rect_Intersect(*args, **kwargs) + def Union(*args, **kwargs): + """ + Union(self, Rect rect) -> Rect + + Returns the union of this rectangle and rect. + """ + return _core_.Rect_Union(*args, **kwargs) + def __add__(*args, **kwargs): """ __add__(self, Rect rect) -> Rect diff --git a/wxPython/src/msw/_core_wrap.cpp b/wxPython/src/msw/_core_wrap.cpp index 4b14398963..3f787ca4a2 100644 --- a/wxPython/src/msw/_core_wrap.cpp +++ b/wxPython/src/msw/_core_wrap.cpp @@ -4581,7 +4581,7 @@ static PyObject *_wrap_Rect_Intersect(PyObject *, PyObject *args, PyObject *kwar PyObject *resultobj; wxRect *arg1 = (wxRect *) 0 ; wxRect *arg2 = 0 ; - wxRect *result; + wxRect result; wxRect temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -4598,15 +4598,53 @@ static PyObject *_wrap_Rect_Intersect(PyObject *, PyObject *args, PyObject *kwar } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxRect &_result_ref = (arg1)->Intersect((wxRect const &)*arg2); - result = (wxRect *) &_result_ref; - } + result = (arg1)->Intersect((wxRect const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxRect, 0); + { + wxRect * resultptr; + resultptr = new wxRect((wxRect &) result); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxRect, 1); + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Rect_Union(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxRect *arg1 = (wxRect *) 0 ; + wxRect *arg2 = 0 ; + wxRect result; + wxRect temp2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "rect", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Rect_Union",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxRect, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = &temp2; + if ( ! wxRect_helper(obj1, &arg2)) SWIG_fail; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->Union((wxRect const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { + wxRect * resultptr; + resultptr = new wxRect((wxRect &) result); + resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_wxRect, 1); + } return resultobj; fail: return NULL; @@ -41485,6 +41523,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Rect_OffsetXY", (PyCFunction) _wrap_Rect_OffsetXY, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Rect_Offset", (PyCFunction) _wrap_Rect_Offset, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Rect_Intersect", (PyCFunction) _wrap_Rect_Intersect, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Rect_Union", (PyCFunction) _wrap_Rect_Union, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Rect___add__", (PyCFunction) _wrap_Rect___add__, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Rect___iadd__", (PyCFunction) _wrap_Rect___iadd__, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Rect___eq__", (PyCFunction) _wrap_Rect___eq__, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/msw/_gdi.py b/wxPython/src/msw/_gdi.py index 4cc4861dff..f6b596cc94 100644 --- a/wxPython/src/msw/_gdi.py +++ b/wxPython/src/msw/_gdi.py @@ -249,6 +249,10 @@ class Palette(GDIObject): """GetRGB(self, int pixel) -> (R,G,B)""" return _gdi_.Palette_GetRGB(*args, **kwargs) + def GetColoursCount(*args, **kwargs): + """GetColoursCount(self) -> int""" + return _gdi_.Palette_GetColoursCount(*args, **kwargs) + def Ok(*args, **kwargs): """Ok(self) -> bool""" return _gdi_.Palette_Ok(*args, **kwargs) @@ -3639,31 +3643,13 @@ class DC(_core.Object): """ return _gdi_.DC_SetLogicalFunction(*args, **kwargs) - def SetOptimization(*args, **kwargs): - """ - SetOptimization(self, bool optimize) - - If *optimize* is true this function sets optimization mode on. This - currently means that under X, the device context will not try to set a - pen or brush property if it is known to be set already. This approach - can fall down if non-wxWidgets code is using the same device context - or window, for example when the window is a panel on which the - windowing system draws panel items. The wxWidgets device context - 'memory' will now be out of step with reality. - - Setting optimization off, drawing, then setting it back on again, is a - trick that must occasionally be employed. - """ - return _gdi_.DC_SetOptimization(*args, **kwargs) - - def GetOptimization(*args, **kwargs): - """ - GetOptimization(self) -> bool + def SetOptimization(self, optimize): + pass + def GetOptimization(self): + return False - Returns true if device context optimization is on. See - `SetOptimization` for . - """ - return _gdi_.DC_GetOptimization(*args, **kwargs) + SetOptimization = wx._deprecated(SetOptimization) + GetOptimization = wx._deprecated(GetOptimization) def CalcBoundingBox(*args, **kwargs): """ diff --git a/wxPython/src/msw/_gdi_wrap.cpp b/wxPython/src/msw/_gdi_wrap.cpp index 66728e357a..d799b8bc61 100644 --- a/wxPython/src/msw/_gdi_wrap.cpp +++ b/wxPython/src/msw/_gdi_wrap.cpp @@ -1833,6 +1833,32 @@ static PyObject *_wrap_Palette_GetRGB(PyObject *, PyObject *args, PyObject *kwar } +static PyObject *_wrap_Palette_GetColoursCount(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPalette *arg1 = (wxPalette *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Palette_GetColoursCount",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPalette, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)((wxPalette const *)arg1)->GetColoursCount(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_From_int((int)result); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Palette_Ok(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPalette *arg1 = (wxPalette *) 0 ; @@ -15514,63 +15540,6 @@ static PyObject *_wrap_DC_SetLogicalFunction(PyObject *, PyObject *args, PyObjec } -static PyObject *_wrap_DC_SetOptimization(PyObject *, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxDC *arg1 = (wxDC *) 0 ; - bool arg2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "optimize", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DC_SetOptimization",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxDC, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (bool)SWIG_As_bool(obj1); - if (PyErr_Occurred()) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetOptimization(arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_DC_GetOptimization(PyObject *, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxDC *arg1 = (wxDC *) 0 ; - bool result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:DC_GetOptimization",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxDC, - SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->GetOptimization(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - { - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); - } - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_DC_CalcBoundingBox(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxDC *arg1 = (wxDC *) 0 ; @@ -19479,6 +19448,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"delete_Palette", (PyCFunction) _wrap_delete_Palette, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Palette_GetPixel", (PyCFunction) _wrap_Palette_GetPixel, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Palette_GetRGB", (PyCFunction) _wrap_Palette_GetRGB, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Palette_GetColoursCount", (PyCFunction) _wrap_Palette_GetColoursCount, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Palette_Ok", (PyCFunction) _wrap_Palette_Ok, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Palette_swigregister", Palette_swigregister, METH_VARARGS, NULL }, { (char *)"new_Pen", (PyCFunction) _wrap_new_Pen, METH_VARARGS | METH_KEYWORDS, NULL }, @@ -19898,8 +19868,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"DC_SetAxisOrientation", (PyCFunction) _wrap_DC_SetAxisOrientation, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DC_GetLogicalFunction", (PyCFunction) _wrap_DC_GetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DC_SetLogicalFunction", (PyCFunction) _wrap_DC_SetLogicalFunction, METH_VARARGS | METH_KEYWORDS, NULL }, - { (char *)"DC_SetOptimization", (PyCFunction) _wrap_DC_SetOptimization, METH_VARARGS | METH_KEYWORDS, NULL }, - { (char *)"DC_GetOptimization", (PyCFunction) _wrap_DC_GetOptimization, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DC_CalcBoundingBox", (PyCFunction) _wrap_DC_CalcBoundingBox, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DC_CalcBoundingBoxPoint", (PyCFunction) _wrap_DC_CalcBoundingBoxPoint, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"DC_ResetBoundingBox", (PyCFunction) _wrap_DC_ResetBoundingBox, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/msw/_windows.py b/wxPython/src/msw/_windows.py index 75afa38991..96308eec62 100644 --- a/wxPython/src/msw/_windows.py +++ b/wxPython/src/msw/_windows.py @@ -41,6 +41,29 @@ class Panel(_core.Window): """ return _windows_.Panel_InitDialog(*args, **kwargs) + def SetFocus(*args, **kwargs): + """ + SetFocus(self) + + Overrides `wx.Window.SetFocus`. This method + uses the (undocumented) mix-in class wxControlContainer which manages + the focus and TAB logic for controls which usually have child controls. + In practice, if you call this method and the panel has at least + one child window, then the focus will be given to the child window. + + """ + return _windows_.Panel_SetFocus(*args, **kwargs) + + def SetFocusIgnoringChildren(*args, **kwargs): + """ + SetFocusIgnoringChildren(self) + + In contrast to `SetFocus` (see above) this will set the focus to the + panel even of there are child windows in the panel. This is only + rarely needed. + """ + return _windows_.Panel_SetFocusIgnoringChildren(*args, **kwargs) + def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes @@ -1107,6 +1130,28 @@ class SplitterWindow(_core.Window): """ return _windows_.SplitterWindow_GetSashPosition(*args, **kwargs) + def SetSashGravity(*args, **kwargs): + """ + SetSashGravity(self, double gravity) + + Set the sash gravity. Gravity is a floating-point factor between 0.0 + and 1.0 which controls position of sash while resizing the + `wx.SplitterWindow`. The gravity specifies how much the left/top + window will grow while resizing. + """ + return _windows_.SplitterWindow_SetSashGravity(*args, **kwargs) + + def GetSashGravity(*args, **kwargs): + """ + GetSashGravity(self) -> double + + Gets the sash gravity. + + :see: `SetSashGravity` + + """ + return _windows_.SplitterWindow_GetSashGravity(*args, **kwargs) + def SetMinimumPaneSize(*args, **kwargs): """ SetMinimumPaneSize(self, int min) @@ -3318,7 +3363,7 @@ class MDIChildFrame(Frame): return _windows_.MDIChildFrame_Activate(*args, **kwargs) def Maximize(*args, **kwargs): - """Maximize(self, bool maximize)""" + """Maximize(self, bool maximize=True)""" return _windows_.MDIChildFrame_Maximize(*args, **kwargs) def Restore(*args, **kwargs): diff --git a/wxPython/src/msw/_windows_wrap.cpp b/wxPython/src/msw/_windows_wrap.cpp index 759965097c..d90f2213a7 100644 --- a/wxPython/src/msw/_windows_wrap.cpp +++ b/wxPython/src/msw/_windows_wrap.cpp @@ -1663,6 +1663,56 @@ static PyObject *_wrap_Panel_InitDialog(PyObject *, PyObject *args, PyObject *kw } +static PyObject *_wrap_Panel_SetFocus(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPanel *arg1 = (wxPanel *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Panel_SetFocus",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPanel, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetFocus(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Panel_SetFocusIgnoringChildren(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPanel *arg1 = (wxPanel *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Panel_SetFocusIgnoringChildren",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPanel, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetFocusIgnoringChildren(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Panel_GetClassDefaultAttributes(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 = (int) wxWINDOW_VARIANT_NORMAL ; @@ -6667,6 +6717,61 @@ static PyObject *_wrap_SplitterWindow_GetSashPosition(PyObject *, PyObject *args } +static PyObject *_wrap_SplitterWindow_SetSashGravity(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxSplitterWindow *arg1 = (wxSplitterWindow *) 0 ; + double arg2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "gravity", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:SplitterWindow_SetSashGravity",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSplitterWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (double)SWIG_As_double(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetSashGravity(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_SplitterWindow_GetSashGravity(PyObject *, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxSplitterWindow *arg1 = (wxSplitterWindow *) 0 ; + double result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:SplitterWindow_GetSashGravity",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxSplitterWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (double)((wxSplitterWindow const *)arg1)->GetSashGravity(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_From_double((double)result); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_SplitterWindow_SetMinimumPaneSize(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxSplitterWindow *arg1 = (wxSplitterWindow *) 0 ; @@ -15824,18 +15929,20 @@ static PyObject *_wrap_MDIChildFrame_Activate(PyObject *, PyObject *args, PyObje static PyObject *_wrap_MDIChildFrame_Maximize(PyObject *, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxMDIChildFrame *arg1 = (wxMDIChildFrame *) 0 ; - bool arg2 ; + bool arg2 = (bool) true ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { (char *) "self",(char *) "maximize", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:MDIChildFrame_Maximize",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:MDIChildFrame_Maximize",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxMDIChildFrame, SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; - arg2 = (bool)SWIG_As_bool(obj1); - if (PyErr_Occurred()) SWIG_fail; + if (obj1) { + arg2 = (bool)SWIG_As_bool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); (arg1)->Maximize(arg2); @@ -25555,6 +25662,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"new_PrePanel", (PyCFunction) _wrap_new_PrePanel, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Panel_Create", (PyCFunction) _wrap_Panel_Create, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Panel_InitDialog", (PyCFunction) _wrap_Panel_InitDialog, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Panel_SetFocus", (PyCFunction) _wrap_Panel_SetFocus, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"Panel_SetFocusIgnoringChildren", (PyCFunction) _wrap_Panel_SetFocusIgnoringChildren, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Panel_GetClassDefaultAttributes", (PyCFunction) _wrap_Panel_GetClassDefaultAttributes, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"Panel_swigregister", Panel_swigregister, METH_VARARGS, NULL }, { (char *)"new_ScrolledWindow", (PyCFunction) _wrap_new_ScrolledWindow, METH_VARARGS | METH_KEYWORDS, NULL }, @@ -25686,6 +25795,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"SplitterWindow_GetBorderSize", (PyCFunction) _wrap_SplitterWindow_GetBorderSize, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"SplitterWindow_SetSashPosition", (PyCFunction) _wrap_SplitterWindow_SetSashPosition, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"SplitterWindow_GetSashPosition", (PyCFunction) _wrap_SplitterWindow_GetSashPosition, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"SplitterWindow_SetSashGravity", (PyCFunction) _wrap_SplitterWindow_SetSashGravity, METH_VARARGS | METH_KEYWORDS, NULL }, + { (char *)"SplitterWindow_GetSashGravity", (PyCFunction) _wrap_SplitterWindow_GetSashGravity, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"SplitterWindow_SetMinimumPaneSize", (PyCFunction) _wrap_SplitterWindow_SetMinimumPaneSize, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"SplitterWindow_GetMinimumPaneSize", (PyCFunction) _wrap_SplitterWindow_GetMinimumPaneSize, METH_VARARGS | METH_KEYWORDS, NULL }, { (char *)"SplitterWindow_SashHitTest", (PyCFunction) _wrap_SplitterWindow_SashHitTest, METH_VARARGS | METH_KEYWORDS, NULL }, diff --git a/wxPython/src/msw/grid.py b/wxPython/src/msw/grid.py index 9fdde8a7e7..349997649c 100644 --- a/wxPython/src/msw/grid.py +++ b/wxPython/src/msw/grid.py @@ -2080,7 +2080,6 @@ def PreGrid(*args, **kwargs): """PreGrid() -> Grid""" val = _grid.new_PreGrid(*args, **kwargs) val.thisown = 1 - self._setOORInfo(self) return val def Grid_GetClassDefaultAttributes(*args, **kwargs): diff --git a/wxPython/src/msw/media_wrap.cpp b/wxPython/src/msw/media_wrap.cpp index 32d5be5a46..2eddc34baf 100644 --- a/wxPython/src/msw/media_wrap.cpp +++ b/wxPython/src/msw/media_wrap.cpp @@ -312,7 +312,7 @@ enum wxMediaTimeFormat wxMEDIATIMEFORMAT_TIME=0 }; -class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent +class wxMediaEvent : public wxNotifyEvent { public: wxMediaEvent(wxEventType, int ) { wxPyRaiseNotImplemented(); } -- 2.45.2