From da0ddbd6df973f6c32b0ebb65e4e15514a8cdcf0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 9 Mar 2002 23:55:25 +0000 Subject: [PATCH] SWIGged updates for wxMac git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/mac/controls2.cpp | 6 +- wxPython/src/mac/controls2.py | 10 ++ wxPython/src/mac/events.cpp | 29 ++++ wxPython/src/mac/events.py | 3 + wxPython/src/mac/filesys.cpp | 1 + wxPython/src/mac/gdi.cpp | 45 ++++- wxPython/src/mac/gdi.py | 5 + wxPython/src/mac/help.cpp | 1 - wxPython/src/mac/help.py | 4 - wxPython/src/mac/html.cpp | 117 ++++++++++++- wxPython/src/mac/html.py | 6 + wxPython/src/mac/htmlhelp.cpp | 294 ++++++++++++++++++++++++++++++++- wxPython/src/mac/htmlhelp.py | 17 +- wxPython/src/mac/image.cpp | 1 + wxPython/src/mac/misc2.cpp | 1 + wxPython/src/mac/stattool.cpp | 246 ++++++++++++++++++++++----- wxPython/src/mac/stattool.py | 38 +++-- wxPython/src/mac/streams.cpp | 1 + wxPython/src/mac/wx.cpp | 6 +- wxPython/src/mac/wx.py | 25 +-- 20 files changed, 766 insertions(+), 90 deletions(-) diff --git a/wxPython/src/mac/controls2.cpp b/wxPython/src/mac/controls2.cpp index cb8187cd85..16b450dcb8 100644 --- a/wxPython/src/mac/controls2.cpp +++ b/wxPython/src/mac/controls2.cpp @@ -8368,7 +8368,7 @@ static PyObject *_wrap_wxTreeCtrl_InsertItemBefore(PyObject *self, PyObject *arg wxString * _arg3; int _arg4 = (int ) -1; int _arg5 = (int ) -1; - wxTreeItemData * _arg6 = (wxTreeItemData *) NULL; + wxPyTreeItemData * _arg6 = (wxPyTreeItemData *) NULL; PyObject * _argo0 = 0; PyObject * _argo1 = 0; PyObject * _obj3 = 0; @@ -8413,8 +8413,8 @@ static PyObject *_wrap_wxTreeCtrl_InsertItemBefore(PyObject *self, PyObject *arg } if (_argo6) { if (_argo6 == Py_None) { _arg6 = NULL; } - else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxTreeItemData_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 7 of wxTreeCtrl_InsertItemBefore. Expected _wxTreeItemData_p."); + else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxPyTreeItemData_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 7 of wxTreeCtrl_InsertItemBefore. Expected _wxPyTreeItemData_p."); return NULL; } } diff --git a/wxPython/src/mac/controls2.py b/wxPython/src/mac/controls2.py index c23d04975b..fa6cd756e7 100644 --- a/wxPython/src/mac/controls2.py +++ b/wxPython/src/mac/controls2.py @@ -653,6 +653,16 @@ class wxListCtrlPtr(wxControlPtr): def ClearColumnImage(self, col): self.SetColumnImage(col, -1) + + def Append(self, entry): + '''Append an item to the list control. The entry parameter should be a + sequence with an item for each column''' + if len(entry): + pos = self.GetItemCount() + self.InsertStringItem(pos, str(entry[0])) + for i in range(1, len(entry)): + self.SetStringItem(pos, i, str(entry[i])) + return pos class wxListCtrl(wxListCtrlPtr): def __init__(self,*_args,**_kwargs): diff --git a/wxPython/src/mac/events.cpp b/wxPython/src/mac/events.cpp index a96e83e700..c88f0c4bc1 100644 --- a/wxPython/src/mac/events.cpp +++ b/wxPython/src/mac/events.cpp @@ -4734,6 +4734,34 @@ static PyObject *_wrap_wxMenuEvent_GetMenuId(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxMenuEvent_IsPopup(_swigobj) (_swigobj->IsPopup()) +static PyObject *_wrap_wxMenuEvent_IsPopup(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxMenuEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenuEvent_IsPopup",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenuEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuEvent_IsPopup. Expected _wxMenuEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxMenuEvent_IsPopup(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxShowEventTowxEvent(void *ptr) { wxShowEvent *src; wxEvent *dest; @@ -7184,6 +7212,7 @@ static PyMethodDef eventscMethods[] = { { "wxShowEvent_GetShow", (PyCFunction) _wrap_wxShowEvent_GetShow, METH_VARARGS | METH_KEYWORDS }, { "wxShowEvent_SetShow", (PyCFunction) _wrap_wxShowEvent_SetShow, METH_VARARGS | METH_KEYWORDS }, { "new_wxShowEvent", (PyCFunction) _wrap_new_wxShowEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxMenuEvent_IsPopup", (PyCFunction) _wrap_wxMenuEvent_IsPopup, METH_VARARGS | METH_KEYWORDS }, { "wxMenuEvent_GetMenuId", (PyCFunction) _wrap_wxMenuEvent_GetMenuId, METH_VARARGS | METH_KEYWORDS }, { "new_wxMenuEvent", (PyCFunction) _wrap_new_wxMenuEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxInitDialogEvent", (PyCFunction) _wrap_new_wxInitDialogEvent, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/events.py b/wxPython/src/mac/events.py index d6ba0941e7..38be62abe4 100644 --- a/wxPython/src/mac/events.py +++ b/wxPython/src/mac/events.py @@ -629,6 +629,9 @@ class wxMenuEventPtr(wxEventPtr): def GetMenuId(self, *_args, **_kwargs): val = apply(eventsc.wxMenuEvent_GetMenuId,(self,) + _args, _kwargs) return val + def IsPopup(self, *_args, **_kwargs): + val = apply(eventsc.wxMenuEvent_IsPopup,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxMenuEvent(wxMenuEventPtr): diff --git a/wxPython/src/mac/filesys.cpp b/wxPython/src/mac/filesys.cpp index 54c7b2500c..47a856c644 100644 --- a/wxPython/src/mac/filesys.cpp +++ b/wxPython/src/mac/filesys.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "filesysc" #include "helpers.h" +#include "pyistream.h" #include #include #include diff --git a/wxPython/src/mac/gdi.cpp b/wxPython/src/mac/gdi.cpp index b0e57e7e95..e9159c87f2 100644 --- a/wxPython/src/mac/gdi.cpp +++ b/wxPython/src/mac/gdi.cpp @@ -172,6 +172,12 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { delete [] cArray; return icon; } + + wxIcon* wxIconFromBitmap(const wxBitmap& bmp) { + wxIcon* icon = new wxIcon(); + icon->CopyFromBitmap(bmp); + return icon; + } // Alternate 'constructor' wxCursor* wxPyStockCursor(int id) { return new wxCursor(id); @@ -486,6 +492,40 @@ static PyObject *_wrap_wxIconFromXPMData(PyObject *self, PyObject *args, PyObjec return _resultobj; } +static PyObject *_wrap_wxIconFromBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxIcon * _result; + wxBitmap * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "bmp", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIconFromBitmap",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIconFromBitmap. Expected _wxBitmap_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxIcon *)wxIconFromBitmap(*_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxIcon_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static PyObject *_wrap_wxStockCursor(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxCursor * _result; @@ -1455,7 +1495,7 @@ static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kw PyObject * _resultobj; wxBitmap * _result; wxString * _arg0; - wxBitmapType _arg1 = (wxBitmapType ) wxBITMAP_TYPE_BMP; + wxBitmapType _arg1 = (wxBitmapType ) wxBITMAP_TYPE_ANY; PyObject * _obj0 = 0; char *_kwnames[] = { "name","type", NULL }; char _ptemp[128]; @@ -1605,7 +1645,7 @@ static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObjec bool _result; wxBitmap * _arg0; wxString * _arg1; - wxBitmapType _arg2 = (wxBitmapType ) wxBITMAP_TYPE_BMP; + wxBitmapType _arg2 = (wxBitmapType ) wxBITMAP_TYPE_ANY; PyObject * _argo0 = 0; PyObject * _obj1 = 0; char *_kwnames[] = { "self","name","type", NULL }; @@ -12195,6 +12235,7 @@ static PyMethodDef gdicMethods[] = { { "wxMemoryDCFromDC", (PyCFunction) _wrap_wxMemoryDCFromDC, METH_VARARGS | METH_KEYWORDS }, { "wxNamedColour", (PyCFunction) _wrap_wxNamedColour, METH_VARARGS | METH_KEYWORDS }, { "wxStockCursor", (PyCFunction) _wrap_wxStockCursor, METH_VARARGS | METH_KEYWORDS }, + { "wxIconFromBitmap", (PyCFunction) _wrap_wxIconFromBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxIconFromXPMData", (PyCFunction) _wrap_wxIconFromXPMData, METH_VARARGS | METH_KEYWORDS }, { "wxEmptyIcon", (PyCFunction) _wrap_wxEmptyIcon, METH_VARARGS | METH_KEYWORDS }, { "wxMaskColour", (PyCFunction) _wrap_wxMaskColour, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/gdi.py b/wxPython/src/mac/gdi.py index f8cb69c429..43de39766c 100644 --- a/wxPython/src/mac/gdi.py +++ b/wxPython/src/mac/gdi.py @@ -1273,6 +1273,11 @@ def wxIconFromXPMData(*_args, **_kwargs): if val: val = wxIconPtr(val); val.thisown = 1 return val +def wxIconFromBitmap(*_args, **_kwargs): + val = apply(gdic.wxIconFromBitmap,_args,_kwargs) + if val: val = wxIconPtr(val); val.thisown = 1 + return val + def wxStockCursor(*_args, **_kwargs): val = apply(gdic.wxStockCursor,_args,_kwargs) if val: val = wxCursorPtr(val); val.thisown = 1 diff --git a/wxPython/src/mac/help.cpp b/wxPython/src/mac/help.cpp index ac92d71bbe..d51794a9e2 100644 --- a/wxPython/src/mac/help.cpp +++ b/wxPython/src/mac/help.cpp @@ -1238,7 +1238,6 @@ SWIGEXPORT(void) inithelpc() { PyDict_SetItemString(d,"wxID_CONTEXT_HELP", PyInt_FromLong((long) wxID_CONTEXT_HELP)); PyDict_SetItemString(d,"wxEVT_HELP", PyInt_FromLong((long) wxEVT_HELP)); PyDict_SetItemString(d,"wxEVT_DETAILED_HELP", PyInt_FromLong((long) wxEVT_DETAILED_HELP)); - PyDict_SetItemString(d,"wxEVT_CONTEXT_MENU", PyInt_FromLong((long) wxEVT_CONTEXT_MENU)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/mac/help.py b/wxPython/src/mac/help.py index 9da1a4e532..570421d35d 100644 --- a/wxPython/src/mac/help.py +++ b/wxPython/src/mac/help.py @@ -26,9 +26,6 @@ def EVT_DETAILED_HELP(win, id, func): def EVT_DETAILED_HELP_RANGE(win, id, id2, func): win.Connect(id, id2, wxEVT_DETAILED_HELP, func) -def EVT_CONTEXT_MENU(win, func): - win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func) - class wxHelpEventPtr(wxCommandEventPtr): def __init__(self,this): self.this = this @@ -186,7 +183,6 @@ wxDIALOG_EX_CONTEXTHELP = helpc.wxDIALOG_EX_CONTEXTHELP wxID_CONTEXT_HELP = helpc.wxID_CONTEXT_HELP wxEVT_HELP = helpc.wxEVT_HELP wxEVT_DETAILED_HELP = helpc.wxEVT_DETAILED_HELP -wxEVT_CONTEXT_MENU = helpc.wxEVT_CONTEXT_MENU #-------------- USER INCLUDE ----------------------- diff --git a/wxPython/src/mac/html.cpp b/wxPython/src/mac/html.cpp index 81d36eac15..44393382e1 100644 --- a/wxPython/src/mac/html.cpp +++ b/wxPython/src/mac/html.cpp @@ -203,10 +203,19 @@ public: : wxHtmlWindow(parent, id, pos, size, style, name) {}; wxPyHtmlWindow() : wxHtmlWindow() {}; + bool ScrollToAnchor(const wxString& anchor) { + return wxHtmlWindow::ScrollToAnchor(anchor); + } + + bool HasAnchor(const wxString& anchor) { + const wxHtmlCell *c = m_Cell->Find(wxHTML_COND_ISANCHOR, &anchor); + return c!=NULL; + } + void OnLinkClicked(const wxHtmlLinkInfo& link); void base_OnLinkClicked(const wxHtmlLinkInfo& link); - wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type, + wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType type, const wxString& url, wxString *redirect) const; @@ -5186,6 +5195,110 @@ static PyObject *_wrap_wxHtmlWindow_GetParser(PyObject *self, PyObject *args, Py return _resultobj; } +#define wxHtmlWindow_ScrollToAnchor(_swigobj,_swigarg0) (_swigobj->ScrollToAnchor(_swigarg0)) +static PyObject *_wrap_wxHtmlWindow_ScrollToAnchor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyHtmlWindow * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","anchor", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlWindow_ScrollToAnchor",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyHtmlWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlWindow_ScrollToAnchor. Expected _wxPyHtmlWindow_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 )wxHtmlWindow_ScrollToAnchor(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxHtmlWindow_HasAnchor(_swigobj,_swigarg0) (_swigobj->HasAnchor(_swigarg0)) +static PyObject *_wrap_wxHtmlWindow_HasAnchor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyHtmlWindow * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","anchor", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlWindow_HasAnchor",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyHtmlWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlWindow_HasAnchor. Expected _wxPyHtmlWindow_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 )wxHtmlWindow_HasAnchor(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + #define wxHtmlWindow_base_OnLinkClicked(_swigobj,_swigarg0) (_swigobj->base_OnLinkClicked(_swigarg0)) static PyObject *_wrap_wxHtmlWindow_base_OnLinkClicked(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -6515,6 +6628,8 @@ static PyMethodDef htmlcMethods[] = { { "wxHtmlWindow_base_OnCellMouseHover", (PyCFunction) _wrap_wxHtmlWindow_base_OnCellMouseHover, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWindow_base_OnSetTitle", (PyCFunction) _wrap_wxHtmlWindow_base_OnSetTitle, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWindow_base_OnLinkClicked", (PyCFunction) _wrap_wxHtmlWindow_base_OnLinkClicked, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlWindow_HasAnchor", (PyCFunction) _wrap_wxHtmlWindow_HasAnchor, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlWindow_ScrollToAnchor", (PyCFunction) _wrap_wxHtmlWindow_ScrollToAnchor, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWindow_GetParser", (PyCFunction) _wrap_wxHtmlWindow_GetParser, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWindow_GetInternalRepresentation", (PyCFunction) _wrap_wxHtmlWindow_GetInternalRepresentation, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlWindow_HistoryClear", (PyCFunction) _wrap_wxHtmlWindow_HistoryClear, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/html.py b/wxPython/src/mac/html.py index 1f0283d745..594810351f 100644 --- a/wxPython/src/mac/html.py +++ b/wxPython/src/mac/html.py @@ -582,6 +582,12 @@ class wxHtmlWindowPtr(wxScrolledWindowPtr): val = apply(htmlc.wxHtmlWindow_GetParser,(self,) + _args, _kwargs) if val: val = wxHtmlWinParserPtr(val) return val + def ScrollToAnchor(self, *_args, **_kwargs): + val = apply(htmlc.wxHtmlWindow_ScrollToAnchor,(self,) + _args, _kwargs) + return val + def HasAnchor(self, *_args, **_kwargs): + val = apply(htmlc.wxHtmlWindow_HasAnchor,(self,) + _args, _kwargs) + return val def base_OnLinkClicked(self, *_args, **_kwargs): val = apply(htmlc.wxHtmlWindow_base_OnLinkClicked,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/mac/htmlhelp.cpp b/wxPython/src/mac/htmlhelp.cpp index 06b93cbd34..357156a9e2 100644 --- a/wxPython/src/mac/htmlhelp.cpp +++ b/wxPython/src/mac/htmlhelp.cpp @@ -98,21 +98,31 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { #ifdef __cplusplus extern "C" { #endif -#define new_wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2) (new wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2)) +static void *SwigwxHtmlBookRecordTowxObject(void *ptr) { + wxHtmlBookRecord *src; + wxObject *dest; + src = (wxHtmlBookRecord *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxHtmlBookRecord(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxHtmlBookRecord * _result; wxString * _arg0; wxString * _arg1; wxString * _arg2; + wxString * _arg3; PyObject * _obj0 = 0; PyObject * _obj1 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "basepath","title","start", NULL }; + PyObject * _obj3 = 0; + char *_kwnames[] = { "bookfile","basepath","title","start", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:new_wxHtmlBookRecord",_kwnames,&_obj0,&_obj1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOOO:new_wxHtmlBookRecord",_kwnames,&_obj0,&_obj1,&_obj2,&_obj3)) return NULL; { #if PYTHON_API_VERSION >= 1009 @@ -168,9 +178,27 @@ static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyOb _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); #endif } +{ +#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 +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxHtmlBookRecord *)new_wxHtmlBookRecord(*_arg0,*_arg1,*_arg2); + _result = (wxHtmlBookRecord *)new_wxHtmlBookRecord(*_arg0,*_arg1,*_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -192,6 +220,43 @@ static PyObject *_wrap_new_wxHtmlBookRecord(PyObject *self, PyObject *args, PyOb { if (_obj2) delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxHtmlBookRecord_GetBookFile(_swigobj) (_swigobj->GetBookFile()) +static PyObject *_wrap_wxHtmlBookRecord_GetBookFile(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxHtmlBookRecord * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlBookRecord_GetBookFile",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlBookRecord_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlBookRecord_GetBookFile. Expected _wxHtmlBookRecord_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxHtmlBookRecord_GetBookFile(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; } return _resultobj; } @@ -381,6 +446,219 @@ static PyObject *_wrap_wxHtmlBookRecord_GetContentsEnd(PyObject *self, PyObject return _resultobj; } +#define wxHtmlBookRecord_SetTitle(_swigobj,_swigarg0) (_swigobj->SetTitle(_swigarg0)) +static PyObject *_wrap_wxHtmlBookRecord_SetTitle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxHtmlBookRecord * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","title", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlBookRecord_SetTitle",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlBookRecord_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlBookRecord_SetTitle. Expected _wxHtmlBookRecord_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(); + wxHtmlBookRecord_SetTitle(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxHtmlBookRecord_SetBasePath(_swigobj,_swigarg0) (_swigobj->SetBasePath(_swigarg0)) +static PyObject *_wrap_wxHtmlBookRecord_SetBasePath(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxHtmlBookRecord * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","path", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlBookRecord_SetBasePath",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlBookRecord_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlBookRecord_SetBasePath. Expected _wxHtmlBookRecord_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(); + wxHtmlBookRecord_SetBasePath(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxHtmlBookRecord_SetStart(_swigobj,_swigarg0) (_swigobj->SetStart(_swigarg0)) +static PyObject *_wrap_wxHtmlBookRecord_SetStart(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxHtmlBookRecord * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","start", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlBookRecord_SetStart",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlBookRecord_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlBookRecord_SetStart. Expected _wxHtmlBookRecord_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(); + wxHtmlBookRecord_SetStart(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxHtmlBookRecord_GetFullPath(_swigobj,_swigarg0) (_swigobj->GetFullPath(_swigarg0)) +static PyObject *_wrap_wxHtmlBookRecord_GetFullPath(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxHtmlBookRecord * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","page", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxHtmlBookRecord_GetFullPath",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlBookRecord_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlBookRecord_GetFullPath. Expected _wxHtmlBookRecord_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 = new wxString (wxHtmlBookRecord_GetFullPath(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} + return _resultobj; +} + #define wxHtmlContentsItem_m_Level_set(_swigobj,_swigval) (_swigobj->m_Level = _swigval,_swigval) static PyObject *_wrap_wxHtmlContentsItem_m_Level_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2551,12 +2829,17 @@ static PyMethodDef htmlhelpcMethods[] = { { "wxHtmlContentsItem_m_ID_set", (PyCFunction) _wrap_wxHtmlContentsItem_m_ID_set, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlContentsItem_m_Level_get", (PyCFunction) _wrap_wxHtmlContentsItem_m_Level_get, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlContentsItem_m_Level_set", (PyCFunction) _wrap_wxHtmlContentsItem_m_Level_set, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlBookRecord_GetFullPath", (PyCFunction) _wrap_wxHtmlBookRecord_GetFullPath, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlBookRecord_SetStart", (PyCFunction) _wrap_wxHtmlBookRecord_SetStart, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlBookRecord_SetBasePath", (PyCFunction) _wrap_wxHtmlBookRecord_SetBasePath, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlBookRecord_SetTitle", (PyCFunction) _wrap_wxHtmlBookRecord_SetTitle, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetContentsEnd", (PyCFunction) _wrap_wxHtmlBookRecord_GetContentsEnd, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetContentsStart", (PyCFunction) _wrap_wxHtmlBookRecord_GetContentsStart, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_SetContentsRange", (PyCFunction) _wrap_wxHtmlBookRecord_SetContentsRange, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetBasePath", (PyCFunction) _wrap_wxHtmlBookRecord_GetBasePath, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetStart", (PyCFunction) _wrap_wxHtmlBookRecord_GetStart, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlBookRecord_GetTitle", (PyCFunction) _wrap_wxHtmlBookRecord_GetTitle, METH_VARARGS | METH_KEYWORDS }, + { "wxHtmlBookRecord_GetBookFile", (PyCFunction) _wrap_wxHtmlBookRecord_GetBookFile, METH_VARARGS | METH_KEYWORDS }, { "new_wxHtmlBookRecord", (PyCFunction) _wrap_new_wxHtmlBookRecord, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; @@ -2604,6 +2887,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_unsigned_long","_long",0}, + { "_struct_wxHtmlContentsItem","_wxHtmlContentsItem",0}, { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, { "_signed_int","_wxCoord",0}, { "_signed_int","_wxPrintQuality",0}, @@ -2617,8 +2901,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_wxDateTime_t",0}, { "_unsigned_short","_WXTYPE",0}, { "_unsigned_short","_short",0}, + { "_wxHtmlContentsItem","_struct_wxHtmlContentsItem",0}, { "_wxObject","_wxHtmlHelpController",SwigwxHtmlHelpControllerTowxObject}, { "_wxObject","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxObject}, + { "_wxObject","_wxHtmlBookRecord",SwigwxHtmlBookRecordTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0}, diff --git a/wxPython/src/mac/htmlhelp.py b/wxPython/src/mac/htmlhelp.py index 7df23d9cd0..e5b382edfd 100644 --- a/wxPython/src/mac/htmlhelp.py +++ b/wxPython/src/mac/htmlhelp.py @@ -40,10 +40,13 @@ from printfw import * from sizers import * from filesys import * -class wxHtmlBookRecordPtr : +class wxHtmlBookRecordPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 + def GetBookFile(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlBookRecord_GetBookFile,(self,) + _args, _kwargs) + return val def GetTitle(self, *_args, **_kwargs): val = apply(htmlhelpc.wxHtmlBookRecord_GetTitle,(self,) + _args, _kwargs) return val @@ -62,6 +65,18 @@ class wxHtmlBookRecordPtr : def GetContentsEnd(self, *_args, **_kwargs): val = apply(htmlhelpc.wxHtmlBookRecord_GetContentsEnd,(self,) + _args, _kwargs) return val + def SetTitle(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlBookRecord_SetTitle,(self,) + _args, _kwargs) + return val + def SetBasePath(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlBookRecord_SetBasePath,(self,) + _args, _kwargs) + return val + def SetStart(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlBookRecord_SetStart,(self,) + _args, _kwargs) + return val + def GetFullPath(self, *_args, **_kwargs): + val = apply(htmlhelpc.wxHtmlBookRecord_GetFullPath,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxHtmlBookRecord(wxHtmlBookRecordPtr): diff --git a/wxPython/src/mac/image.cpp b/wxPython/src/mac/image.cpp index 7b5c1b4408..3e24eb07e6 100644 --- a/wxPython/src/mac/image.cpp +++ b/wxPython/src/mac/image.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "imagec" #include "helpers.h" +#include "pyistream.h" #include diff --git a/wxPython/src/mac/misc2.cpp b/wxPython/src/mac/misc2.cpp index a4771387eb..94becfc278 100644 --- a/wxPython/src/mac/misc2.cpp +++ b/wxPython/src/mac/misc2.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "misc2c" #include "helpers.h" +#include "pyistream.h" #include #include #include diff --git a/wxPython/src/mac/stattool.cpp b/wxPython/src/mac/stattool.cpp index f77ac045af..53d48f7c3d 100644 --- a/wxPython/src/mac/stattool.cpp +++ b/wxPython/src/mac/stattool.cpp @@ -856,8 +856,8 @@ static PyObject *_wrap_wxToolBarToolBase_CanBeToggled(PyObject *self, PyObject * return _resultobj; } -#define wxToolBarToolBase_GetBitmap1(_swigobj) (_swigobj->GetBitmap1()) -static PyObject *_wrap_wxToolBarToolBase_GetBitmap1(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxToolBarToolBase_GetNormalBitmap(_swigobj) (_swigobj->GetNormalBitmap()) +static PyObject *_wrap_wxToolBarToolBase_GetNormalBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxBitmap * _result; wxToolBarToolBase * _arg0; @@ -866,28 +866,34 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap1(PyObject *self, PyObject *ar char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_GetBitmap1",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_GetNormalBitmap",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_GetBitmap1. Expected _wxToolBarToolBase_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_GetNormalBitmap. Expected _wxToolBarToolBase_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxBitmap (wxToolBarToolBase_GetBitmap1(_arg0)); + const wxBitmap & _result_ref = wxToolBarToolBase_GetNormalBitmap(_arg0); + _result = (wxBitmap *) &_result_ref; wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } -#define wxToolBarToolBase_GetBitmap2(_swigobj) (_swigobj->GetBitmap2()) -static PyObject *_wrap_wxToolBarToolBase_GetBitmap2(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxToolBarToolBase_GetDisabledBitmap(_swigobj) (_swigobj->GetDisabledBitmap()) +static PyObject *_wrap_wxToolBarToolBase_GetDisabledBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxBitmap * _result; wxToolBarToolBase * _arg0; @@ -896,23 +902,29 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap2(PyObject *self, PyObject *ar char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_GetBitmap2",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_GetDisabledBitmap",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_GetBitmap2. Expected _wxToolBarToolBase_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_GetDisabledBitmap. Expected _wxToolBarToolBase_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = new wxBitmap (wxToolBarToolBase_GetBitmap2(_arg0)); + const wxBitmap & _result_ref = wxToolBarToolBase_GetDisabledBitmap(_arg0); + _result = (wxBitmap *) &_result_ref; wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } @@ -946,6 +958,39 @@ static PyObject *_wrap_wxToolBarToolBase_GetBitmap(PyObject *self, PyObject *arg return _resultobj; } +#define wxToolBarToolBase_GetLabel(_swigobj) (_swigobj->GetLabel()) +static PyObject *_wrap_wxToolBarToolBase_GetLabel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxToolBarToolBase * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_GetLabel",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_GetLabel. Expected _wxToolBarToolBase_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxToolBarToolBase_GetLabel(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} + return _resultobj; +} + #define wxToolBarToolBase_GetShortHelp(_swigobj) (_swigobj->GetShortHelp()) static PyObject *_wrap_wxToolBarToolBase_GetShortHelp(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1043,18 +1088,15 @@ static PyObject *_wrap_wxToolBarToolBase_Enable(PyObject *self, PyObject *args, return _resultobj; } -#define wxToolBarToolBase_Toggle(_swigobj,_swigarg0) (_swigobj->Toggle(_swigarg0)) +#define wxToolBarToolBase_Toggle(_swigobj) (_swigobj->Toggle()) static PyObject *_wrap_wxToolBarToolBase_Toggle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; wxToolBarToolBase * _arg0; - bool _arg1; PyObject * _argo0 = 0; - int tempbool1; - char *_kwnames[] = { "self","toggle", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxToolBarToolBase_Toggle",_kwnames,&_argo0,&tempbool1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarToolBase_Toggle",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -1063,14 +1105,14 @@ static PyObject *_wrap_wxToolBarToolBase_Toggle(PyObject *self, PyObject *args, return NULL; } } - _arg1 = (bool ) tempbool1; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxToolBarToolBase_Toggle(_arg0,_arg1); + wxToolBarToolBase_Toggle(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } @@ -1209,8 +1251,8 @@ static PyObject *_wrap_wxToolBarToolBase_SetLongHelp(PyObject *self, PyObject *a return _resultobj; } -#define wxToolBarToolBase_SetBitmap1(_swigobj,_swigarg0) (_swigobj->SetBitmap1(_swigarg0)) -static PyObject *_wrap_wxToolBarToolBase_SetBitmap1(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxToolBarToolBase_SetNormalBitmap(_swigobj,_swigarg0) (_swigobj->SetNormalBitmap(_swigarg0)) +static PyObject *_wrap_wxToolBarToolBase_SetNormalBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxToolBarToolBase * _arg0; wxBitmap * _arg1; @@ -1219,25 +1261,25 @@ static PyObject *_wrap_wxToolBarToolBase_SetBitmap1(PyObject *self, PyObject *ar char *_kwnames[] = { "self","bmp", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBarToolBase_SetBitmap1",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBarToolBase_SetNormalBitmap",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_SetBitmap1. Expected _wxToolBarToolBase_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_SetNormalBitmap. Expected _wxToolBarToolBase_p."); return NULL; } } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxToolBarToolBase_SetBitmap1. Expected _wxBitmap_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxToolBarToolBase_SetNormalBitmap. Expected _wxBitmap_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxToolBarToolBase_SetBitmap1(_arg0,*_arg1); + wxToolBarToolBase_SetNormalBitmap(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -1246,8 +1288,8 @@ static PyObject *_wrap_wxToolBarToolBase_SetBitmap1(PyObject *self, PyObject *ar return _resultobj; } -#define wxToolBarToolBase_SetBitmap2(_swigobj,_swigarg0) (_swigobj->SetBitmap2(_swigarg0)) -static PyObject *_wrap_wxToolBarToolBase_SetBitmap2(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxToolBarToolBase_SetDisabledBitmap(_swigobj,_swigarg0) (_swigobj->SetDisabledBitmap(_swigarg0)) +static PyObject *_wrap_wxToolBarToolBase_SetDisabledBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxToolBarToolBase * _arg0; wxBitmap * _arg1; @@ -1256,30 +1298,82 @@ static PyObject *_wrap_wxToolBarToolBase_SetBitmap2(PyObject *self, PyObject *ar char *_kwnames[] = { "self","bmp", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBarToolBase_SetBitmap2",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBarToolBase_SetDisabledBitmap",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_SetBitmap2. Expected _wxToolBarToolBase_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_SetDisabledBitmap. Expected _wxToolBarToolBase_p."); return NULL; } } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxToolBarToolBase_SetBitmap2. Expected _wxBitmap_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxToolBarToolBase_SetDisabledBitmap. Expected _wxBitmap_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxToolBarToolBase_SetDisabledBitmap(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxToolBarToolBase_SetLabel(_swigobj,_swigarg0) (_swigobj->SetLabel(_swigarg0)) +static PyObject *_wrap_wxToolBarToolBase_SetLabel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToolBarToolBase * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","label", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBarToolBase_SetLabel",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarToolBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarToolBase_SetLabel. Expected _wxToolBarToolBase_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(); - wxToolBarToolBase_SetBitmap2(_arg0,*_arg1); + wxToolBarToolBase_SetLabel(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} return _resultobj; } @@ -2231,8 +2325,8 @@ static PyObject *_wrap_wxToolBarBase_SetToggle(PyObject *self, PyObject *args, P return _resultobj; } -static PyObject * wxToolBarBase_GetToolClientData(wxToolBarBase *self,int index) { - wxPyUserData* udata = (wxPyUserData*)self->GetToolClientData(index); +static PyObject * wxToolBarBase_GetToolClientData(wxToolBarBase *self,int id) { + wxPyUserData* udata = (wxPyUserData*)self->GetToolClientData(id); if (udata) { Py_INCREF(udata->m_obj); return udata->m_obj; @@ -2247,7 +2341,7 @@ static PyObject *_wrap_wxToolBarBase_GetToolClientData(PyObject *self, PyObject wxToolBarBase * _arg0; int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","index", NULL }; + char *_kwnames[] = { "self","id", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxToolBarBase_GetToolClientData",_kwnames,&_argo0,&_arg1)) @@ -2271,8 +2365,8 @@ static PyObject *_wrap_wxToolBarBase_GetToolClientData(PyObject *self, PyObject return _resultobj; } -static void wxToolBarBase_SetToolClientData(wxToolBarBase *self,int index,PyObject * clientData) { - self->SetToolClientData(index, new wxPyUserData(clientData)); +static void wxToolBarBase_SetToolClientData(wxToolBarBase *self,int id,PyObject * clientData) { + self->SetToolClientData(id, new wxPyUserData(clientData)); } static PyObject *_wrap_wxToolBarBase_SetToolClientData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2281,7 +2375,7 @@ static PyObject *_wrap_wxToolBarBase_SetToolClientData(PyObject *self, PyObject PyObject * _arg2; PyObject * _argo0 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","index","clientData", NULL }; + char *_kwnames[] = { "self","id","clientData", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxToolBarBase_SetToolClientData",_kwnames,&_argo0,&_arg1,&_obj2)) @@ -2990,6 +3084,64 @@ static PyObject *_wrap_wxToolBarBase_GetToolSize(PyObject *self, PyObject *args, return _resultobj; } +#define wxToolBarBase_FindToolForPosition(_swigobj,_swigarg0,_swigarg1) (_swigobj->FindToolForPosition(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxToolBarBase_FindToolForPosition(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToolBarToolBase * _result; + wxToolBarBase * _arg0; + wxCoord _arg1; + wxCoord _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","x","y", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxToolBarBase_FindToolForPosition",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarBase_FindToolForPosition. Expected _wxToolBarBase_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxToolBarToolBase *)wxToolBarBase_FindToolForPosition(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxToolBarBase_IsVertical(_swigobj) (_swigobj->IsVertical()) +static PyObject *_wrap_wxToolBarBase_IsVertical(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxToolBarBase * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarBase_IsVertical",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarBase_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarBase_IsVertical. Expected _wxToolBarBase_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxToolBarBase_IsVertical(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxToolBarTowxToolBarBase(void *ptr) { wxToolBar *src; wxToolBarBase *dest; @@ -3419,6 +3571,8 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBar_Create", (PyCFunction) _wrap_wxToolBar_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreToolBar", (PyCFunction) _wrap_new_wxPreToolBar, METH_VARARGS | METH_KEYWORDS }, { "new_wxToolBar", (PyCFunction) _wrap_new_wxToolBar, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarBase_IsVertical", (PyCFunction) _wrap_wxToolBarBase_IsVertical, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarBase_FindToolForPosition", (PyCFunction) _wrap_wxToolBarBase_FindToolForPosition, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarBase_GetToolSize", (PyCFunction) _wrap_wxToolBarBase_GetToolSize, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarBase_GetToolBitmapSize", (PyCFunction) _wrap_wxToolBarBase_GetToolBitmapSize, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarBase_SetToolBitmapSize", (PyCFunction) _wrap_wxToolBarBase_SetToolBitmapSize, METH_VARARGS | METH_KEYWORDS }, @@ -3462,8 +3616,9 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBarToolBase_GetClientData", (PyCFunction) _wrap_wxToolBarToolBase_GetClientData, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_Attach", (PyCFunction) _wrap_wxToolBarToolBase_Attach, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_Detach", (PyCFunction) _wrap_wxToolBarToolBase_Detach, METH_VARARGS | METH_KEYWORDS }, - { "wxToolBarToolBase_SetBitmap2", (PyCFunction) _wrap_wxToolBarToolBase_SetBitmap2, METH_VARARGS | METH_KEYWORDS }, - { "wxToolBarToolBase_SetBitmap1", (PyCFunction) _wrap_wxToolBarToolBase_SetBitmap1, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_SetLabel", (PyCFunction) _wrap_wxToolBarToolBase_SetLabel, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_SetDisabledBitmap", (PyCFunction) _wrap_wxToolBarToolBase_SetDisabledBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_SetNormalBitmap", (PyCFunction) _wrap_wxToolBarToolBase_SetNormalBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_SetLongHelp", (PyCFunction) _wrap_wxToolBarToolBase_SetLongHelp, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_SetShortHelp", (PyCFunction) _wrap_wxToolBarToolBase_SetShortHelp, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_SetToggle", (PyCFunction) _wrap_wxToolBarToolBase_SetToggle, METH_VARARGS | METH_KEYWORDS }, @@ -3471,9 +3626,10 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBarToolBase_Enable", (PyCFunction) _wrap_wxToolBarToolBase_Enable, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_GetLongHelp", (PyCFunction) _wrap_wxToolBarToolBase_GetLongHelp, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_GetShortHelp", (PyCFunction) _wrap_wxToolBarToolBase_GetShortHelp, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_GetLabel", (PyCFunction) _wrap_wxToolBarToolBase_GetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_GetBitmap", (PyCFunction) _wrap_wxToolBarToolBase_GetBitmap, METH_VARARGS | METH_KEYWORDS }, - { "wxToolBarToolBase_GetBitmap2", (PyCFunction) _wrap_wxToolBarToolBase_GetBitmap2, METH_VARARGS | METH_KEYWORDS }, - { "wxToolBarToolBase_GetBitmap1", (PyCFunction) _wrap_wxToolBarToolBase_GetBitmap1, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_GetDisabledBitmap", (PyCFunction) _wrap_wxToolBarToolBase_GetDisabledBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarToolBase_GetNormalBitmap", (PyCFunction) _wrap_wxToolBarToolBase_GetNormalBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_CanBeToggled", (PyCFunction) _wrap_wxToolBarToolBase_CanBeToggled, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_IsToggled", (PyCFunction) _wrap_wxToolBarToolBase_IsToggled, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarToolBase_IsEnabled", (PyCFunction) _wrap_wxToolBarToolBase_IsEnabled, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/stattool.py b/wxPython/src/mac/stattool.py index 59f27eec6b..4e8be2301b 100644 --- a/wxPython/src/mac/stattool.py +++ b/wxPython/src/mac/stattool.py @@ -102,18 +102,21 @@ class wxToolBarToolBasePtr(wxObjectPtr): def CanBeToggled(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarToolBase_CanBeToggled,(self,) + _args, _kwargs) return val - def GetBitmap1(self, *_args, **_kwargs): - val = apply(stattoolc.wxToolBarToolBase_GetBitmap1,(self,) + _args, _kwargs) - if val: val = wxBitmapPtr(val) ; val.thisown = 1 + def GetNormalBitmap(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_GetNormalBitmap,(self,) + _args, _kwargs) + if val: val = wxBitmapPtr(val) return val - def GetBitmap2(self, *_args, **_kwargs): - val = apply(stattoolc.wxToolBarToolBase_GetBitmap2,(self,) + _args, _kwargs) - if val: val = wxBitmapPtr(val) ; val.thisown = 1 + def GetDisabledBitmap(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_GetDisabledBitmap,(self,) + _args, _kwargs) + if val: val = wxBitmapPtr(val) return val def GetBitmap(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarToolBase_GetBitmap,(self,) + _args, _kwargs) if val: val = wxBitmapPtr(val) ; val.thisown = 1 return val + def GetLabel(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_GetLabel,(self,) + _args, _kwargs) + return val def GetShortHelp(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarToolBase_GetShortHelp,(self,) + _args, _kwargs) return val @@ -135,11 +138,14 @@ class wxToolBarToolBasePtr(wxObjectPtr): def SetLongHelp(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarToolBase_SetLongHelp,(self,) + _args, _kwargs) return val - def SetBitmap1(self, *_args, **_kwargs): - val = apply(stattoolc.wxToolBarToolBase_SetBitmap1,(self,) + _args, _kwargs) + def SetNormalBitmap(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_SetNormalBitmap,(self,) + _args, _kwargs) + return val + def SetDisabledBitmap(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_SetDisabledBitmap,(self,) + _args, _kwargs) return val - def SetBitmap2(self, *_args, **_kwargs): - val = apply(stattoolc.wxToolBarToolBase_SetBitmap2,(self,) + _args, _kwargs) + def SetLabel(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarToolBase_SetLabel,(self,) + _args, _kwargs) return val def Detach(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarToolBase_Detach,(self,) + _args, _kwargs) @@ -155,6 +161,12 @@ class wxToolBarToolBasePtr(wxObjectPtr): return val def __repr__(self): return "" % (self.this,) + + GetBitmap1 = GetNormalBitmap + GetBitmap2 = GetDisabledBitmap + SetBitmap1 = SetNormalBitmap + SetBitmap2 = SetDisabledBitmap + class wxToolBarToolBase(wxToolBarToolBasePtr): def __init__(self,this): self.this = this @@ -287,6 +299,12 @@ class wxToolBarBasePtr(wxControlPtr): val = apply(stattoolc.wxToolBarBase_GetToolSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 return val + def FindToolForPosition(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarBase_FindToolForPosition,(self,) + _args, _kwargs) + return val + def IsVertical(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarBase_IsVertical,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxToolBarBase(wxToolBarBasePtr): diff --git a/wxPython/src/mac/streams.cpp b/wxPython/src/mac/streams.cpp index 0833c8ba47..0dd41c5c08 100644 --- a/wxPython/src/mac/streams.cpp +++ b/wxPython/src/mac/streams.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "streamsc" #include "helpers.h" +#include "pyistream.h" #include #include diff --git a/wxPython/src/mac/wx.cpp b/wxPython/src/mac/wx.cpp index f65d99214f..2056bde001 100644 --- a/wxPython/src/mac/wx.cpp +++ b/wxPython/src/mac/wx.cpp @@ -2561,10 +2561,10 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_ERASE_BACKGROUND", PyInt_FromLong((long) wxEVT_ERASE_BACKGROUND)); PyDict_SetItemString(d,"wxEVT_NC_PAINT", PyInt_FromLong((long) wxEVT_NC_PAINT)); PyDict_SetItemString(d,"wxEVT_PAINT_ICON", PyInt_FromLong((long) wxEVT_PAINT_ICON)); - PyDict_SetItemString(d,"wxEVT_MENU_CHAR", PyInt_FromLong((long) wxEVT_MENU_CHAR)); - PyDict_SetItemString(d,"wxEVT_MENU_INIT", PyInt_FromLong((long) wxEVT_MENU_INIT)); + PyDict_SetItemString(d,"wxEVT_MENU_OPEN", PyInt_FromLong((long) wxEVT_MENU_OPEN)); + PyDict_SetItemString(d,"wxEVT_MENU_CLOSE", PyInt_FromLong((long) wxEVT_MENU_CLOSE)); PyDict_SetItemString(d,"wxEVT_MENU_HIGHLIGHT", PyInt_FromLong((long) wxEVT_MENU_HIGHLIGHT)); - PyDict_SetItemString(d,"wxEVT_POPUP_MENU_INIT", PyInt_FromLong((long) wxEVT_POPUP_MENU_INIT)); + PyDict_SetItemString(d,"wxEVT_CONTEXT_MENU", PyInt_FromLong((long) wxEVT_CONTEXT_MENU)); PyDict_SetItemString(d,"wxEVT_SYS_COLOUR_CHANGED", PyInt_FromLong((long) wxEVT_SYS_COLOUR_CHANGED)); PyDict_SetItemString(d,"wxEVT_DISPLAY_CHANGED", PyInt_FromLong((long) wxEVT_DISPLAY_CHANGED)); PyDict_SetItemString(d,"wxEVT_SETTING_CHANGED", PyInt_FromLong((long) wxEVT_SETTING_CHANGED)); diff --git a/wxPython/src/mac/wx.py b/wxPython/src/mac/wx.py index 81aec65c68..b213f84dfd 100644 --- a/wxPython/src/mac/wx.py +++ b/wxPython/src/mac/wx.py @@ -848,10 +848,10 @@ wxEVT_PAINT = wxc.wxEVT_PAINT wxEVT_ERASE_BACKGROUND = wxc.wxEVT_ERASE_BACKGROUND wxEVT_NC_PAINT = wxc.wxEVT_NC_PAINT wxEVT_PAINT_ICON = wxc.wxEVT_PAINT_ICON -wxEVT_MENU_CHAR = wxc.wxEVT_MENU_CHAR -wxEVT_MENU_INIT = wxc.wxEVT_MENU_INIT +wxEVT_MENU_OPEN = wxc.wxEVT_MENU_OPEN +wxEVT_MENU_CLOSE = wxc.wxEVT_MENU_CLOSE wxEVT_MENU_HIGHLIGHT = wxc.wxEVT_MENU_HIGHLIGHT -wxEVT_POPUP_MENU_INIT = wxc.wxEVT_POPUP_MENU_INIT +wxEVT_CONTEXT_MENU = wxc.wxEVT_CONTEXT_MENU wxEVT_SYS_COLOUR_CHANGED = wxc.wxEVT_SYS_COLOUR_CHANGED wxEVT_DISPLAY_CHANGED = wxc.wxEVT_DISPLAY_CHANGED wxEVT_SETTING_CHANGED = wxc.wxEVT_SETTING_CHANGED @@ -949,6 +949,12 @@ def EVT_KEY_DOWN(win, func): def EVT_KEY_UP(win, func): win.Connect(-1, -1, wxEVT_KEY_UP, func) +def EVT_MENU_OPEN(win, func): + win.Connect(-1, -1, wxEVT_MENU_OPEN, func) + +def EVT_MENU_CLOSE(win, func): + win.Connect(-1, -1, wxEVT_MENU_CLOSE, func) + def EVT_MENU_HIGHLIGHT(win, id, func): win.Connect(id, -1, wxEVT_MENU_HIGHLIGHT, func) @@ -1432,19 +1438,6 @@ def EVT_TOGGLEBUTTON(win, id, func): -# Help events -def EVT_HELP(win, id, func): - win.Connect(id, -1, wxEVT_HELP, func) - -def EVT_HELP_RANGE(win, id, id2, func): - win.Connect(id, id2, wxEVT_HELP, func) - -def EVT_DETAILED_HELP(win, id, func): - win.Connect(id, -1, wxEVT_DETAILED_HELP, func) - -def EVT_DETAILED_HELP_RANGE(win, id, id2, func): - win.Connect(id, id2, wxEVT_DETAILED_HELP, func) - def EVT_CONTEXT_MENU(win, func): win.Connect(-1, -1, wxEVT_CONTEXT_MENU, func) -- 2.45.2