From 10be44acb0b54de1903eabf99a78b28a74f7be75 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 28 Jul 2001 03:29:34 +0000 Subject: [PATCH] Various tweaks, fixes, and additions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/controls2.py | 6 ++ wxPython/src/gtk/html.cpp | 28 --------- wxPython/src/gtk/html.py | 3 - wxPython/src/gtk/windows.cpp | 111 ++++++++++++++++++++++++++++++++++ wxPython/src/gtk/windows.py | 9 +++ 5 files changed, 126 insertions(+), 31 deletions(-) diff --git a/wxPython/src/gtk/controls2.py b/wxPython/src/gtk/controls2.py index db98bc29b5..6bc6177d98 100644 --- a/wxPython/src/gtk/controls2.py +++ b/wxPython/src/gtk/controls2.py @@ -467,6 +467,12 @@ class wxListCtrlPtr(wxControlPtr): return val def __repr__(self): return "" % (self.this,) + + def GetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) + val.thisown = 1 + return val + class wxListCtrl(wxListCtrlPtr): def __init__(self,*_args,**_kwargs): self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs) diff --git a/wxPython/src/gtk/html.cpp b/wxPython/src/gtk/html.cpp index 85d278f1b9..a8e0417fb9 100644 --- a/wxPython/src/gtk/html.cpp +++ b/wxPython/src/gtk/html.cpp @@ -741,33 +741,6 @@ static PyObject *_wrap_wxHtmlTag_GetAllParams(PyObject *self, PyObject *args, Py return _resultobj; } -#define wxHtmlTag_IsEnding(_swigobj) (_swigobj->IsEnding()) -static PyObject *_wrap_wxHtmlTag_IsEnding(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxHtmlTag * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlTag_IsEnding",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlTag_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlTag_IsEnding. Expected _wxHtmlTag_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxHtmlTag_IsEnding(_arg0); - - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - #define wxHtmlTag_HasEnding(_swigobj) (_swigobj->HasEnding()) static PyObject *_wrap_wxHtmlTag_HasEnding(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -6240,7 +6213,6 @@ static PyMethodDef htmlcMethods[] = { { "wxHtmlTag_GetEndPos1", (PyCFunction) _wrap_wxHtmlTag_GetEndPos1, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_GetBeginPos", (PyCFunction) _wrap_wxHtmlTag_GetBeginPos, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_HasEnding", (PyCFunction) _wrap_wxHtmlTag_HasEnding, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlTag_IsEnding", (PyCFunction) _wrap_wxHtmlTag_IsEnding, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_GetAllParams", (PyCFunction) _wrap_wxHtmlTag_GetAllParams, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_GetParam", (PyCFunction) _wrap_wxHtmlTag_GetParam, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_HasParam", (PyCFunction) _wrap_wxHtmlTag_HasParam, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/html.py b/wxPython/src/gtk/html.py index 360cba1a4d..ba5cd8f56e 100644 --- a/wxPython/src/gtk/html.py +++ b/wxPython/src/gtk/html.py @@ -90,9 +90,6 @@ class wxHtmlTagPtr(wxObjectPtr): def GetAllParams(self, *_args, **_kwargs): val = apply(htmlc.wxHtmlTag_GetAllParams,(self,) + _args, _kwargs) return val - def IsEnding(self, *_args, **_kwargs): - val = apply(htmlc.wxHtmlTag_IsEnding,(self,) + _args, _kwargs) - return val def HasEnding(self, *_args, **_kwargs): val = apply(htmlc.wxHtmlTag_HasEnding,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/gtk/windows.cpp b/wxPython/src/gtk/windows.cpp index 220770b362..f0137c5ac4 100644 --- a/wxPython/src/gtk/windows.cpp +++ b/wxPython/src/gtk/windows.cpp @@ -5213,6 +5213,62 @@ static PyObject *_wrap_wxWindow_GetCaret(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define wxWindow_Freeze(_swigobj) (_swigobj->Freeze()) +static PyObject *_wrap_wxWindow_Freeze(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_Freeze",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_Freeze. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_Freeze(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_Thaw(_swigobj) (_swigobj->Thaw()) +static PyObject *_wrap_wxWindow_Thaw(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_Thaw",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_Thaw. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_Thaw(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxPanelTowxWindow(void *ptr) { wxPanel *src; wxWindow *dest; @@ -8533,6 +8589,58 @@ static PyObject *_wrap_wxMenuBar_GetLabelTop(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxMenuBar_FindMenu(_swigobj,_swigarg0) (_swigobj->FindMenu(_swigarg0)) +static PyObject *_wrap_wxMenuBar_FindMenu(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMenuBar * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","title", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMenuBar_FindMenu",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenuBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuBar_FindMenu. Expected _wxMenuBar_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMenuBar_FindMenu(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + #define wxMenuBar_FindMenuItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->FindMenuItem(_swigarg0,_swigarg1)) static PyObject *_wrap_wxMenuBar_FindMenuItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -9803,6 +9911,7 @@ static PyMethodDef windowscMethods[] = { { "wxMenuBar_Enable", (PyCFunction) _wrap_wxMenuBar_Enable, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_FindItemById", (PyCFunction) _wrap_wxMenuBar_FindItemById, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_FindMenuItem", (PyCFunction) _wrap_wxMenuBar_FindMenuItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenuBar_FindMenu", (PyCFunction) _wrap_wxMenuBar_FindMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_GetLabelTop", (PyCFunction) _wrap_wxMenuBar_GetLabelTop, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_SetLabelTop", (PyCFunction) _wrap_wxMenuBar_SetLabelTop, METH_VARARGS | METH_KEYWORDS }, { "wxMenuBar_EnableTop", (PyCFunction) _wrap_wxMenuBar_EnableTop, METH_VARARGS | METH_KEYWORDS }, @@ -9888,6 +9997,8 @@ static PyMethodDef windowscMethods[] = { { "wxPanel_GetDefaultItem", (PyCFunction) _wrap_wxPanel_GetDefaultItem, METH_VARARGS | METH_KEYWORDS }, { "wxPanel_InitDialog", (PyCFunction) _wrap_wxPanel_InitDialog, METH_VARARGS | METH_KEYWORDS }, { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_Thaw", (PyCFunction) _wrap_wxWindow_Thaw, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_Freeze", (PyCFunction) _wrap_wxWindow_Freeze, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetCaret", (PyCFunction) _wrap_wxWindow_GetCaret, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetCaret", (PyCFunction) _wrap_wxWindow_SetCaret, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetBestSize", (PyCFunction) _wrap_wxWindow_GetBestSize, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py index 4be342684d..737508249c 100644 --- a/wxPython/src/gtk/windows.py +++ b/wxPython/src/gtk/windows.py @@ -505,6 +505,12 @@ class wxWindowPtr(wxEvtHandlerPtr): val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) if val: val = wxCaretPtr(val) return val + def Freeze(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_Freeze,(self,) + _args, _kwargs) + return val + def Thaw(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_Thaw,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) # replaces broken shadow method @@ -828,6 +834,9 @@ class wxMenuBarPtr(wxWindowPtr): def GetLabelTop(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_GetLabelTop,(self,) + _args, _kwargs) return val + def FindMenu(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuBar_FindMenu,(self,) + _args, _kwargs) + return val def FindMenuItem(self, *_args, **_kwargs): val = apply(windowsc.wxMenuBar_FindMenuItem,(self,) + _args, _kwargs) return val