From e9159fe8e8f1b3653c506805cbb79280aa2a0f38 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 18 Mar 2002 22:11:23 +0000 Subject: [PATCH] Added wxBufferedDC, changes for wxMenu and wxMenuItem, and other little fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 2 + wxPython/demo/Main.py | 15 +- wxPython/src/_defs.i | 19 +- wxPython/src/filesys.i | 8 +- wxPython/src/gdi.i | 21 + wxPython/src/helpers.cpp | 1 - wxPython/src/msw/filesys.cpp | 8 +- wxPython/src/msw/gdi.cpp | 198 ++++++ wxPython/src/msw/gdi.py | 33 + wxPython/src/msw/windows.cpp | 1098 ++++++++++++++++++++++++++++------ wxPython/src/msw/windows.py | 81 ++- wxPython/src/msw/wx.cpp | 6 + wxPython/src/msw/wx.py | 6 + wxPython/src/windows.i | 87 ++- wxPython/src/wx.i | 1 - 15 files changed, 1371 insertions(+), 213 deletions(-) diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index a8601642df..d5e64e735b 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -30,6 +30,8 @@ columns are specified and work the same as in wxFlexGridSizer. Updated XRCed from Roman Rolinsky +Added wxBufferedDC. + UNICODE! diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 10912629be..b4bca26df9 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -109,6 +109,7 @@ def opj(path): #--------------------------------------------------------------------------- class wxPythonDemo(wxFrame): + overviewText = "wxPython Overview" def __init__(self, parent, id, title): wxFrame.__init__(self, parent, -1, title, size = (800, 600), @@ -192,7 +193,7 @@ class wxPythonDemo(wxFrame): wxTR_HAS_VARIABLE_ROW_HEIGHT) #self.tree.SetBackgroundColour(wxNamedColour("Pink")) - root = self.tree.AddRoot("Overview") + root = self.tree.AddRoot("wxPython Overview") firstChild = None for item in _treeList: child = self.tree.AppendItem(root, item[0]) @@ -217,12 +218,12 @@ class wxPythonDemo(wxFrame): # the notebook... if 0: # the old way self.ovr = wxHtmlWindow(self.nb, -1, size=(400, 400)) - self.nb.AddPage(self.ovr, "Overview") + self.nb.AddPage(self.ovr, self.overviewText) else: # hopefully I can remove this hacky code soon, see bug #216861 panel = wxPanel(self.nb, -1, style=wxCLIP_CHILDREN) self.ovr = wxHtmlWindow(panel, -1, size=(400, 400)) - self.nb.AddPage(panel, "Overview") + self.nb.AddPage(panel, self.overviewText) def OnOvrSize(evt, ovr=self.ovr): ovr.SetSize(evt.GetSize()) @@ -231,7 +232,7 @@ class wxPythonDemo(wxFrame): EVT_ERASE_BACKGROUND(panel, EmptyHandler) - self.SetOverview("Overview", overview) + self.SetOverview(self.overviewText, overview) # Set up a TextCtrl on the Demo Code Notebook page @@ -327,9 +328,9 @@ class wxPythonDemo(wxFrame): self.nb.SetSelection(0) self.nb.DeletePage(2) - if itemText == 'Overview': + if itemText == self.overviewText: self.GetDemoFile('Main.py') - self.SetOverview('Overview', overview) + self.SetOverview(self.overviewText, overview) self.nb.Refresh(); self.window = None @@ -340,7 +341,7 @@ class wxPythonDemo(wxFrame): try: self.GetDemoFile(itemText + '.py') module = __import__(itemText, globals()) - self.SetOverview(itemText, module.overview) + self.SetOverview(itemText + " Overview", module.overview) finally: wxEndBusyCursor() diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index db2a7b206b..e06f24ee11 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -738,8 +738,9 @@ enum wxBitmapType // Standard cursors enum wxStockCursor { - wxCURSOR_NONE, // should be 0 + wxCURSOR_NONE, wxCURSOR_ARROW, + wxCURSOR_RIGHT_ARROW, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_CROSS, @@ -765,12 +766,6 @@ enum wxStockCursor wxCURSOR_WATCH, wxCURSOR_BLANK, wxCURSOR_DEFAULT, -// // Not yet implemented for Windows -// wxCURSOR_CROSS_REVERSE, -// wxCURSOR_DOUBLE_ARROW, -// wxCURSOR_BASED_ARROW_UP, -// wxCURSOR_BASED_ARROW_DOWN, - wxCURSOR_ARROWWAIT, wxCURSOR_MAX }; @@ -857,6 +852,16 @@ typedef enum { +// menu and toolbar item kinds +enum wxItemKind +{ + wxItem_Separator = -1, + wxItem_Normal, + wxItem_Check, + wxItem_Radio, + wxItem_Max +}; + enum wxHitTest { wxHT_NOWHERE, diff --git a/wxPython/src/filesys.i b/wxPython/src/filesys.i index 2bab95dee8..0f3b1371bd 100644 --- a/wxPython/src/filesys.i +++ b/wxPython/src/filesys.i @@ -87,7 +87,7 @@ public: return wxFileSystemHandler::GetRightLocation(location); } - wxString GetMimeTypeFromExt(const wxString& location){ + wxString GetMimeTypeFromExt(const wxString& location) { return wxFileSystemHandler::GetMimeTypeFromExt(location); } @@ -194,15 +194,11 @@ void __wxMemoryFSHandler_AddFile_wxBitmap(const wxString& filename, wxMemoryFSHandler::AddFile(filename, bitmap, type); } -// void __wxMemoryFSHandler_AddFile_wxString(const wxString& filename, -// const wxString& textdata) { -// wxMemoryFSHandler::AddFile(filename, textdata); -// } - void __wxMemoryFSHandler_AddFile_Data(const wxString& filename, PyObject* data) { wxMemoryFSHandler::AddFile(filename, + // TODO: Verify data type (void*)PyString_AsString(data), (size_t)PyString_Size(data)); } diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 79f08777a5..ba26ef7556 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -20,6 +20,7 @@ #include #include #include +#include %} //---------------------------------------------------------------------- @@ -1139,6 +1140,26 @@ public: %} +//--------------------------------------------------------------------------- + +class wxBufferedDC : public wxMemoryDC { +public: + // Construct a wxBufferedDC using a user supplied buffer. + wxBufferedDC( wxDC *dc, const wxBitmap &buffer ); + + // Construct a wxBufferedDC with an internal buffer of 'area' + // (where area is usually something like the size of the window + // being buffered) + %name(wxBufferedDCInternalBuffer)wxBufferedDC( wxDC *dc, const wxSize &area ); +}; + + +class wxBufferedPaintDC : public wxBufferedDC +{ +public: + wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap ); +}; + //--------------------------------------------------------------------------- class wxScreenDC : public wxDC { diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 7abe2ecd42..8d602244e0 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1888,7 +1888,6 @@ bool wxColour_helper(PyObject* source, wxColour** obj) { if (spec.GetChar(0) == '#' && spec.Length() == 7) { // It's #RRGGBB long red, green, blue; red = green = blue = 0; - spec.Mid(1,2).ToLong(&red, 16); spec.Mid(3,2).ToLong(&green, 16); spec.Mid(5,2).ToLong(&blue, 16); diff --git a/wxPython/src/msw/filesys.cpp b/wxPython/src/msw/filesys.cpp index ea97c7bef9..3632f7079c 100644 --- a/wxPython/src/msw/filesys.cpp +++ b/wxPython/src/msw/filesys.cpp @@ -116,7 +116,7 @@ public: return wxFileSystemHandler::GetRightLocation(location); } - wxString GetMimeTypeFromExt(const wxString& location){ + wxString GetMimeTypeFromExt(const wxString& location) { return wxFileSystemHandler::GetMimeTypeFromExt(location); } @@ -141,15 +141,11 @@ void __wxMemoryFSHandler_AddFile_wxBitmap(const wxString& filename, wxMemoryFSHandler::AddFile(filename, bitmap, type); } -// void __wxMemoryFSHandler_AddFile_wxString(const wxString& filename, -// const wxString& textdata) { -// wxMemoryFSHandler::AddFile(filename, textdata); -// } - void __wxMemoryFSHandler_AddFile_Data(const wxString& filename, PyObject* data) { wxMemoryFSHandler::AddFile(filename, + // TODO: Verify data type (void*)PyString_AsString(data), (size_t)PyString_Size(data)); } diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index 2d5a261eb2..2a6d42a641 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -61,6 +61,7 @@ extern PyObject *SWIG_newvarlink(void); #include #include #include +#include static PyObject* t_output_helper(PyObject* target, PyObject* o) { @@ -10426,6 +10427,193 @@ static PyObject *_wrap_wxMemoryDC_SelectObject(PyObject *self, PyObject *args, P return _resultobj; } +static void *SwigwxBufferedDCTowxMemoryDC(void *ptr) { + wxBufferedDC *src; + wxMemoryDC *dest; + src = (wxBufferedDC *) ptr; + dest = (wxMemoryDC *) src; + return (void *) dest; +} + +static void *SwigwxBufferedDCTowxDC(void *ptr) { + wxBufferedDC *src; + wxDC *dest; + src = (wxBufferedDC *) ptr; + dest = (wxDC *) src; + return (void *) dest; +} + +static void *SwigwxBufferedDCTowxObject(void *ptr) { + wxBufferedDC *src; + wxObject *dest; + src = (wxBufferedDC *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxBufferedDC(_swigarg0,_swigarg1) (new wxBufferedDC(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxBufferedDC(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBufferedDC * _result; + wxDC * _arg0; + wxBitmap * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "dc","buffer", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:new_wxBufferedDC",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBufferedDC. Expected _wxDC_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 new_wxBufferedDC. Expected _wxBitmap_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxBufferedDC *)new_wxBufferedDC(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedDC_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxBufferedDCInternalBuffer(_swigarg0,_swigarg1) (new wxBufferedDC(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxBufferedDCInternalBuffer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBufferedDC * _result; + wxDC * _arg0; + wxSize * _arg1; + PyObject * _argo0 = 0; + wxSize temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "dc","area", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:new_wxBufferedDCInternalBuffer",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxBufferedDCInternalBuffer. Expected _wxDC_p."); + return NULL; + } + } +{ + _arg1 = &temp; + if (! wxSize_helper(_obj1, &_arg1)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxBufferedDC *)new_wxBufferedDCInternalBuffer(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedDC_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static void *SwigwxBufferedPaintDCTowxBufferedDC(void *ptr) { + wxBufferedPaintDC *src; + wxBufferedDC *dest; + src = (wxBufferedPaintDC *) ptr; + dest = (wxBufferedDC *) src; + return (void *) dest; +} + +static void *SwigwxBufferedPaintDCTowxMemoryDC(void *ptr) { + wxBufferedPaintDC *src; + wxMemoryDC *dest; + src = (wxBufferedPaintDC *) ptr; + dest = (wxMemoryDC *) src; + return (void *) dest; +} + +static void *SwigwxBufferedPaintDCTowxDC(void *ptr) { + wxBufferedPaintDC *src; + wxDC *dest; + src = (wxBufferedPaintDC *) ptr; + dest = (wxDC *) src; + return (void *) dest; +} + +static void *SwigwxBufferedPaintDCTowxObject(void *ptr) { + wxBufferedPaintDC *src; + wxObject *dest; + src = (wxBufferedPaintDC *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxBufferedPaintDC(_swigarg0,_swigarg1) (new wxBufferedPaintDC(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxBufferedPaintDC(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBufferedPaintDC * _result; + wxWindow * _arg0; + wxBitmap * _arg1 = (wxBitmap *) &wxNullBitmap; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "window","buffer", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:new_wxBufferedPaintDC",_kwnames,&_argo0,&_argo1)) + 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_wxBufferedPaintDC. Expected _wxWindow_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 new_wxBufferedPaintDC. Expected _wxBitmap_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxBufferedPaintDC *)new_wxBufferedPaintDC(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBufferedPaintDC_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static void *SwigwxScreenDCTowxDC(void *ptr) { wxScreenDC *src; wxDC *dest; @@ -12896,6 +13084,9 @@ static PyMethodDef gdicMethods[] = { { "wxScreenDC_StartDrawingOnTop", (PyCFunction) _wrap_wxScreenDC_StartDrawingOnTop, METH_VARARGS | METH_KEYWORDS }, { "wxScreenDC_StartDrawingOnTopWin", (PyCFunction) _wrap_wxScreenDC_StartDrawingOnTopWin, METH_VARARGS | METH_KEYWORDS }, { "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS }, + { "new_wxBufferedPaintDC", (PyCFunction) _wrap_new_wxBufferedPaintDC, METH_VARARGS | METH_KEYWORDS }, + { "new_wxBufferedDCInternalBuffer", (PyCFunction) _wrap_new_wxBufferedDCInternalBuffer, METH_VARARGS | METH_KEYWORDS }, + { "new_wxBufferedDC", (PyCFunction) _wrap_new_wxBufferedDC, METH_VARARGS | METH_KEYWORDS }, { "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS }, { "new_wxMemoryDC", (PyCFunction) _wrap_new_wxMemoryDC, METH_VARARGS | METH_KEYWORDS }, { "wxDC__DrawLineList", (PyCFunction) _wrap_wxDC__DrawLineList, METH_VARARGS | METH_KEYWORDS }, @@ -13207,6 +13398,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxDC","_wxPaintDC",SwigwxPaintDCTowxDC}, { "_wxDC","_wxClientDC",SwigwxClientDCTowxDC}, { "_wxDC","_wxScreenDC",SwigwxScreenDCTowxDC}, + { "_wxDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxDC}, + { "_wxDC","_wxBufferedDC",SwigwxBufferedDCTowxDC}, { "_wxDC","_wxMemoryDC",SwigwxMemoryDCTowxDC}, { "_size_t","_wxCoord",0}, { "_size_t","_wxPrintQuality",0}, @@ -13224,6 +13417,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_char","_wxChar",0}, + { "_wxBufferedDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxBufferedDC}, { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, { "_EBool","_wxCoord",0}, { "_EBool","_wxPrintQuality",0}, @@ -13252,6 +13446,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxPaintDC",SwigwxPaintDCTowxObject}, { "_wxObject","_wxClientDC",SwigwxClientDCTowxObject}, { "_wxObject","_wxScreenDC",SwigwxScreenDCTowxObject}, + { "_wxObject","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxObject}, + { "_wxObject","_wxBufferedDC",SwigwxBufferedDCTowxObject}, { "_wxObject","_wxMemoryDC",SwigwxMemoryDCTowxObject}, { "_wxObject","_wxDC",SwigwxDCTowxObject}, { "_wxObject","_wxBrushList",SwigwxBrushListTowxObject}, @@ -13270,6 +13466,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxGDIObject",SwigwxGDIObjectTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, + { "_wxMemoryDC","_wxBufferedPaintDC",SwigwxBufferedPaintDCTowxMemoryDC}, + { "_wxMemoryDC","_wxBufferedDC",SwigwxBufferedDCTowxMemoryDC}, { "_unsigned_char","_byte",0}, { "_unsigned_int","_wxCoord",0}, { "_unsigned_int","_wxPrintQuality",0}, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 101a9b12ce..7e1630c5c3 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -1047,6 +1047,39 @@ class wxMemoryDC(wxMemoryDCPtr): +class wxBufferedDCPtr(wxMemoryDCPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxBufferedDC(wxBufferedDCPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gdic.new_wxBufferedDC,_args,_kwargs) + self.thisown = 1 + + + +def wxBufferedDCInternalBuffer(*_args,**_kwargs): + val = wxBufferedDCPtr(apply(gdic.new_wxBufferedDCInternalBuffer,_args,_kwargs)) + val.thisown = 1 + return val + + +class wxBufferedPaintDCPtr(wxBufferedDCPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxBufferedPaintDC(wxBufferedPaintDCPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gdic.new_wxBufferedPaintDC,_args,_kwargs) + self.thisown = 1 + + + + class wxScreenDCPtr(wxDCPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index da100e81cf..2f23e6b3ec 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -6934,8 +6934,46 @@ static PyObject *_wrap_wxScrolledWindow_GetViewStart(PyObject *self, PyObject *a return _resultobj; } -#define wxScrolledWindow_CalcScrolledPosition(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->CalcScrolledPosition(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxScrolledWindow_CalcScrolledPosition(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxScrolledWindow_CalcScrolledPosition1(_swigobj,_swigarg0) (_swigobj->CalcScrolledPosition(_swigarg0)) +static PyObject *_wrap_wxScrolledWindow_CalcScrolledPosition1(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPoint * _result; + wxScrolledWindow * _arg0; + wxPoint * _arg1; + PyObject * _argo0 = 0; + wxPoint temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","pt", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxScrolledWindow_CalcScrolledPosition1",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcScrolledPosition1. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + _arg1 = &temp; + if (! wxPoint_helper(_obj1, &_arg1)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxPoint (wxScrolledWindow_CalcScrolledPosition1(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPoint_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxScrolledWindow_CalcScrolledPosition2(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->CalcScrolledPosition(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxScrolledWindow_CalcScrolledPosition2(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxScrolledWindow * _arg0; int _arg1; @@ -6954,18 +6992,18 @@ static PyObject *_wrap_wxScrolledWindow_CalcScrolledPosition(PyObject *self, PyO { _arg4 = &temp0; } - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_CalcScrolledPosition",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_CalcScrolledPosition2",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcScrolledPosition. Expected _wxScrolledWindow_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcScrolledPosition2. Expected _wxScrolledWindow_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxScrolledWindow_CalcScrolledPosition(_arg0,_arg1,_arg2,_arg3,_arg4); + wxScrolledWindow_CalcScrolledPosition2(_arg0,_arg1,_arg2,_arg3,_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -6984,8 +7022,46 @@ static PyObject *_wrap_wxScrolledWindow_CalcScrolledPosition(PyObject *self, PyO return _resultobj; } -#define wxScrolledWindow_CalcUnscrolledPosition(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->CalcUnscrolledPosition(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxScrolledWindow_CalcUnscrolledPosition(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxScrolledWindow_CalcUnscrolledPosition1(_swigobj,_swigarg0) (_swigobj->CalcUnscrolledPosition(_swigarg0)) +static PyObject *_wrap_wxScrolledWindow_CalcUnscrolledPosition1(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPoint * _result; + wxScrolledWindow * _arg0; + wxPoint * _arg1; + PyObject * _argo0 = 0; + wxPoint temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","pt", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxScrolledWindow_CalcUnscrolledPosition1",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcUnscrolledPosition1. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + _arg1 = &temp; + if (! wxPoint_helper(_obj1, &_arg1)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxPoint (wxScrolledWindow_CalcUnscrolledPosition1(_arg0,*_arg1)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxPoint_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxScrolledWindow_CalcUnscrolledPosition2(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->CalcUnscrolledPosition(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxScrolledWindow_CalcUnscrolledPosition2(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxScrolledWindow * _arg0; int _arg1; @@ -7004,18 +7080,18 @@ static PyObject *_wrap_wxScrolledWindow_CalcUnscrolledPosition(PyObject *self, P { _arg4 = &temp0; } - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_CalcUnscrolledPosition",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_CalcUnscrolledPosition2",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcUnscrolledPosition. Expected _wxScrolledWindow_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_CalcUnscrolledPosition2. Expected _wxScrolledWindow_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxScrolledWindow_CalcUnscrolledPosition(_arg0,_arg1,_arg2,_arg3,_arg4); + wxScrolledWindow_CalcUnscrolledPosition2(_arg0,_arg1,_arg2,_arg3,_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7084,173 +7160,877 @@ static PyObject *_wrap_wxScrolledWindow_GetScaleX(PyObject *self, PyObject *args } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (double )wxScrolledWindow_GetScaleX(_arg0); + _result = (double )wxScrolledWindow_GetScaleX(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("d",_result); + return _resultobj; +} + +#define wxScrolledWindow_GetScaleY(_swigobj) (_swigobj->GetScaleY()) +static PyObject *_wrap_wxScrolledWindow_GetScaleY(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + double _result; + wxScrolledWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_GetScaleY",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_GetScaleY. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (double )wxScrolledWindow_GetScaleY(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("d",_result); + return _resultobj; +} + +#define wxScrolledWindow_AdjustScrollbars(_swigobj) (_swigobj->AdjustScrollbars()) +static PyObject *_wrap_wxScrolledWindow_AdjustScrollbars(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrolledWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_AdjustScrollbars",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_AdjustScrollbars. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxScrolledWindow_AdjustScrollbars(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxScrolledWindow_Layout(_swigobj) (_swigobj->Layout()) +static PyObject *_wrap_wxScrolledWindow_Layout(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxScrolledWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_Layout",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_Layout. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxScrolledWindow_Layout(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +static void *SwigwxMenuTowxEvtHandler(void *ptr) { + wxMenu *src; + wxEvtHandler *dest; + src = (wxMenu *) ptr; + dest = (wxEvtHandler *) src; + return (void *) dest; +} + +static void *SwigwxMenuTowxObject(void *ptr) { + wxMenu *src; + wxObject *dest; + src = (wxMenu *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxMenu(_swigarg0,_swigarg1) (new wxMenu(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxMenu(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _result; + wxString * _arg0 = (wxString *) &wxEmptyString; + long _arg1 = (long ) 0; + PyObject * _obj0 = 0; + char *_kwnames[] = { "title","style", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|Ol:new_wxMenu",_kwnames,&_obj0,&_arg1)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxMenu *)new_wxMenu(*_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMenu_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + +#define wxMenu_Append(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Append(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxString * _arg3 = (wxString *) &wxEmptyString; + wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","id","item","helpString","kind", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|Oi:wxMenu_Append",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_Append. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_Append(_arg0,_arg1,*_arg2,*_arg3,_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxMenu_AppendMenu(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Append(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxMenu * _arg3; + wxString * _arg4 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _argo3 = 0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","id","item","subMenu","helpString", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOO|O:wxMenu_AppendMenu",_kwnames,&_argo0,&_arg1,&_obj2,&_argo3,&_obj4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendMenu. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxMenu_AppendMenu. Expected _wxMenu_p."); + return NULL; + } + } + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_AppendMenu(_arg0,_arg1,*_arg2,_arg3,*_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj4) + delete _arg4; +} + return _resultobj; +} + +#define wxMenu_AppendItem(_swigobj,_swigarg0) (_swigobj->Append(_swigarg0)) +static PyObject *_wrap_wxMenu_AppendItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + wxMenuItem * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","item", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMenu_AppendItem",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendItem. Expected _wxMenu_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMenuItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMenu_AppendItem. Expected _wxMenuItem_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_AppendItem(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxMenu_AppendCheckItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->AppendCheckItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxMenu_AppendCheckItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxString * _arg3 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","id","text","help", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|O:wxMenu_AppendCheckItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendCheckItem. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_AppendCheckItem(_arg0,_arg1,*_arg2,*_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxMenu_AppendRadioItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->AppendRadioItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxMenu_AppendRadioItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxString * _arg3 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","id","text","help", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|O:wxMenu_AppendRadioItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendRadioItem. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_AppendRadioItem(_arg0,_arg1,*_arg2,*_arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} + return _resultobj; +} + +#define wxMenu_AppendSeparator(_swigobj) (_swigobj->AppendSeparator()) +static PyObject *_wrap_wxMenu_AppendSeparator(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenu_AppendSeparator",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendSeparator. Expected _wxMenu_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_AppendSeparator(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxMenu_Insert(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (_swigobj->Insert(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) +static PyObject *_wrap_wxMenu_Insert(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + size_t _arg1; + int _arg2; + wxString * _arg3; + wxString * _arg4 = (wxString *) &wxEmptyString; + wxItemKind _arg5 = (wxItemKind ) wxItem_Normal; + PyObject * _argo0 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","pos","id","text","help","kind", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO|Oi:wxMenu_Insert",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4,&_arg5)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_Insert. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_Insert(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj4) + delete _arg4; +} + return _resultobj; +} + +#define wxMenu_InsertSeparator(_swigobj,_swigarg0) (_swigobj->InsertSeparator(_swigarg0)) +static PyObject *_wrap_wxMenu_InsertSeparator(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + size_t _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","pos", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxMenu_InsertSeparator",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_InsertSeparator. Expected _wxMenu_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_InsertSeparator(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxMenu_InsertCheckItem(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->InsertCheckItem(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_InsertCheckItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + size_t _arg1; + int _arg2; + wxString * _arg3; + wxString * _arg4 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","pos","id","text","help", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO|O:wxMenu_InsertCheckItem",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_InsertCheckItem. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_InsertCheckItem(_arg0,_arg1,_arg2,*_arg3,*_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj4) + delete _arg4; +} + return _resultobj; +} + +#define wxMenu_InsertRadioItem(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->InsertRadioItem(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_InsertRadioItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + size_t _arg1; + int _arg2; + wxString * _arg3; + wxString * _arg4 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj3 = 0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","pos","id","text","help", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiO|O:wxMenu_InsertRadioItem",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_obj4)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_InsertRadioItem. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_obj4) +{ + _arg4 = wxString_in_helper(_obj4); + if (_arg4 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_InsertRadioItem(_arg0,_arg1,_arg2,*_arg3,*_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj4) + delete _arg4; +} + return _resultobj; +} + +#define wxMenu_InsertMenu(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (_swigobj->Insert(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) +static PyObject *_wrap_wxMenu_InsertMenu(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMenu * _arg0; + size_t _arg1; + int _arg2; + wxString * _arg3; + wxMenu * _arg4; + wxString * _arg5 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj3 = 0; + PyObject * _argo4 = 0; + PyObject * _obj5 = 0; + char *_kwnames[] = { "self","pos","id","text","submenu","help", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO|O:wxMenu_InsertMenu",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_argo4,&_obj5)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_InsertMenu. Expected _wxMenu_p."); + return NULL; + } + } +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} + if (_argo4) { + if (_argo4 == Py_None) { _arg4 = NULL; } + else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxMenu_InsertMenu. Expected _wxMenu_p."); + return NULL; + } + } + if (_obj5) +{ + _arg5 = wxString_in_helper(_obj5); + if (_arg5 == NULL) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxMenu_InsertMenu(_arg0,_arg1,_arg2,*_arg3,_arg4,*_arg5); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("d",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj3) + delete _arg3; +} +{ + if (_obj5) + delete _arg5; +} return _resultobj; } -#define wxScrolledWindow_GetScaleY(_swigobj) (_swigobj->GetScaleY()) -static PyObject *_wrap_wxScrolledWindow_GetScaleY(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_InsertItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->Insert(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxMenu_InsertItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - double _result; - wxScrolledWindow * _arg0; + bool _result; + wxMenu * _arg0; + size_t _arg1; + wxMenuItem * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","pos","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_GetScaleY",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxMenu_InsertItem",_kwnames,&_argo0,&_arg1,&_argo2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_GetScaleY. Expected _wxScrolledWindow_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_InsertItem. Expected _wxMenu_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxMenuItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxMenu_InsertItem. Expected _wxMenuItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (double )wxScrolledWindow_GetScaleY(_arg0); + _result = (bool )wxMenu_InsertItem(_arg0,_arg1,_arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("d",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxScrolledWindow_AdjustScrollbars(_swigobj) (_swigobj->AdjustScrollbars()) -static PyObject *_wrap_wxScrolledWindow_AdjustScrollbars(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_Prepend(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Prepend(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_Prepend(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxScrolledWindow * _arg0; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxString * _arg3 = (wxString *) &wxEmptyString; + wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","id","text","help","kind", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_AdjustScrollbars",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|Oi:wxMenu_Prepend",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_AdjustScrollbars. Expected _wxScrolledWindow_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_Prepend. Expected _wxMenu_p."); return NULL; } } +{ + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) + return NULL; +} { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxScrolledWindow_AdjustScrollbars(_arg0); + wxMenu_Prepend(_arg0,_arg1,*_arg2,*_arg3,_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; } Py_INCREF(Py_None); _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; +} return _resultobj; } -#define wxScrolledWindow_Layout(_swigobj) (_swigobj->Layout()) -static PyObject *_wrap_wxScrolledWindow_Layout(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_PrependSeparator(_swigobj) (_swigobj->PrependSeparator()) +static PyObject *_wrap_wxMenu_PrependSeparator(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxScrolledWindow * _arg0; + wxMenu * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_Layout",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenu_PrependSeparator",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_Layout. Expected _wxScrolledWindow_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_PrependSeparator. Expected _wxMenu_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxScrolledWindow_Layout(_arg0); + wxMenu_PrependSeparator(_arg0); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -static void *SwigwxMenuTowxEvtHandler(void *ptr) { - wxMenu *src; - wxEvtHandler *dest; - src = (wxMenu *) ptr; - dest = (wxEvtHandler *) src; - return (void *) dest; -} - -static void *SwigwxMenuTowxObject(void *ptr) { - wxMenu *src; - wxObject *dest; - src = (wxMenu *) ptr; - dest = (wxObject *) src; - return (void *) dest; -} - -#define new_wxMenu(_swigarg0,_swigarg1) (new wxMenu(_swigarg0,_swigarg1)) -static PyObject *_wrap_new_wxMenu(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_PrependCheckItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->PrependCheckItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxMenu_PrependCheckItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxMenu * _result; - wxString * _arg0 = (wxString *) &wxEmptyString; - long _arg1 = (long ) 0; - PyObject * _obj0 = 0; - char *_kwnames[] = { "title","style", NULL }; - char _ptemp[128]; + wxMenu * _arg0; + int _arg1; + wxString * _arg2; + wxString * _arg3 = (wxString *) &wxEmptyString; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","id","text","help", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|Ol:new_wxMenu",_kwnames,&_obj0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|O:wxMenu_PrependCheckItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3)) return NULL; - if (_obj0) + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_PrependCheckItem. Expected _wxMenu_p."); + return NULL; + } + } { - _arg0 = wxString_in_helper(_obj0); - if (_arg0 == NULL) + _arg2 = wxString_in_helper(_obj2); + if (_arg2 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = wxString_in_helper(_obj3); + if (_arg3 == NULL) return NULL; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxMenu *)new_wxMenu(*_arg0,_arg1); + wxMenu_PrependCheckItem(_arg0,_arg1,*_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxMenu_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +} Py_INCREF(Py_None); + _resultobj = Py_None; { - if (_obj0) - delete _arg0; + if (_obj2) + delete _arg2; +} +{ + if (_obj3) + delete _arg3; } return _resultobj; } -#define wxMenu_Append(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Append(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_PrependRadioItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->PrependRadioItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxMenu_PrependRadioItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMenu * _arg0; int _arg1; wxString * _arg2; wxString * _arg3 = (wxString *) &wxEmptyString; - int _arg4 = (int ) FALSE; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; - char *_kwnames[] = { "self","id","item","helpString","checkable", NULL }; + char *_kwnames[] = { "self","id","text","help", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|Oi:wxMenu_Append",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|O:wxMenu_PrependRadioItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_Append. Expected _wxMenu_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_PrependRadioItem. Expected _wxMenu_p."); return NULL; } } @@ -7267,7 +8047,7 @@ static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *k } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxMenu_Append(_arg0,_arg1,*_arg2,*_arg3,_arg4); + wxMenu_PrependRadioItem(_arg0,_arg1,*_arg2,*_arg3); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7284,8 +8064,8 @@ static PyObject *_wrap_wxMenu_Append(PyObject *self, PyObject *args, PyObject *k return _resultobj; } -#define wxMenu_AppendMenu(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Append(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_PrependMenu(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->Prepend(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxMenu_PrependMenu(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMenu * _arg0; int _arg1; @@ -7296,15 +8076,15 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec PyObject * _obj2 = 0; PyObject * _argo3 = 0; PyObject * _obj4 = 0; - char *_kwnames[] = { "self","id","item","subMenu","helpString", NULL }; + char *_kwnames[] = { "self","id","text","submenu","help", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOO|O:wxMenu_AppendMenu",_kwnames,&_argo0,&_arg1,&_obj2,&_argo3,&_obj4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiOO|O:wxMenu_PrependMenu",_kwnames,&_argo0,&_arg1,&_obj2,&_argo3,&_obj4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendMenu. Expected _wxMenu_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_PrependMenu. Expected _wxMenu_p."); return NULL; } } @@ -7316,7 +8096,7 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec if (_argo3) { if (_argo3 == Py_None) { _arg3 = NULL; } else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxMenu_AppendMenu. Expected _wxMenu_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxMenu_PrependMenu. Expected _wxMenu_p."); return NULL; } } @@ -7328,7 +8108,7 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxMenu_AppendMenu(_arg0,_arg1,*_arg2,_arg3,*_arg4); + wxMenu_PrependMenu(_arg0,_arg1,*_arg2,_arg3,*_arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7345,8 +8125,8 @@ static PyObject *_wrap_wxMenu_AppendMenu(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxMenu_AppendItem(_swigobj,_swigarg0) (_swigobj->Append(_swigarg0)) -static PyObject *_wrap_wxMenu_AppendItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxMenu_PrependItem(_swigobj,_swigarg0) (_swigobj->Prepend(_swigarg0)) +static PyObject *_wrap_wxMenu_PrependItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMenu * _arg0; wxMenuItem * _arg1; @@ -7355,53 +8135,25 @@ static PyObject *_wrap_wxMenu_AppendItem(PyObject *self, PyObject *args, PyObjec char *_kwnames[] = { "self","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMenu_AppendItem",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxMenu_PrependItem",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendItem. Expected _wxMenu_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_PrependItem. Expected _wxMenu_p."); return NULL; } } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMenuItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMenu_AppendItem. Expected _wxMenuItem_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxMenu_AppendItem(_arg0,_arg1); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -#define wxMenu_AppendSeparator(_swigobj) (_swigobj->AppendSeparator()) -static PyObject *_wrap_wxMenu_AppendSeparator(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxMenu * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenu_AppendSeparator",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_AppendSeparator. Expected _wxMenu_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxMenu_PrependItem. Expected _wxMenuItem_p."); return NULL; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxMenu_AppendSeparator(_arg0); + wxMenu_PrependItem(_arg0,_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; @@ -7963,44 +8715,6 @@ static PyObject *_wrap_wxMenu_DeleteItem(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxMenu_Insert(_swigobj,_swigarg0,_swigarg1) (_swigobj->Insert(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxMenu_Insert(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxMenu * _arg0; - size_t _arg1; - wxMenuItem * _arg2; - PyObject * _argo0 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","pos","item", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxMenu_Insert",_kwnames,&_argo0,&_arg1,&_argo2)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenu_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenu_Insert. Expected _wxMenu_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxMenuItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxMenu_Insert. Expected _wxMenuItem_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (bool )wxMenu_Insert(_arg0,_arg1,_arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - #define wxMenu_Remove(_swigobj,_swigarg0) (_swigobj->Remove(_swigarg0)) static PyObject *_wrap_wxMenu_Remove(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -9278,18 +9992,17 @@ static PyObject *_wrap_new_wxMenuItem(PyObject *self, PyObject *args, PyObject * int _arg1 = (int ) wxID_SEPARATOR; wxString * _arg2 = (wxString *) &wxEmptyString; wxString * _arg3 = (wxString *) &wxEmptyString; - bool _arg4 = (bool ) FALSE; + wxItemKind _arg4 = (wxItemKind ) wxItem_Normal; wxMenu * _arg5 = (wxMenu *) NULL; PyObject * _argo0 = 0; PyObject * _obj2 = 0; PyObject * _obj3 = 0; - int tempbool4 = (int) FALSE; PyObject * _argo5 = 0; - char *_kwnames[] = { "parentMenu","id","text","help","isCheckable","subMenu", NULL }; + char *_kwnames[] = { "parentMenu","id","text","help","kind","subMenu", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiOOiO:new_wxMenuItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&tempbool4,&_argo5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OiOOiO:new_wxMenuItem",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -9310,7 +10023,6 @@ static PyObject *_wrap_new_wxMenuItem(PyObject *self, PyObject *args, PyObject * if (_arg3 == NULL) return NULL; } - _arg4 = (bool ) tempbool4; if (_argo5) { if (_argo5 == Py_None) { _arg5 = NULL; } else if (SWIG_GetPtrObj(_argo5,(void **) &_arg5,"_wxMenu_p")) { @@ -9566,6 +10278,34 @@ static PyObject *_wrap_wxMenuItem_GetText(PyObject *self, PyObject *args, PyObje return _resultobj; } +#define wxMenuItem_GetKind(_swigobj) (_swigobj->GetKind()) +static PyObject *_wrap_wxMenuItem_GetKind(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxItemKind _result; + wxMenuItem * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenuItem_GetKind",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMenuItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuItem_GetKind. Expected _wxMenuItem_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxItemKind )wxMenuItem_GetKind(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxMenuItem_SetCheckable(_swigobj,_swigarg0) (_swigobj->SetCheckable(_swigarg0)) static PyObject *_wrap_wxMenuItem_SetCheckable(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -10524,6 +11264,7 @@ static PyMethodDef windowscMethods[] = { { "wxMenuItem_IsSubMenu", (PyCFunction) _wrap_wxMenuItem_IsSubMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_IsCheckable", (PyCFunction) _wrap_wxMenuItem_IsCheckable, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_SetCheckable", (PyCFunction) _wrap_wxMenuItem_SetCheckable, METH_VARARGS | METH_KEYWORDS }, + { "wxMenuItem_GetKind", (PyCFunction) _wrap_wxMenuItem_GetKind, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_GetText", (PyCFunction) _wrap_wxMenuItem_GetText, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_GetLabel", (PyCFunction) _wrap_wxMenuItem_GetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_SetText", (PyCFunction) _wrap_wxMenuItem_SetText, METH_VARARGS | METH_KEYWORDS }, @@ -10568,7 +11309,6 @@ static PyMethodDef windowscMethods[] = { { "wxMenu_Destroy", (PyCFunction) _wrap_wxMenu_Destroy, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_RemoveItem", (PyCFunction) _wrap_wxMenu_RemoveItem, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Remove", (PyCFunction) _wrap_wxMenu_Remove, METH_VARARGS | METH_KEYWORDS }, - { "wxMenu_Insert", (PyCFunction) _wrap_wxMenu_Insert, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_DeleteItem", (PyCFunction) _wrap_wxMenu_DeleteItem, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Delete", (PyCFunction) _wrap_wxMenu_Delete, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_UpdateUI", (PyCFunction) _wrap_wxMenu_UpdateUI, METH_VARARGS | METH_KEYWORDS }, @@ -10585,7 +11325,21 @@ static PyMethodDef windowscMethods[] = { { "wxMenu_IsChecked", (PyCFunction) _wrap_wxMenu_IsChecked, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Check", (PyCFunction) _wrap_wxMenu_Check, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Break", (PyCFunction) _wrap_wxMenu_Break, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_PrependItem", (PyCFunction) _wrap_wxMenu_PrependItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_PrependMenu", (PyCFunction) _wrap_wxMenu_PrependMenu, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_PrependRadioItem", (PyCFunction) _wrap_wxMenu_PrependRadioItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_PrependCheckItem", (PyCFunction) _wrap_wxMenu_PrependCheckItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_PrependSeparator", (PyCFunction) _wrap_wxMenu_PrependSeparator, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_Prepend", (PyCFunction) _wrap_wxMenu_Prepend, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_InsertItem", (PyCFunction) _wrap_wxMenu_InsertItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_InsertMenu", (PyCFunction) _wrap_wxMenu_InsertMenu, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_InsertRadioItem", (PyCFunction) _wrap_wxMenu_InsertRadioItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_InsertCheckItem", (PyCFunction) _wrap_wxMenu_InsertCheckItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_InsertSeparator", (PyCFunction) _wrap_wxMenu_InsertSeparator, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_Insert", (PyCFunction) _wrap_wxMenu_Insert, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_AppendSeparator", (PyCFunction) _wrap_wxMenu_AppendSeparator, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_AppendRadioItem", (PyCFunction) _wrap_wxMenu_AppendRadioItem, METH_VARARGS | METH_KEYWORDS }, + { "wxMenu_AppendCheckItem", (PyCFunction) _wrap_wxMenu_AppendCheckItem, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_AppendItem", (PyCFunction) _wrap_wxMenu_AppendItem, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_AppendMenu", (PyCFunction) _wrap_wxMenu_AppendMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Append", (PyCFunction) _wrap_wxMenu_Append, METH_VARARGS | METH_KEYWORDS }, @@ -10595,8 +11349,10 @@ static PyMethodDef windowscMethods[] = { { "wxScrolledWindow_GetScaleY", (PyCFunction) _wrap_wxScrolledWindow_GetScaleY, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetScaleX", (PyCFunction) _wrap_wxScrolledWindow_GetScaleX, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_SetScale", (PyCFunction) _wrap_wxScrolledWindow_SetScale, METH_VARARGS | METH_KEYWORDS }, - { "wxScrolledWindow_CalcUnscrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition, METH_VARARGS | METH_KEYWORDS }, - { "wxScrolledWindow_CalcScrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_CalcUnscrolledPosition2", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition2, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_CalcUnscrolledPosition1", (PyCFunction) _wrap_wxScrolledWindow_CalcUnscrolledPosition1, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_CalcScrolledPosition2", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition2, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_CalcScrolledPosition1", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition1, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetViewStart", (PyCFunction) _wrap_wxScrolledWindow_GetViewStart, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_SetTargetWindow", (PyCFunction) _wrap_wxScrolledWindow_SetTargetWindow, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_SetScrollPageSize", (PyCFunction) _wrap_wxScrolledWindow_SetScrollPageSize, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index d435fa5640..e5b042c213 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -695,11 +695,19 @@ class wxScrolledWindowPtr(wxPanelPtr): def GetViewStart(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetViewStart,(self,) + _args, _kwargs) return val - def CalcScrolledPosition(self, *_args, **_kwargs): - val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition,(self,) + _args, _kwargs) + def CalcScrolledPosition1(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition1,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) ; val.thisown = 1 + return val + def CalcScrolledPosition2(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_CalcScrolledPosition2,(self,) + _args, _kwargs) + return val + def CalcUnscrolledPosition1(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition1,(self,) + _args, _kwargs) + if val: val = wxPointPtr(val) ; val.thisown = 1 return val - def CalcUnscrolledPosition(self, *_args, **_kwargs): - val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition,(self,) + _args, _kwargs) + def CalcUnscrolledPosition2(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition2,(self,) + _args, _kwargs) return val def SetScale(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_SetScale,(self,) + _args, _kwargs) @@ -719,6 +727,23 @@ class wxScrolledWindowPtr(wxPanelPtr): def __repr__(self): return "" % (self.this,) ViewStart = GetViewStart + + def CalcScrolledPosition(self, *args): + if len(args) == 1: + return apply(self.CalcScrolledPosition1, args) + elif len(args) == 2: + return apply(self.CalcScrolledPosition2, args) + else: + raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed' + + def CalcUnscrolledPosition(self, *args): + if len(args) == 1: + return apply(self.CalcUnscrolledPosition1, args) + elif len(args) == 2: + return apply(self.CalcUnscrolledPosition2, args) + else: + raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed' + class wxScrolledWindow(wxScrolledWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxScrolledWindow,_args,_kwargs) @@ -747,9 +772,51 @@ class wxMenuPtr(wxEvtHandlerPtr): def AppendItem(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_AppendItem,(self,) + _args, _kwargs) return val + def AppendCheckItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_AppendCheckItem,(self,) + _args, _kwargs) + return val + def AppendRadioItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_AppendRadioItem,(self,) + _args, _kwargs) + return val def AppendSeparator(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_AppendSeparator,(self,) + _args, _kwargs) return val + def Insert(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_Insert,(self,) + _args, _kwargs) + return val + def InsertSeparator(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_InsertSeparator,(self,) + _args, _kwargs) + return val + def InsertCheckItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_InsertCheckItem,(self,) + _args, _kwargs) + return val + def InsertRadioItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_InsertRadioItem,(self,) + _args, _kwargs) + return val + def InsertMenu(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_InsertMenu,(self,) + _args, _kwargs) + return val + def InsertItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_InsertItem,(self,) + _args, _kwargs) + return val + def Prepend(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_Prepend,(self,) + _args, _kwargs) + return val + def PrependSeparator(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_PrependSeparator,(self,) + _args, _kwargs) + return val + def PrependCheckItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_PrependCheckItem,(self,) + _args, _kwargs) + return val + def PrependRadioItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_PrependRadioItem,(self,) + _args, _kwargs) + return val + def PrependMenu(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_PrependMenu,(self,) + _args, _kwargs) + return val + def PrependItem(self, *_args, **_kwargs): + val = apply(windowsc.wxMenu_PrependItem,(self,) + _args, _kwargs) + return val def Break(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_Break,(self,) + _args, _kwargs) return val @@ -798,9 +865,6 @@ class wxMenuPtr(wxEvtHandlerPtr): def DeleteItem(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_DeleteItem,(self,) + _args, _kwargs) return val - def Insert(self, *_args, **_kwargs): - val = apply(windowsc.wxMenu_Insert,(self,) + _args, _kwargs) - return val def Remove(self, *_args, **_kwargs): val = apply(windowsc.wxMenu_Remove,(self,) + _args, _kwargs) return val @@ -957,6 +1021,9 @@ class wxMenuItemPtr(wxObjectPtr): def GetText(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_GetText,(self,) + _args, _kwargs) return val + def GetKind(self, *_args, **_kwargs): + val = apply(windowsc.wxMenuItem_GetKind,(self,) + _args, _kwargs) + return val def SetCheckable(self, *_args, **_kwargs): val = apply(windowsc.wxMenuItem_SetCheckable,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 1bfd08576a..29656823bb 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -2393,6 +2393,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxBITMAP_TYPE_ANY", PyInt_FromLong((long) wxBITMAP_TYPE_ANY)); PyDict_SetItemString(d,"wxCURSOR_NONE", PyInt_FromLong((long) wxCURSOR_NONE)); PyDict_SetItemString(d,"wxCURSOR_ARROW", PyInt_FromLong((long) wxCURSOR_ARROW)); + PyDict_SetItemString(d,"wxCURSOR_RIGHT_ARROW", PyInt_FromLong((long) wxCURSOR_RIGHT_ARROW)); PyDict_SetItemString(d,"wxCURSOR_BULLSEYE", PyInt_FromLong((long) wxCURSOR_BULLSEYE)); PyDict_SetItemString(d,"wxCURSOR_CHAR", PyInt_FromLong((long) wxCURSOR_CHAR)); PyDict_SetItemString(d,"wxCURSOR_CROSS", PyInt_FromLong((long) wxCURSOR_CROSS)); @@ -2490,6 +2491,11 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxDUPLEX_SIMPLEX", PyInt_FromLong((long) wxDUPLEX_SIMPLEX)); PyDict_SetItemString(d,"wxDUPLEX_HORIZONTAL", PyInt_FromLong((long) wxDUPLEX_HORIZONTAL)); PyDict_SetItemString(d,"wxDUPLEX_VERTICAL", PyInt_FromLong((long) wxDUPLEX_VERTICAL)); + PyDict_SetItemString(d,"wxItem_Separator", PyInt_FromLong((long) wxItem_Separator)); + PyDict_SetItemString(d,"wxItem_Normal", PyInt_FromLong((long) wxItem_Normal)); + PyDict_SetItemString(d,"wxItem_Check", PyInt_FromLong((long) wxItem_Check)); + PyDict_SetItemString(d,"wxItem_Radio", PyInt_FromLong((long) wxItem_Radio)); + PyDict_SetItemString(d,"wxItem_Max", PyInt_FromLong((long) wxItem_Max)); PyDict_SetItemString(d,"wxHT_NOWHERE", PyInt_FromLong((long) wxHT_NOWHERE)); PyDict_SetItemString(d,"wxHT_SCROLLBAR_FIRST", PyInt_FromLong((long) wxHT_SCROLLBAR_FIRST)); PyDict_SetItemString(d,"wxHT_SCROLLBAR_ARROW_LINE_1", PyInt_FromLong((long) wxHT_SCROLLBAR_ARROW_LINE_1)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index a5ff924e76..194cc7320d 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -654,6 +654,7 @@ wxBITMAP_TYPE_MACCURSOR_RESOURCE = wxc.wxBITMAP_TYPE_MACCURSOR_RESOURCE wxBITMAP_TYPE_ANY = wxc.wxBITMAP_TYPE_ANY wxCURSOR_NONE = wxc.wxCURSOR_NONE wxCURSOR_ARROW = wxc.wxCURSOR_ARROW +wxCURSOR_RIGHT_ARROW = wxc.wxCURSOR_RIGHT_ARROW wxCURSOR_BULLSEYE = wxc.wxCURSOR_BULLSEYE wxCURSOR_CHAR = wxc.wxCURSOR_CHAR wxCURSOR_CROSS = wxc.wxCURSOR_CROSS @@ -751,6 +752,11 @@ wxPAPER_A3_EXTRA_TRANSVERSE = wxc.wxPAPER_A3_EXTRA_TRANSVERSE wxDUPLEX_SIMPLEX = wxc.wxDUPLEX_SIMPLEX wxDUPLEX_HORIZONTAL = wxc.wxDUPLEX_HORIZONTAL wxDUPLEX_VERTICAL = wxc.wxDUPLEX_VERTICAL +wxItem_Separator = wxc.wxItem_Separator +wxItem_Normal = wxc.wxItem_Normal +wxItem_Check = wxc.wxItem_Check +wxItem_Radio = wxc.wxItem_Radio +wxItem_Max = wxc.wxItem_Max wxHT_NOWHERE = wxc.wxHT_NOWHERE wxHT_SCROLLBAR_FIRST = wxc.wxHT_SCROLLBAR_FIRST wxHT_SCROLLBAR_ARROW_LINE_1 = wxc.wxHT_SCROLLBAR_ARROW_LINE_1 diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index f16f0f6976..c245360dc6 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -531,8 +531,29 @@ public: void GetViewStart(int* OUTPUT, int* OUTPUT); %pragma(python) addtoclass = "ViewStart = GetViewStart" - void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); - void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); + %name(CalcScrolledPosition1)wxPoint CalcScrolledPosition(const wxPoint& pt); + %name(CalcScrolledPosition2)void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); + + %name(CalcUnscrolledPosition1)wxPoint CalcUnscrolledPosition(const wxPoint& pt); + %name(CalcUnscrolledPosition2)void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); + + %pragma(python) addtoclass = " + def CalcScrolledPosition(self, *args): + if len(args) == 1: + return apply(self.CalcScrolledPosition1, args) + elif len(args) == 2: + return apply(self.CalcScrolledPosition2, args) + else: + raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed' + + def CalcUnscrolledPosition(self, *args): + if len(args) == 1: + return apply(self.CalcUnscrolledPosition1, args) + elif len(args) == 2: + return apply(self.CalcUnscrolledPosition2, args) + else: + raise TypeError, 'Invalid parameters: only (x,y) or (point) allowed' +" void SetScale(double xs, double ys); double GetScaleX(); @@ -554,12 +575,59 @@ public: void Append(int id, const wxString& item, const wxString& helpString = wxEmptyString, - int checkable = FALSE); + wxItemKind kind = wxItem_Normal); %name(AppendMenu)void Append(int id, const wxString& item, wxMenu *subMenu, - const wxString& helpString = wxEmptyString); + const wxString& helpString = wxEmptyString); %name(AppendItem)void Append(const wxMenuItem* item); - + void AppendCheckItem(int id, + const wxString& text, + const wxString& help = wxEmptyString); + void AppendRadioItem(int id, + const wxString& text, + const wxString& help = wxEmptyString); void AppendSeparator(); + + + void Insert(size_t pos, + int id, + const wxString& text, + const wxString& help = wxEmptyString, + wxItemKind kind = wxItem_Normal); + void InsertSeparator(size_t pos); + void InsertCheckItem(size_t pos, + int id, + const wxString& text, + const wxString& help = wxEmptyString); + void InsertRadioItem(size_t pos, + int id, + const wxString& text, + const wxString& help = wxEmptyString); + %name(InsertMenu)void Insert(size_t pos, + int id, + const wxString& text, + wxMenu *submenu, + const wxString& help = wxEmptyString); + %name(InsertItem)bool Insert(size_t pos, wxMenuItem *item); + + + void Prepend(int id, + const wxString& text, + const wxString& help = wxEmptyString, + wxItemKind kind = wxItem_Normal); + void PrependSeparator(); + void PrependCheckItem(int id, + const wxString& text, + const wxString& help = wxEmptyString); + void PrependRadioItem(int id, + const wxString& text, + const wxString& help = wxEmptyString); + %name(PrependMenu)void Prepend(int id, + const wxString& text, + wxMenu *submenu, + const wxString& help = wxEmptyString); + %name(PrependItem)void Prepend(wxMenuItem *item); + + void Break(); void Check(int id, bool flag); bool IsChecked(int id); @@ -581,10 +649,12 @@ public: bool Delete(int id); %name(DeleteItem)bool Delete(wxMenuItem *item); - bool Insert(size_t pos, wxMenuItem *item); wxMenuItem *Remove(int id); %name(RemoveItem) wxMenuItem *Remove(wxMenuItem *item); + + + %addmethods { void Destroy() { delete self; } } @@ -656,7 +726,8 @@ public: wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, - bool isCheckable = FALSE, wxMenu* subMenu = NULL); + wxItemKind kind = wxItem_Normal, + wxMenu* subMenu = NULL); wxMenu *GetMenu(); @@ -666,6 +737,7 @@ public: void SetText(const wxString& str); wxString GetLabel(); const wxString& GetText(); + wxItemKind GetKind(); void SetCheckable(bool checkable); bool IsCheckable(); bool IsSubMenu(); @@ -682,6 +754,7 @@ public: void SetAccel(wxAcceleratorEntry *accel); static wxString GetLabelFromText(const wxString& text); +// static wxAcceleratorEntry *GetAccelFromString(const wxString& label); // wxOwnerDrawn methods #ifdef __WXMSW__ diff --git a/wxPython/src/wx.i b/wxPython/src/wx.i index 494e0636aa..7497d86703 100644 --- a/wxPython/src/wx.i +++ b/wxPython/src/wx.i @@ -12,7 +12,6 @@ %module wx - %{ #include "helpers.h" %} -- 2.45.2