From 85247b36714d520cf2ebb92fe6b4fc039f2db9d0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 22 Jan 2002 21:00:33 +0000 Subject: [PATCH] SWIGged updates for wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/controls2.i | 8 +- wxPython/src/gtk/cmndlgs.cpp | 246 ++++++++++++++++++++++++++++++++- wxPython/src/gtk/cmndlgs.py | 22 +++ wxPython/src/gtk/controls.cpp | 50 +++++++ wxPython/src/gtk/controls.py | 3 + wxPython/src/gtk/controls2.cpp | 164 ++-------------------- wxPython/src/gtk/gdi.cpp | 83 +++++++++++ wxPython/src/gtk/gdi.py | 7 + wxPython/src/gtk/grid.cpp | 2 +- wxPython/src/gtk/html.cpp | 63 ++++++++- wxPython/src/gtk/html.py | 3 + wxPython/src/gtk/misc2.cpp | 2 +- wxPython/src/gtk/windows3.cpp | 87 +++++++++++- wxPython/src/gtk/windows3.py | 6 + wxPython/src/gtk/wx.cpp | 4 +- wxPython/src/gtk/wx.py | 14 +- 16 files changed, 589 insertions(+), 175 deletions(-) diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 5e4c8aff58..ebbb299a32 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -1308,11 +1308,11 @@ class wxGenericDirCtrl: public wxControl { public: wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1, - const wxString &dir = wxDirDialogDefaultFolderStr, + const char* dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const wxString& filter = wxEmptyString, + const char* filter = wxEmptyString, int defaultFilter = 0, const char* name = "dirCtrl" ); %name(wxPreGenericDirCtrl)wxGenericDirCtrl(); @@ -1321,11 +1321,11 @@ public: %pragma(python) addtomethod = "wxPreGenericDirCtrl:val._setOORInfo(val)" bool Create(wxWindow *parent, const wxWindowID id = -1, - const wxString &dir = wxDirDialogDefaultFolderStr, + const char* dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - const wxString& filter = wxEmptyString, + const char* filter = wxEmptyString, int defaultFilter = 0, const char* name = "dirCtrl" ); diff --git a/wxPython/src/gtk/cmndlgs.cpp b/wxPython/src/gtk/cmndlgs.cpp index 1fc94629ac..bc3740ee79 100644 --- a/wxPython/src/gtk/cmndlgs.cpp +++ b/wxPython/src/gtk/cmndlgs.cpp @@ -1535,6 +1535,241 @@ static PyObject *_wrap_wxFileDialog_GetPaths(PyObject *self, PyObject *args, PyO return _resultobj; } +static void *SwigwxMultiChoiceDialogTowxDialog(void *ptr) { + wxMultiChoiceDialog *src; + wxDialog *dest; + src = (wxMultiChoiceDialog *) ptr; + dest = (wxDialog *) src; + return (void *) dest; +} + +static void *SwigwxMultiChoiceDialogTowxTopLevelWindow(void *ptr) { + wxMultiChoiceDialog *src; + wxTopLevelWindow *dest; + src = (wxMultiChoiceDialog *) ptr; + dest = (wxTopLevelWindow *) src; + return (void *) dest; +} + +static void *SwigwxMultiChoiceDialogTowxWindow(void *ptr) { + wxMultiChoiceDialog *src; + wxWindow *dest; + src = (wxMultiChoiceDialog *) ptr; + dest = (wxWindow *) src; + return (void *) dest; +} + +static void *SwigwxMultiChoiceDialogTowxEvtHandler(void *ptr) { + wxMultiChoiceDialog *src; + wxEvtHandler *dest; + src = (wxMultiChoiceDialog *) ptr; + dest = (wxEvtHandler *) src; + return (void *) dest; +} + +static void *SwigwxMultiChoiceDialogTowxObject(void *ptr) { + wxMultiChoiceDialog *src; + wxObject *dest; + src = (wxMultiChoiceDialog *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxMultiChoiceDialog(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxMultiChoiceDialog(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) +static PyObject *_wrap_new_wxMultiChoiceDialog(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMultiChoiceDialog * _result; + wxWindow * _arg0; + wxString * _arg1; + wxString * _arg2; + int _arg3; + wxString * _arg4; + long _arg5 = (long ) (wxCHOICEDLG_STYLE); + wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _obj4 = 0; + wxPoint temp; + PyObject * _obj6 = 0; + char *_kwnames[] = { "parent","message","caption","choices","style","pos", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO|lO:new_wxMultiChoiceDialog",_kwnames,&_argo0,&_obj1,&_obj2,&_obj4,&_arg5,&_obj6)) + 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 new_wxMultiChoiceDialog. Expected _wxWindow_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 +} +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} + if (_obj4) +{ + _arg4 = wxString_LIST_helper(_obj4); + if (_arg4 == NULL) { + return NULL; + } +} + if (_obj6) +{ + _arg6 = &temp; + if (! wxPoint_helper(_obj6, &_arg6)) + return NULL; +} +{ + if (_obj4) { + _arg3 = PyList_Size(_obj4); + } + else { + _arg3 = 0; + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxMultiChoiceDialog *)new_wxMultiChoiceDialog(_arg0,*_arg1,*_arg2,_arg3,_arg4,_arg5,*_arg6); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMultiChoiceDialog_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + delete [] _arg4; +} + return _resultobj; +} + +#define wxMultiChoiceDialog_SetSelections(_swigobj,_swigarg0) (_swigobj->SetSelections(_swigarg0)) +static PyObject *_wrap_wxMultiChoiceDialog_SetSelections(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMultiChoiceDialog * _arg0; + wxArrayInt * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","selections", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMultiChoiceDialog_SetSelections",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMultiChoiceDialog_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMultiChoiceDialog_SetSelections. Expected _wxMultiChoiceDialog_p."); + return NULL; + } + } +{ + if (! PySequence_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "Sequence of integers expected."); + return NULL; + } + _arg1 = new wxArrayInt; + int i, len=PySequence_Length(_obj1); + for (i=0; iAdd(PyInt_AS_LONG(number)); + Py_DECREF(item); + Py_DECREF(number); + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMultiChoiceDialog_SetSelections(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +static PyObject * wxMultiChoiceDialog_GetSelections(wxMultiChoiceDialog *self) { + return wxArrayInt2PyList_helper(self->GetSelections()); + } +static PyObject *_wrap_wxMultiChoiceDialog_GetSelections(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + PyObject * _result; + wxMultiChoiceDialog * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMultiChoiceDialog_GetSelections",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMultiChoiceDialog_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMultiChoiceDialog_GetSelections. Expected _wxMultiChoiceDialog_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (PyObject *)wxMultiChoiceDialog_GetSelections(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = _result; +} + return _resultobj; +} + static void *SwigwxSingleChoiceDialogTowxDialog(void *ptr) { wxSingleChoiceDialog *src; wxDialog *dest; @@ -1588,7 +1823,7 @@ static PyObject *_wrap_new_wxSingleChoiceDialog(PyObject *self, PyObject *args, wxString * _arg2; int _arg3; wxString * _arg4; - long _arg5 = (long ) wxOK|wxCANCEL|wxCENTRE; + long _arg5 = (long ) (wxCHOICEDLG_STYLE); wxPoint * _arg6 = (wxPoint *) &wxDefaultPosition; PyObject * _argo0 = 0; PyObject * _obj1 = 0; @@ -3857,6 +4092,9 @@ static PyMethodDef cmndlgscMethods[] = { { "wxSingleChoiceDialog_GetStringSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetStringSelection, METH_VARARGS | METH_KEYWORDS }, { "wxSingleChoiceDialog_GetSelection", (PyCFunction) _wrap_wxSingleChoiceDialog_GetSelection, METH_VARARGS | METH_KEYWORDS }, { "new_wxSingleChoiceDialog", (PyCFunction) _wrap_new_wxSingleChoiceDialog, METH_VARARGS | METH_KEYWORDS }, + { "wxMultiChoiceDialog_GetSelections", (PyCFunction) _wrap_wxMultiChoiceDialog_GetSelections, METH_VARARGS | METH_KEYWORDS }, + { "wxMultiChoiceDialog_SetSelections", (PyCFunction) _wrap_wxMultiChoiceDialog_SetSelections, METH_VARARGS | METH_KEYWORDS }, + { "new_wxMultiChoiceDialog", (PyCFunction) _wrap_new_wxMultiChoiceDialog, METH_VARARGS | METH_KEYWORDS }, { "wxFileDialog_GetPaths", (PyCFunction) _wrap_wxFileDialog_GetPaths, METH_VARARGS | METH_KEYWORDS }, { "wxFileDialog_GetFilenames", (PyCFunction) _wrap_wxFileDialog_GetFilenames, METH_VARARGS | METH_KEYWORDS }, { "wxFileDialog_ShowModal", (PyCFunction) _wrap_wxFileDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, @@ -3929,6 +4167,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxTopLevelWindow","_wxFontDialog",SwigwxFontDialogTowxTopLevelWindow}, { "_wxTopLevelWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxTopLevelWindow}, { "_wxTopLevelWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxTopLevelWindow}, + { "_wxTopLevelWindow","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxTopLevelWindow}, { "_wxTopLevelWindow","_wxFileDialog",SwigwxFileDialogTowxTopLevelWindow}, { "_wxTopLevelWindow","_wxDirDialog",SwigwxDirDialogTowxTopLevelWindow}, { "_wxTopLevelWindow","_wxColourDialog",SwigwxColourDialogTowxTopLevelWindow}, @@ -3969,6 +4208,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxFontData",SwigwxFontDataTowxObject}, { "_wxObject","_wxTextEntryDialog",SwigwxTextEntryDialogTowxObject}, { "_wxObject","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxObject}, + { "_wxObject","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxObject}, { "_wxObject","_wxFileDialog",SwigwxFileDialogTowxObject}, { "_wxObject","_wxDirDialog",SwigwxDirDialogTowxObject}, { "_wxObject","_wxColourDialog",SwigwxColourDialogTowxObject}, @@ -3988,6 +4228,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxDialog","_wxFontDialog",SwigwxFontDialogTowxDialog}, { "_wxDialog","_wxTextEntryDialog",SwigwxTextEntryDialogTowxDialog}, { "_wxDialog","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxDialog}, + { "_wxDialog","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxDialog}, { "_wxDialog","_wxFileDialog",SwigwxFileDialogTowxDialog}, { "_wxDialog","_wxDirDialog",SwigwxDirDialogTowxDialog}, { "_wxDialog","_wxColourDialog",SwigwxColourDialogTowxDialog}, @@ -4035,6 +4276,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvtHandler","_wxFontDialog",SwigwxFontDialogTowxEvtHandler}, { "_wxEvtHandler","_wxTextEntryDialog",SwigwxTextEntryDialogTowxEvtHandler}, { "_wxEvtHandler","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxEvtHandler}, + { "_wxEvtHandler","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxEvtHandler}, { "_wxEvtHandler","_wxFileDialog",SwigwxFileDialogTowxEvtHandler}, { "_wxEvtHandler","_wxDirDialog",SwigwxDirDialogTowxEvtHandler}, { "_wxEvtHandler","_wxColourDialog",SwigwxColourDialogTowxEvtHandler}, @@ -4044,6 +4286,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxWindow","_wxFontDialog",SwigwxFontDialogTowxWindow}, { "_wxWindow","_wxTextEntryDialog",SwigwxTextEntryDialogTowxWindow}, { "_wxWindow","_wxSingleChoiceDialog",SwigwxSingleChoiceDialogTowxWindow}, + { "_wxWindow","_wxMultiChoiceDialog",SwigwxMultiChoiceDialogTowxWindow}, { "_wxWindow","_wxFileDialog",SwigwxFileDialogTowxWindow}, { "_wxWindow","_wxDirDialog",SwigwxDirDialogTowxWindow}, { "_wxWindow","_wxColourDialog",SwigwxColourDialogTowxWindow}, @@ -4058,6 +4301,7 @@ SWIGEXPORT(void) initcmndlgsc() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("cmndlgsc", cmndlgscMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxCHOICEDLG_STYLE", PyInt_FromLong((long) wxCHOICEDLG_STYLE)); PyDict_SetItemString(d,"wxFR_DOWN", PyInt_FromLong((long) wxFR_DOWN)); PyDict_SetItemString(d,"wxFR_WHOLEWORD", PyInt_FromLong((long) wxFR_WHOLEWORD)); PyDict_SetItemString(d,"wxFR_MATCHCASE", PyInt_FromLong((long) wxFR_MATCHCASE)); diff --git a/wxPython/src/gtk/cmndlgs.py b/wxPython/src/gtk/cmndlgs.py index 45912c3c49..d9d51fdd0f 100644 --- a/wxPython/src/gtk/cmndlgs.py +++ b/wxPython/src/gtk/cmndlgs.py @@ -193,6 +193,27 @@ class wxFileDialog(wxFileDialogPtr): +class wxMultiChoiceDialogPtr(wxDialogPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def SetSelections(self, *_args, **_kwargs): + val = apply(cmndlgsc.wxMultiChoiceDialog_SetSelections,(self,) + _args, _kwargs) + return val + def GetSelections(self, *_args, **_kwargs): + val = apply(cmndlgsc.wxMultiChoiceDialog_GetSelections,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxMultiChoiceDialog(wxMultiChoiceDialogPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(cmndlgsc.new_wxMultiChoiceDialog,_args,_kwargs) + self.thisown = 1 + self._setOORInfo(self) + + + + class wxSingleChoiceDialogPtr(wxDialogPtr): def __init__(self,this): self.this = this @@ -474,6 +495,7 @@ def wxPreFindReplaceDialog(*_args,**_kwargs): #-------------- VARIABLE WRAPPERS ------------------ +wxCHOICEDLG_STYLE = cmndlgsc.wxCHOICEDLG_STYLE wxFR_DOWN = cmndlgsc.wxFR_DOWN wxFR_WHOLEWORD = cmndlgsc.wxFR_WHOLEWORD wxFR_MATCHCASE = cmndlgsc.wxFR_MATCHCASE diff --git a/wxPython/src/gtk/controls.cpp b/wxPython/src/gtk/controls.cpp index b9d35eea14..5895421a60 100644 --- a/wxPython/src/gtk/controls.cpp +++ b/wxPython/src/gtk/controls.cpp @@ -886,6 +886,55 @@ static PyObject *_wrap_wxControlWithItems_SetClientData(PyObject *self, PyObject return _resultobj; } +#define wxControlWithItems_AppendItems(_swigobj,_swigarg0) (_swigobj->Append(_swigarg0)) +static PyObject *_wrap_wxControlWithItems_AppendItems(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxControlWithItems * _arg0; + wxArrayString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","strings", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxControlWithItems_AppendItems",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxControlWithItems_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxControlWithItems_AppendItems. Expected _wxControlWithItems_p."); + return NULL; + } + } +{ + if (! PySequence_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "Sequence of strings expected."); + return NULL; + } + _arg1 = new wxArrayString; + int i, len=PySequence_Length(_obj1); + for (i=0; iAdd(PyString_AsString(str)); + Py_DECREF(item); + Py_DECREF(str); + } +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxControlWithItems_AppendItems(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + static void *SwigwxButtonTowxControl(void *ptr) { wxButton *src; wxControl *dest; @@ -11715,6 +11764,7 @@ static PyMethodDef controlscMethods[] = { { "wxButton_Create", (PyCFunction) _wrap_wxButton_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreButton", (PyCFunction) _wrap_new_wxPreButton, METH_VARARGS | METH_KEYWORDS }, { "new_wxButton", (PyCFunction) _wrap_new_wxButton, METH_VARARGS | METH_KEYWORDS }, + { "wxControlWithItems_AppendItems", (PyCFunction) _wrap_wxControlWithItems_AppendItems, METH_VARARGS | METH_KEYWORDS }, { "wxControlWithItems_SetClientData", (PyCFunction) _wrap_wxControlWithItems_SetClientData, METH_VARARGS | METH_KEYWORDS }, { "wxControlWithItems_GetClientData", (PyCFunction) _wrap_wxControlWithItems_GetClientData, METH_VARARGS | METH_KEYWORDS }, { "wxControlWithItems_Append", (PyCFunction) _wrap_wxControlWithItems_Append, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 2ffe4c41e1..3cff310f32 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -81,6 +81,9 @@ class wxControlWithItemsPtr(wxControlPtr): def SetClientData(self, *_args, **_kwargs): val = apply(controlsc.wxControlWithItems_SetClientData,(self,) + _args, _kwargs) return val + def AppendItems(self, *_args, **_kwargs): + val = apply(controlsc.wxControlWithItems_AppendItems,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) Number = GetCount diff --git a/wxPython/src/gtk/controls2.cpp b/wxPython/src/gtk/controls2.cpp index 432e264d70..6d91146573 100644 --- a/wxPython/src/gtk/controls2.cpp +++ b/wxPython/src/gtk/controls2.cpp @@ -9833,26 +9833,23 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb wxGenericDirCtrl * _result; wxWindow * _arg0; wxWindowID _arg1 = (wxWindowID ) -1; - wxString * _arg2 = (wxString *) &wxDirDialogDefaultFolderStr; + char * _arg2 = (char *) wxDirDialogDefaultFolderStr; wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; wxSize * _arg4 = (wxSize *) &wxDefaultSize; long _arg5 = (long ) (wxDIRCTRL_3D_INTERNAL)|wxSUNKEN_BORDER; - wxString * _arg6 = (wxString *) &wxEmptyString; + char * _arg6 = (char *) wxEmptyString; int _arg7 = (int ) 0; - wxString * _arg8 = (wxString *) &"dirCtrl"; + char * _arg8 = (char *) "dirCtrl"; PyObject * _argo0 = 0; - PyObject * _obj2 = 0; wxPoint temp; PyObject * _obj3 = 0; wxSize temp0; PyObject * _obj4 = 0; - PyObject * _obj6 = 0; - PyObject * _obj8 = 0; char *_kwnames[] = { "parent","id","dir","pos","size","style","filter","defaultFilter","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOOlOiO:new_wxGenericDirCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_obj6,&_arg7,&_obj8)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|isOOlsis:new_wxGenericDirCtrl",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6,&_arg7,&_arg8)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9861,25 +9858,6 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb return NULL; } } - if (_obj2) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif -} if (_obj3) { _arg3 = &temp; @@ -9891,48 +9869,10 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb _arg4 = &temp0; if (! wxSize_helper(_obj4, &_arg4)) return NULL; -} - if (_obj6) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj6) && !PyUnicode_Check(_obj6)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj6, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg6 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj6)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg6 = new wxString(PyString_AS_STRING(_obj6), PyString_GET_SIZE(_obj6)); -#endif -} - if (_obj8) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj8) && !PyUnicode_Check(_obj8)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj8, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg8 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj8)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg8 = new wxString(PyString_AS_STRING(_obj8), PyString_GET_SIZE(_obj8)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxGenericDirCtrl *)new_wxGenericDirCtrl(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7,*_arg8); + _result = (wxGenericDirCtrl *)new_wxGenericDirCtrl(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6,_arg7,_arg8); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -9943,18 +9883,6 @@ static PyObject *_wrap_new_wxGenericDirCtrl(PyObject *self, PyObject *args, PyOb Py_INCREF(Py_None); _resultobj = Py_None; } -{ - if (_obj2) - delete _arg2; -} -{ - if (_obj6) - delete _arg6; -} -{ - if (_obj8) - delete _arg8; -} return _resultobj; } @@ -9991,26 +9919,23 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P wxGenericDirCtrl * _arg0; wxWindow * _arg1; wxWindowID _arg2 = (wxWindowID ) -1; - wxString * _arg3 = (wxString *) &wxDirDialogDefaultFolderStr; + char * _arg3 = (char *) wxDirDialogDefaultFolderStr; wxPoint * _arg4 = (wxPoint *) &wxDefaultPosition; wxSize * _arg5 = (wxSize *) &wxDefaultSize; long _arg6 = (long ) (wxDIRCTRL_3D_INTERNAL)|wxSUNKEN_BORDER; - wxString * _arg7 = (wxString *) &wxEmptyString; + char * _arg7 = (char *) wxEmptyString; int _arg8 = (int ) 0; - wxString * _arg9 = (wxString *) &"treeCtrl"; + char * _arg9 = (char *) "dirCtrl"; PyObject * _argo0 = 0; PyObject * _argo1 = 0; - PyObject * _obj3 = 0; wxPoint temp; PyObject * _obj4 = 0; wxSize temp0; PyObject * _obj5 = 0; - PyObject * _obj7 = 0; - PyObject * _obj9 = 0; char *_kwnames[] = { "self","parent","id","dir","pos","size","style","filter","defaultFilter","name", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOOlOiO:wxGenericDirCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_obj5,&_arg6,&_obj7,&_arg8,&_obj9)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|isOOlsis:wxGenericDirCtrl_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_arg3,&_obj4,&_obj5,&_arg6,&_arg7,&_arg8,&_arg9)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -10026,25 +9951,6 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P return NULL; } } - if (_obj3) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg3 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj3)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); -#endif -} if (_obj4) { _arg4 = &temp; @@ -10056,64 +9962,14 @@ static PyObject *_wrap_wxGenericDirCtrl_Create(PyObject *self, PyObject *args, P _arg5 = &temp0; if (! wxSize_helper(_obj5, &_arg5)) return NULL; -} - if (_obj7) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj7) && !PyUnicode_Check(_obj7)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj7, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg7 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj7)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg7 = new wxString(PyString_AS_STRING(_obj7), PyString_GET_SIZE(_obj7)); -#endif -} - if (_obj9) -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj9) && !PyUnicode_Check(_obj9)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj9, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg9 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj9)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg9 = new wxString(PyString_AS_STRING(_obj9), PyString_GET_SIZE(_obj9)); -#endif } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxGenericDirCtrl_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,*_arg5,_arg6,*_arg7,_arg8,*_arg9); + _result = (bool )wxGenericDirCtrl_Create(_arg0,_arg1,_arg2,_arg3,*_arg4,*_arg5,_arg6,_arg7,_arg8,_arg9); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("i",_result); -{ - if (_obj3) - delete _arg3; -} -{ - if (_obj7) - delete _arg7; -} -{ - if (_obj9) - delete _arg9; -} return _resultobj; } diff --git a/wxPython/src/gtk/gdi.cpp b/wxPython/src/gtk/gdi.cpp index a37a1886d9..ebbdd0ece3 100644 --- a/wxPython/src/gtk/gdi.cpp +++ b/wxPython/src/gtk/gdi.cpp @@ -2608,6 +2608,34 @@ static PyObject *_wrap_wxNativeFontInfo_FromXFontName(PyObject *self, PyObject * return _resultobj; } +#define wxNativeFontInfo_IsDefault(_swigobj) (_swigobj->IsDefault()) +static PyObject *_wrap_wxNativeFontInfo_IsDefault(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxNativeFontInfo * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxNativeFontInfo_IsDefault",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNativeFontInfo_IsDefault. Expected _wxNativeFontInfo_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxNativeFontInfo_IsDefault(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxNativeFontInfo_GetXFontName(_swigobj) (_swigobj->GetXFontName()) static PyObject *_wrap_wxNativeFontInfo_GetXFontName(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2641,6 +2669,58 @@ static PyObject *_wrap_wxNativeFontInfo_GetXFontName(PyObject *self, PyObject *a return _resultobj; } +#define wxNativeFontInfo_SetXFontName(_swigobj,_swigarg0) (_swigobj->SetXFontName(_swigarg0)) +static PyObject *_wrap_wxNativeFontInfo_SetXFontName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxNativeFontInfo * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","xFontName", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxNativeFontInfo_SetXFontName",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxNativeFontInfo_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxNativeFontInfo_SetXFontName. Expected _wxNativeFontInfo_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 +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxNativeFontInfo_SetXFontName(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + #define new_wxNativeFontInfo() (new wxNativeFontInfo()) static PyObject *_wrap_new_wxNativeFontInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -11691,7 +11771,9 @@ static PyMethodDef gdicMethods[] = { { "wxNativeFontInfo_FromString", (PyCFunction) _wrap_wxNativeFontInfo_FromString, METH_VARARGS | METH_KEYWORDS }, { "wxNativeFontInfo_Init", (PyCFunction) _wrap_wxNativeFontInfo_Init, METH_VARARGS | METH_KEYWORDS }, { "new_wxNativeFontInfo", (PyCFunction) _wrap_new_wxNativeFontInfo, METH_VARARGS | METH_KEYWORDS }, + { "wxNativeFontInfo_SetXFontName", (PyCFunction) _wrap_wxNativeFontInfo_SetXFontName, METH_VARARGS | METH_KEYWORDS }, { "wxNativeFontInfo_GetXFontName", (PyCFunction) _wrap_wxNativeFontInfo_GetXFontName, METH_VARARGS | METH_KEYWORDS }, + { "wxNativeFontInfo_IsDefault", (PyCFunction) _wrap_wxNativeFontInfo_IsDefault, METH_VARARGS | METH_KEYWORDS }, { "wxNativeFontInfo_FromXFontName", (PyCFunction) _wrap_wxNativeFontInfo_FromXFontName, METH_VARARGS | METH_KEYWORDS }, { "wxCursor_Ok", (PyCFunction) _wrap_wxCursor_Ok, METH_VARARGS | METH_KEYWORDS }, { "delete_wxCursor", (PyCFunction) _wrap_delete_wxCursor, METH_VARARGS | METH_KEYWORDS }, @@ -11900,6 +11982,7 @@ SWIGEXPORT(void) initgdic() { PyDict_SetItemString(d,"wxFONTFAMILY_MODERN", PyInt_FromLong((long) wxFONTFAMILY_MODERN)); PyDict_SetItemString(d,"wxFONTFAMILY_TELETYPE", PyInt_FromLong((long) wxFONTFAMILY_TELETYPE)); PyDict_SetItemString(d,"wxFONTFAMILY_MAX", PyInt_FromLong((long) wxFONTFAMILY_MAX)); + PyDict_SetItemString(d,"wxFONTFAMILY_UNKNOWN", PyInt_FromLong((long) wxFONTFAMILY_UNKNOWN)); PyDict_SetItemString(d,"wxFONTSTYLE_NORMAL", PyInt_FromLong((long) wxFONTSTYLE_NORMAL)); PyDict_SetItemString(d,"wxFONTSTYLE_ITALIC", PyInt_FromLong((long) wxFONTSTYLE_ITALIC)); PyDict_SetItemString(d,"wxFONTSTYLE_SLANT", PyInt_FromLong((long) wxFONTSTYLE_SLANT)); diff --git a/wxPython/src/gtk/gdi.py b/wxPython/src/gtk/gdi.py index e23930badd..838bc80602 100644 --- a/wxPython/src/gtk/gdi.py +++ b/wxPython/src/gtk/gdi.py @@ -193,9 +193,15 @@ class wxNativeFontInfoPtr : def FromXFontName(self, *_args, **_kwargs): val = apply(gdic.wxNativeFontInfo_FromXFontName,(self,) + _args, _kwargs) return val + def IsDefault(self, *_args, **_kwargs): + val = apply(gdic.wxNativeFontInfo_IsDefault,(self,) + _args, _kwargs) + return val def GetXFontName(self, *_args, **_kwargs): val = apply(gdic.wxNativeFontInfo_GetXFontName,(self,) + _args, _kwargs) return val + def SetXFontName(self, *_args, **_kwargs): + val = apply(gdic.wxNativeFontInfo_SetXFontName,(self,) + _args, _kwargs) + return val def Init(self, *_args, **_kwargs): val = apply(gdic.wxNativeFontInfo_Init,(self,) + _args, _kwargs) return val @@ -1270,6 +1276,7 @@ wxFONTFAMILY_SWISS = gdic.wxFONTFAMILY_SWISS wxFONTFAMILY_MODERN = gdic.wxFONTFAMILY_MODERN wxFONTFAMILY_TELETYPE = gdic.wxFONTFAMILY_TELETYPE wxFONTFAMILY_MAX = gdic.wxFONTFAMILY_MAX +wxFONTFAMILY_UNKNOWN = gdic.wxFONTFAMILY_UNKNOWN wxFONTSTYLE_NORMAL = gdic.wxFONTSTYLE_NORMAL wxFONTSTYLE_ITALIC = gdic.wxFONTSTYLE_ITALIC wxFONTSTYLE_SLANT = gdic.wxFONTSTYLE_SLANT diff --git a/wxPython/src/gtk/grid.cpp b/wxPython/src/gtk/grid.cpp index b98632f8c5..70512a9921 100644 --- a/wxPython/src/gtk/grid.cpp +++ b/wxPython/src/gtk/grid.cpp @@ -7861,7 +7861,7 @@ static PyObject *_wrap_wxGrid_GetTextBoxSize(PyObject *self, PyObject *args, PyO for (i=0; iAdd(PyString_AsString(item)); + _arg2->Add(PyString_AsString(str)); Py_DECREF(item); Py_DECREF(str); } diff --git a/wxPython/src/gtk/html.cpp b/wxPython/src/gtk/html.cpp index a1a15a12cd..58bb4c1891 100644 --- a/wxPython/src/gtk/html.cpp +++ b/wxPython/src/gtk/html.cpp @@ -209,6 +209,7 @@ public: DEC_PYCALLBACK__STRING(OnSetTitle); DEC_PYCALLBACK__CELLINTINT(OnCellMouseHover); DEC_PYCALLBACK__CELLINTINTME(OnCellClicked); + DEC_PYCALLBACK_BOOL_STRING(OnOpeningURL); PYPRIVATE; }; @@ -216,6 +217,7 @@ IMPLEMENT_ABSTRACT_CLASS( wxPyHtmlWindow, wxHtmlWindow ); IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle); IMP_PYCALLBACK__CELLINTINT(wxPyHtmlWindow, wxHtmlWindow, OnCellMouseHover); IMP_PYCALLBACK__CELLINTINTME(wxPyHtmlWindow, wxHtmlWindow, OnCellClicked); +IMP_PYCALLBACK_BOOL_STRING(wxPyHtmlWindow, wxHtmlWindow, OnOpeningURL); void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { @@ -1266,6 +1268,58 @@ static PyObject *_wrap_wxHtmlParser_PopTagHandler(PyObject *self, PyObject *args return _resultobj; } +#define wxHtmlParser_CanOpenURL(_swigobj,_swigarg0) (_swigobj->CanOpenURL(_swigarg0)) +static PyObject *_wrap_wxHtmlParser_CanOpenURL(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxHtmlParser * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","url", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlParser_CanOpenURL",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlParser_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlParser_CanOpenURL. Expected _wxHtmlParser_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 +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxHtmlParser_CanOpenURL(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + static void *SwigwxHtmlWinParserTowxHtmlParser(void *ptr) { wxHtmlWinParser *src; wxHtmlParser *dest; @@ -1286,18 +1340,18 @@ static void *SwigwxHtmlWinParserTowxObject(void *ptr) { static PyObject *_wrap_new_wxHtmlWinParser(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlWinParser * _result; - wxWindow * _arg0; + wxHtmlWindow * _arg0 = (wxHtmlWindow *) NULL; PyObject * _argo0 = 0; char *_kwnames[] = { "wnd", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxHtmlWinParser",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:new_wxHtmlWinParser",_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 new_wxHtmlWinParser. Expected _wxWindow_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxHtmlWinParser. Expected _wxHtmlWindow_p."); return NULL; } } @@ -6579,6 +6633,7 @@ static PyMethodDef htmlcMethods[] = { { "wxHtmlWinParser_GetDC", (PyCFunction) _wrap_wxHtmlWinParser_GetDC, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWinParser_SetDC", (PyCFunction) _wrap_wxHtmlWinParser_SetDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxHtmlWinParser", (PyCFunction) _wrap_new_wxHtmlWinParser, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlParser_CanOpenURL", (PyCFunction) _wrap_wxHtmlParser_CanOpenURL, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlParser_PopTagHandler", (PyCFunction) _wrap_wxHtmlParser_PopTagHandler, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlParser_PushTagHandler", (PyCFunction) _wrap_wxHtmlParser_PushTagHandler, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlParser_GetSource", (PyCFunction) _wrap_wxHtmlParser_GetSource, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/html.py b/wxPython/src/gtk/html.py index c4103cd6e1..76baf4423d 100644 --- a/wxPython/src/gtk/html.py +++ b/wxPython/src/gtk/html.py @@ -145,6 +145,9 @@ class wxHtmlParserPtr(wxObjectPtr): def PopTagHandler(self, *_args, **_kwargs): val = apply(htmlc.wxHtmlParser_PopTagHandler,(self,) + _args, _kwargs) return val + def CanOpenURL(self, *_args, **_kwargs): + val = apply(htmlc.wxHtmlParser_CanOpenURL,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxHtmlParser(wxHtmlParserPtr): diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp index 16f5491b22..e64b5da432 100644 --- a/wxPython/src/gtk/misc2.cpp +++ b/wxPython/src/gtk/misc2.cpp @@ -7833,7 +7833,7 @@ static PyObject *_wrap_new_wxFileTypeInfoSequence(PyObject *self, PyObject *args for (i=0; iAdd(PyString_AsString(item)); + _arg0->Add(PyString_AsString(str)); Py_DECREF(item); Py_DECREF(str); } diff --git a/wxPython/src/gtk/windows3.cpp b/wxPython/src/gtk/windows3.cpp index f49712b362..ebafbd5f33 100644 --- a/wxPython/src/gtk/windows3.cpp +++ b/wxPython/src/gtk/windows3.cpp @@ -2432,20 +2432,27 @@ static void *SwigwxTipWindowTowxObject(void *ptr) { return (void *) dest; } -#define new_wxTipWindow(_swigarg0,_swigarg1,_swigarg2) (new wxTipWindow(_swigarg0,_swigarg1,_swigarg2)) +static wxTipWindow *new_wxTipWindow(wxWindow *parent,const wxString *text,wxCoord maxLength,wxRect *rectBound) { + wxString tmp = *text; + return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound); + } + static PyObject *_wrap_new_wxTipWindow(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxTipWindow * _result; wxWindow * _arg0; wxString * _arg1; wxCoord _arg2 = (wxCoord ) 100; + wxRect * _arg3 = (wxRect *) NULL; PyObject * _argo0 = 0; PyObject * _obj1 = 0; - char *_kwnames[] = { "parent","text","maxLength", NULL }; + wxRect temp; + PyObject * _obj3 = 0; + char *_kwnames[] = { "parent","text","maxLength","rectBound", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:new_wxTipWindow",_kwnames,&_argo0,&_obj1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iO:new_wxTipWindow",_kwnames,&_argo0,&_obj1,&_arg2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2471,10 +2478,16 @@ static PyObject *_wrap_new_wxTipWindow(PyObject *self, PyObject *args, PyObject } _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); #endif +} + if (_obj3) +{ + _arg3 = &temp; + if (! wxRect_helper(_obj3, &_arg3)) + return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxTipWindow *)new_wxTipWindow(_arg0,*_arg1,_arg2); + _result = (wxTipWindow *)new_wxTipWindow(_arg0,_arg1,_arg2,_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -2492,7 +2505,73 @@ static PyObject *_wrap_new_wxTipWindow(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define wxTipWindow_SetBoundingRect(_swigobj,_swigarg0) (_swigobj->SetBoundingRect(_swigarg0)) +static PyObject *_wrap_wxTipWindow_SetBoundingRect(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTipWindow * _arg0; + wxRect * _arg1; + PyObject * _argo0 = 0; + wxRect temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","rectBound", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTipWindow_SetBoundingRect",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTipWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTipWindow_SetBoundingRect. Expected _wxTipWindow_p."); + return NULL; + } + } +{ + _arg1 = &temp; + if (! wxRect_helper(_obj1, &_arg1)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTipWindow_SetBoundingRect(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxTipWindow_Close(_swigobj) (_swigobj->Close()) +static PyObject *_wrap_wxTipWindow_Close(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTipWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTipWindow_Close",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTipWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTipWindow_Close. Expected _wxTipWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxTipWindow_Close(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static PyMethodDef windows3cMethods[] = { + { "wxTipWindow_Close", (PyCFunction) _wrap_wxTipWindow_Close, METH_VARARGS | METH_KEYWORDS }, + { "wxTipWindow_SetBoundingRect", (PyCFunction) _wrap_wxTipWindow_SetBoundingRect, METH_VARARGS | METH_KEYWORDS }, { "new_wxTipWindow", (PyCFunction) _wrap_new_wxTipWindow, METH_VARARGS | METH_KEYWORDS }, { "wxPopupTransientWindow_Dismiss", (PyCFunction) _wrap_wxPopupTransientWindow_Dismiss, METH_VARARGS | METH_KEYWORDS }, { "wxPopupTransientWindow_Popup", (PyCFunction) _wrap_wxPopupTransientWindow_Popup, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/windows3.py b/wxPython/src/gtk/windows3.py index ff840528be..b3e5c8ffed 100644 --- a/wxPython/src/gtk/windows3.py +++ b/wxPython/src/gtk/windows3.py @@ -328,6 +328,12 @@ class wxTipWindowPtr(wxPopupTransientWindowPtr): def __init__(self,this): self.this = this self.thisown = 0 + def SetBoundingRect(self, *_args, **_kwargs): + val = apply(windows3c.wxTipWindow_SetBoundingRect,(self,) + _args, _kwargs) + return val + def Close(self, *_args, **_kwargs): + val = apply(windows3c.wxTipWindow_Close,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxTipWindow(wxTipWindowPtr): diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp index 15d2b0e037..a4c8ae0aae 100644 --- a/wxPython/src/gtk/wx.cpp +++ b/wxPython/src/gtk/wx.cpp @@ -676,7 +676,8 @@ static wxPyCoreAPI API = { wxPyMake_wxObject, wxPyMake_wxSizer, wxPyPtrTypeMap_Add, - wxArrayString2PyList_helper + wxArrayString2PyList_helper, + wxArrayInt2PyList_helper }; @@ -2348,6 +2349,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxBITMAP_TYPE_ICON", PyInt_FromLong((long) wxBITMAP_TYPE_ICON)); PyDict_SetItemString(d,"wxBITMAP_TYPE_ICON_RESOURCE", PyInt_FromLong((long) wxBITMAP_TYPE_ICON_RESOURCE)); PyDict_SetItemString(d,"wxBITMAP_TYPE_ANI", PyInt_FromLong((long) wxBITMAP_TYPE_ANI)); + PyDict_SetItemString(d,"wxBITMAP_TYPE_IFF", PyInt_FromLong((long) wxBITMAP_TYPE_IFF)); PyDict_SetItemString(d,"wxBITMAP_TYPE_MACCURSOR", PyInt_FromLong((long) wxBITMAP_TYPE_MACCURSOR)); PyDict_SetItemString(d,"wxBITMAP_TYPE_MACCURSOR_RESOURCE", PyInt_FromLong((long) wxBITMAP_TYPE_MACCURSOR_RESOURCE)); PyDict_SetItemString(d,"wxBITMAP_TYPE_ANY", PyInt_FromLong((long) wxBITMAP_TYPE_ANY)); diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index 1204852c8d..e0014fee67 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -637,6 +637,7 @@ wxBITMAP_TYPE_PICT_RESOURCE = wxc.wxBITMAP_TYPE_PICT_RESOURCE wxBITMAP_TYPE_ICON = wxc.wxBITMAP_TYPE_ICON wxBITMAP_TYPE_ICON_RESOURCE = wxc.wxBITMAP_TYPE_ICON_RESOURCE wxBITMAP_TYPE_ANI = wxc.wxBITMAP_TYPE_ANI +wxBITMAP_TYPE_IFF = wxc.wxBITMAP_TYPE_IFF wxBITMAP_TYPE_MACCURSOR = wxc.wxBITMAP_TYPE_MACCURSOR wxBITMAP_TYPE_MACCURSOR_RESOURCE = wxc.wxBITMAP_TYPE_MACCURSOR_RESOURCE wxBITMAP_TYPE_ANY = wxc.wxBITMAP_TYPE_ANY @@ -1447,6 +1448,8 @@ class wxTimer(wxPyTimer): wxColor = wxColour wxNamedColor = wxNamedColour wxPen = wxPyPen +wxScrollbar = wxScrollBar + # backwards compatibility wxNoRefBitmap = wxBitmap @@ -1460,11 +1463,12 @@ wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric #---------------------------------------------------------------------- # wxGTK sets the locale when initialized. Doing this at the Python # level should set it up to match what GTK is doing at the C level. -try: - import locale - locale.setlocale(locale.LC_ALL, "") -except: - pass +if wxPlatform == "__WXGTK__": + try: + import locale + locale.setlocale(locale.LC_ALL, "") + except: + pass -- 2.45.2