From d1679124ae303fb78561ee2b0c56b5831fd0fafe Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 6 May 2001 05:03:24 +0000 Subject: [PATCH] MouseWheel stuff Added wxToggleButton other odds and ends git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 7 +- wxPython/contrib/stc/stc_.cpp | 2 + wxPython/demo/Main.py | 4 +- wxPython/demo/wxScrolledWindow.py | 21 +++ wxPython/demo/wxToggleButton.py | 36 ++++ wxPython/distrib/make_installer.py | 4 +- wxPython/my_distutils.py | 6 +- wxPython/src/_defs.i | 7 +- wxPython/src/_extras.py | 10 ++ wxPython/src/controls.i | 50 +++--- wxPython/src/controls2.i | 1 + wxPython/src/events.i | 7 + wxPython/src/msw/controls.cpp | 241 ++++++++++++++++++++++++++- wxPython/src/msw/controls.py | 24 +++ wxPython/src/msw/controls2.cpp | 1 + wxPython/src/msw/controls2.py | 1 + wxPython/src/msw/events.cpp | 255 +++++++++++++++++++++++++++++ wxPython/src/msw/events.py | 24 +++ wxPython/src/msw/sizers.cpp | 2 + wxPython/src/msw/sizers.py | 32 ++-- wxPython/src/msw/windows.cpp | 114 +++++++++++++ wxPython/src/msw/windows.py | 12 ++ wxPython/src/msw/wx.cpp | 5 +- wxPython/src/msw/wx.py | 13 +- wxPython/src/sizers.i | 32 ++-- wxPython/src/windows.i | 5 + 26 files changed, 843 insertions(+), 73 deletions(-) create mode 100644 wxPython/demo/wxToggleButton.py diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 1a4d5f99f2..425cc911ad 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -48,13 +48,16 @@ Fixed wxStyledTextCtrl to be much faster on wxGTK. There was some experimental code that got left in place that ended up causing way too many refreshes. -A couple hacks in my_distutils.py so wxPython can be built with the -distutils that comes with Python 2.1. +A couple more hacks in my_distutils.py so wxPython can be built with +the distutils that comes with Python 2.1. Added a ton of missing methods for wxPrintData. Switched to InnoSetup for MSW distributions. +Added wxToggleButton + + 2.2.6 diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index a4bbb25439..27eb2473fa 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -8663,6 +8663,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStaticLine","_class_wxStaticLine",0}, { "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0}, { "_wxBrush","_class_wxBrush",0}, + { "_wxToggleButton","_class_wxToggleButton",0}, { "_wxMiniFrame","_class_wxMiniFrame",0}, { "_class_wxNotebookEvent","_wxNotebookEvent",0}, { "_class_wxPyPrintout","_wxPyPrintout",0}, @@ -8997,6 +8998,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxDataObjectComposite","_class_wxDataObjectComposite",0}, { "_class_wxJoystickEvent","_wxJoystickEvent",0}, { "_class_wxTipProvider","_wxTipProvider",0}, + { "_class_wxToggleButton","_wxToggleButton",0}, { "_class_wxMiniFrame","_wxMiniFrame",0}, { "_wxFontDialog","_class_wxFontDialog",0}, { "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0}, diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 6ab783ec33..a18951f49f 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -23,7 +23,7 @@ import images _treeList = [ ('New since last release', ['ColourSelect', 'ImageBrowser', 'infoframe', - 'ColourDB', + 'ColourDB', 'wxToggleButton', ]), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -43,7 +43,7 @@ _treeList = [ 'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl', 'wxTreeCtrl', 'wxSpinButton', 'wxSpinCtrl', 'wxStaticText', 'wxStaticBitmap', 'wxRadioBox', 'wxSlider', 'wxToolBar', - 'wxCalendarCtrl', + 'wxCalendarCtrl', 'wxToggleButton', ]), ('Window Layout', ['wxLayoutConstraints', 'LayoutAnchors', 'Sizers', ]), diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py index cdc526826e..5f90e34f5a 100644 --- a/wxPython/demo/wxScrolledWindow.py +++ b/wxPython/demo/wxScrolledWindow.py @@ -127,6 +127,27 @@ class MyCanvas(wxScrolledWindow): self.curLine = [] self.ReleaseMouse() + +## This is an example of what to do for the EVT_MOUSEWHEEL event, +## but since wxScrolledWindow does this already it's not +## necessary to do it ourselves. + +## wheelScroll = 0 +## def OnWheel(self, evt): +## delta = evt.GetWheelDelta() +## rot = evt.GetWheelRotation() +## linesPer = evt.GetLinesPerAction() +## ws = self.wheelScroll +## ws = ws + rot +## lines = ws / delta +## ws = ws - lines * delta +## self.wheelScroll = ws +## if lines != 0: +## lines = lines * linesPer +## vsx, vsy = self.GetViewStart() +## scrollTo = vsy - lines +## self.Scroll(-1, scrollTo) + #--------------------------------------------------------------------------- def runTest(frame, nb, log): diff --git a/wxPython/demo/wxToggleButton.py b/wxPython/demo/wxToggleButton.py new file mode 100644 index 0000000000..80f1cf1c04 --- /dev/null +++ b/wxPython/demo/wxToggleButton.py @@ -0,0 +1,36 @@ + +from wxPython.wx import * + +#---------------------------------------------------------------------- + +class TestPanel(wxPanel): + def __init__(self, parent, log): + wxPanel.__init__(self, parent, -1) + self.log = log + panel = wxPanel(self, -1) + buttons = wxBoxSizer(wxHORIZONTAL) + for word in string.split("These are toggle buttons"): + b = wxToggleButton(panel, -1, word) + EVT_TOGGLEBUTTON(self, b.GetId(), self.OnToggle) + buttons.Add(b, flag=wxALL, border=5) + + panel.SetAutoLayout(true) + panel.SetSizer(buttons) + buttons.Fit(panel) + panel.Move((50,50)) + + def OnToggle(self, evt): + self.log.write("Button %d toggled\n" % evt.GetId()) + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + + +#---------------------------------------------------------------------- + + +overview = """\ +""" diff --git a/wxPython/distrib/make_installer.py b/wxPython/distrib/make_installer.py index 9fee40ccfe..a9894a26dd 100644 --- a/wxPython/distrib/make_installer.py +++ b/wxPython/distrib/make_installer.py @@ -62,8 +62,8 @@ Name: tools; Description: "Tools"; Types: full ;;------------------------------------------------------------ [Files] -Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall; Components: core -Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall; Components: core +Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core +Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core diff --git a/wxPython/my_distutils.py b/wxPython/my_distutils.py index aa0c183e6b..cbff3b4e99 100644 --- a/wxPython/my_distutils.py +++ b/wxPython/my_distutils.py @@ -54,15 +54,15 @@ class MyMSVCCompiler(MSVCCompiler): self.mkpath (os.path.dirname (obj)) if ext in self._c_extensions: - input_opt = "/Tc" + os.path.abspath(src) + input_opt = "/Tc" + os.path.abspath(src) ### RPD elif ext in self._cpp_extensions: - input_opt = "/Tp" + os.path.abspath(src) + input_opt = "/Tp" + os.path.abspath(src) ### RPD elif ext in self._rc_extensions: # compile .RC to .RES file input_opt = src output_opt = "/fo" + obj try: - self.spawn ([self.rc] + pp_opts + ### RPD changed this line only + self.spawn ([self.rc] + pp_opts + ### RPD changed this line [output_opt] + [input_opt]) except DistutilsExecError, msg: raise CompileError, msg diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index ddb38a57c3..f5c5c954b6 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -486,6 +486,8 @@ enum { wxJOY_BUTTON4, wxJOY_BUTTON_ANY, + wxWS_EX_VALIDATE_RECURSIVELY, + }; @@ -839,6 +841,7 @@ enum wxEventType { wxEVT_COMMAND_TOOL_ENTER, wxEVT_SET_FOCUS, wxEVT_KILL_FOCUS, + wxEVT_MOUSEWHEEL, /* Mouse event types */ wxEVT_LEFT_DOWN, @@ -855,7 +858,7 @@ enum wxEventType { wxEVT_RIGHT_DCLICK, // Non-client mouse events - wxEVT_NC_LEFT_DOWN = wxEVT_FIRST + 100, + wxEVT_NC_LEFT_DOWN, wxEVT_NC_LEFT_UP, wxEVT_NC_MIDDLE_DOWN, wxEVT_NC_MIDDLE_UP, @@ -953,8 +956,6 @@ enum wxEventType { wxEVT_TIMER, - wxWS_EX_VALIDATE_RECURSIVELY, - }; diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index f8698fb050..3296d7fad6 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -169,6 +169,8 @@ def EVT_LEAVE_WINDOW(win, func): def EVT_ENTER_WINDOW(win, func): win.Connect(-1, -1, wxEVT_ENTER_WINDOW, func) +def EVT_MOUSEWHEEL(win, func): + win.Connect(-1, -1, wxEVT_MOUSEWHEEL, func) # all mouse events def EVT_MOUSE_EVENTS(win, func): @@ -443,6 +445,9 @@ def EVT_TREE_BEGIN_DRAG(win, id, func): def EVT_TREE_BEGIN_RDRAG(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_RDRAG, func) +def EVT_TREE_END_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TREE_END_DRAG, func) + def EVT_TREE_BEGIN_LABEL_EDIT(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, func) @@ -633,6 +638,11 @@ def EVT_JOYSTICK_EVENTS(win, func): win.Connect(-1, -1, wxEVT_JOY_MOVE, func) win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + +def EVT_TOGGLEBUTTON(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, func) + + #---------------------------------------------------------------------- class wxTimer(wxPyTimer): diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index 2e8f3e4f1f..e00e3b974a 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -19,7 +19,7 @@ #include #include #include -//#include +#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN @@ -125,31 +125,6 @@ public: int GetMarginY() const { return m_marginY; } }; -//---------------------------------------------------------------------- - -// class wxToggleButton : public wxControl { -// public: -// wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, -// const wxPoint& pos = wxDefaultPosition, -// const wxSize& size = wxDefaultSize, long style = 0, -// const wxValidator& validator = wxDefaultValidator, -// const char* name = "toggle"); -// void SetValue(bool value); -// bool GetValue() const ; -// void SetLabel(const wxString& label); -// }; - -// class wxBitmapToggleButton : public wxToggleButton { -// public: -// wxBitmapToggleButton(wxWindow *parent, wxWindowID id, const wxBitmap *label, -// const wxPoint& pos = wxDefaultPosition, -// const wxSize& size = wxDefaultSize, long style = 0, -// const wxValidator& validator = wxDefaultValidator, -// const char *name = "toggle"); -// void SetLabel(const wxBitmap& bitmap); -// }; - - //---------------------------------------------------------------------- class wxCheckBox : public wxControl { @@ -603,5 +578,28 @@ public: //---------------------------------------------------------------------- +enum { wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, }; + +class wxToggleButton : public wxControl { +public: + wxToggleButton(wxWindow *parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const char* name = "toggle"); + + void SetValue(bool value); + bool GetValue() const ; + void SetLabel(const wxString& label); + +}; + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 4080597830..1ca0a09bb9 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -409,6 +409,7 @@ enum { wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, + wxEVT_COMMAND_TREE_END_DRAG, }; diff --git a/wxPython/src/events.i b/wxPython/src/events.i index d1454016dc..3cf5673359 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -160,6 +160,10 @@ public: long GetX(); long GetY(); + int GetWheelRotation() const { return m_wheelRotation; } + int GetWheelDelta() const { return m_wheelDelta; } + int GetLinesPerAction() const { return m_linesPerAction; } + long m_x, m_y; bool m_leftDown; bool m_middleDown; @@ -168,6 +172,9 @@ public: bool m_shiftDown; bool m_altDown; bool m_metaDown; + int m_wheelRotation; + int m_wheelDelta; + int m_linesPerAction; }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index ff51a7da26..eae334bd2d 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -61,7 +61,7 @@ extern PyObject *SWIG_newvarlink(void); #include #include #include -//#include +#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN @@ -7794,7 +7794,231 @@ static PyObject *_wrap_wxSpinCtrl_SetValue(PyObject *self, PyObject *args, PyObj return _resultobj; } +static void *SwigwxToggleButtonTowxControl(void *ptr) { + wxToggleButton *src; + wxControl *dest; + src = (wxToggleButton *) ptr; + dest = (wxControl *) src; + return (void *) dest; +} + +static void *SwigwxToggleButtonTowxWindow(void *ptr) { + wxToggleButton *src; + wxWindow *dest; + src = (wxToggleButton *) ptr; + dest = (wxWindow *) src; + return (void *) dest; +} + +static void *SwigwxToggleButtonTowxEvtHandler(void *ptr) { + wxToggleButton *src; + wxEvtHandler *dest; + src = (wxToggleButton *) ptr; + dest = (wxEvtHandler *) src; + return (void *) dest; +} + +#define new_wxToggleButton(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7) (new wxToggleButton(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6,_swigarg7)) +static PyObject *_wrap_new_wxToggleButton(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToggleButton * _result; + wxWindow * _arg0; + wxWindowID _arg1; + wxString * _arg2; + wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; + wxSize * _arg4 = (wxSize *) &wxDefaultSize; + long _arg5 = (long ) 0; + wxValidator * _arg6 = (wxValidator *) &wxDefaultValidator; + char * _arg7 = (char *) "toggle"; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + wxPoint temp; + PyObject * _obj3 = 0; + wxSize temp0; + PyObject * _obj4 = 0; + PyObject * _argo6 = 0; + char *_kwnames[] = { "parent","id","label","pos","size","style","validator","name", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|OOlOs:new_wxToggleButton",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_obj4,&_arg5,&_argo6,&_arg7)) + 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_wxToggleButton. Expected _wxWindow_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} + if (_obj3) +{ + _arg3 = &temp; + if (! wxPoint_helper(_obj3, &_arg3)) + return NULL; +} + if (_obj4) +{ + _arg4 = &temp0; + if (! wxSize_helper(_obj4, &_arg4)) + return NULL; +} + if (_argo6) { + if (_argo6 == Py_None) { _arg6 = NULL; } + else if (SWIG_GetPtrObj(_argo6,(void **) &_arg6,"_wxValidator_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 7 of new_wxToggleButton. Expected _wxValidator_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxToggleButton *)new_wxToggleButton(_arg0,_arg1,*_arg2,*_arg3,*_arg4,_arg5,*_arg6,_arg7); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxToggleButton_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxToggleButton_SetValue(_swigobj,_swigarg0) (_swigobj->SetValue(_swigarg0)) +static PyObject *_wrap_wxToggleButton_SetValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToggleButton * _arg0; + bool _arg1; + PyObject * _argo0 = 0; + int tempbool1; + char *_kwnames[] = { "self","value", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxToggleButton_SetValue",_kwnames,&_argo0,&tempbool1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToggleButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToggleButton_SetValue. Expected _wxToggleButton_p."); + return NULL; + } + } + _arg1 = (bool ) tempbool1; +{ + wxPy_BEGIN_ALLOW_THREADS; + wxToggleButton_SetValue(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxToggleButton_GetValue(_swigobj) (_swigobj->GetValue()) +static PyObject *_wrap_wxToggleButton_GetValue(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxToggleButton * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToggleButton_GetValue",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToggleButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToggleButton_GetValue. Expected _wxToggleButton_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxToggleButton_GetValue(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxToggleButton_SetLabel(_swigobj,_swigarg0) (_swigobj->SetLabel(_swigarg0)) +static PyObject *_wrap_wxToggleButton_SetLabel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToggleButton * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","label", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToggleButton_SetLabel",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToggleButton_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToggleButton_SetLabel. Expected _wxToggleButton_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxToggleButton_SetLabel(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + static PyMethodDef controlscMethods[] = { + { "wxToggleButton_SetLabel", (PyCFunction) _wrap_wxToggleButton_SetLabel, METH_VARARGS | METH_KEYWORDS }, + { "wxToggleButton_GetValue", (PyCFunction) _wrap_wxToggleButton_GetValue, METH_VARARGS | METH_KEYWORDS }, + { "wxToggleButton_SetValue", (PyCFunction) _wrap_wxToggleButton_SetValue, METH_VARARGS | METH_KEYWORDS }, + { "new_wxToggleButton", (PyCFunction) _wrap_new_wxToggleButton, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_SetValue", (PyCFunction) _wrap_wxSpinCtrl_SetValue, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_SetRange", (PyCFunction) _wrap_wxSpinCtrl_SetRange, METH_VARARGS | METH_KEYWORDS }, { "wxSpinCtrl_GetValue", (PyCFunction) _wrap_wxSpinCtrl_GetValue, METH_VARARGS | METH_KEYWORDS }, @@ -8020,6 +8244,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, + { "_class_wxEvtHandler","_class_wxToggleButton",SwigwxToggleButtonTowxEvtHandler}, + { "_class_wxEvtHandler","_wxToggleButton",SwigwxToggleButtonTowxEvtHandler}, { "_class_wxEvtHandler","_class_wxSpinCtrl",SwigwxSpinCtrlTowxEvtHandler}, { "_class_wxEvtHandler","_wxSpinCtrl",SwigwxSpinCtrlTowxEvtHandler}, { "_class_wxEvtHandler","_class_wxSlider",SwigwxSliderTowxEvtHandler}, @@ -8119,6 +8345,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDataObject","_wxDataObject",0}, { "_wxStaticLine","_class_wxStaticLine",0}, { "_wxBrush","_class_wxBrush",0}, + { "_wxToggleButton","_class_wxToggleButton",0}, { "_wxDataFormat","_class_wxDataFormat",0}, { "_class_wxDataObjectSimple","_wxDataObjectSimple",0}, { "_wxShowEvent","_class_wxShowEvent",0}, @@ -8215,6 +8442,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxBrush","_wxBrush",0}, { "_unsigned_short","_WXTYPE",0}, { "_unsigned_short","_short",0}, + { "_class_wxWindow","_class_wxToggleButton",SwigwxToggleButtonTowxWindow}, + { "_class_wxWindow","_wxToggleButton",SwigwxToggleButtonTowxWindow}, { "_class_wxWindow","_class_wxSpinCtrl",SwigwxSpinCtrlTowxWindow}, { "_class_wxWindow","_wxSpinCtrl",SwigwxSpinCtrlTowxWindow}, { "_class_wxWindow","_class_wxSlider",SwigwxSliderTowxWindow}, @@ -8286,6 +8515,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_char","_byte",0}, { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, + { "_wxControl","_class_wxToggleButton",SwigwxToggleButtonTowxControl}, + { "_wxControl","_wxToggleButton",SwigwxToggleButtonTowxControl}, { "_wxControl","_class_wxSpinCtrl",SwigwxSpinCtrlTowxControl}, { "_wxControl","_wxSpinCtrl",SwigwxSpinCtrlTowxControl}, { "_wxControl","_class_wxSlider",SwigwxSliderTowxControl}, @@ -8399,6 +8630,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxValidator","_class_wxValidator",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_wxIconizeEvent","_class_wxIconizeEvent",0}, + { "_class_wxControl","_class_wxToggleButton",SwigwxToggleButtonTowxControl}, + { "_class_wxControl","_wxToggleButton",SwigwxToggleButtonTowxControl}, { "_class_wxControl","_class_wxSpinCtrl",SwigwxSpinCtrlTowxControl}, { "_class_wxControl","_wxSpinCtrl",SwigwxSpinCtrlTowxControl}, { "_class_wxControl","_class_wxSlider",SwigwxSliderTowxControl}, @@ -8456,6 +8689,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEraseEvent","_class_wxEraseEvent",0}, { "_wxDataObjectComposite","_class_wxDataObjectComposite",0}, { "_class_wxJoystickEvent","_wxJoystickEvent",0}, + { "_class_wxToggleButton","_wxToggleButton",0}, { "_wxRegion","_class_wxRegion",0}, { "_class_wxShowEvent","_wxShowEvent",0}, { "_wxPyDropTarget","_class_wxPyDropTarget",0}, @@ -8474,6 +8708,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxMemoryDC","_wxMemoryDC",0}, { "_wxPyTextDropTarget","_class_wxPyTextDropTarget",0}, { "_wxMenuBar","_class_wxMenuBar",0}, + { "_wxEvtHandler","_class_wxToggleButton",SwigwxToggleButtonTowxEvtHandler}, + { "_wxEvtHandler","_wxToggleButton",SwigwxToggleButtonTowxEvtHandler}, { "_wxEvtHandler","_class_wxSpinCtrl",SwigwxSpinCtrlTowxEvtHandler}, { "_wxEvtHandler","_wxSpinCtrl",SwigwxSpinCtrlTowxEvtHandler}, { "_wxEvtHandler","_class_wxSlider",SwigwxSliderTowxEvtHandler}, @@ -8524,6 +8760,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxFileDataObject","_class_wxFileDataObject",0}, { "_class_wxEraseEvent","_wxEraseEvent",0}, { "_class_wxDataObjectComposite","_wxDataObjectComposite",0}, + { "_wxWindow","_class_wxToggleButton",SwigwxToggleButtonTowxWindow}, + { "_wxWindow","_wxToggleButton",SwigwxToggleButtonTowxWindow}, { "_wxWindow","_class_wxSpinCtrl",SwigwxSpinCtrlTowxWindow}, { "_wxWindow","_wxSpinCtrl",SwigwxSpinCtrlTowxWindow}, { "_wxWindow","_class_wxSlider",SwigwxSliderTowxWindow}, @@ -8579,6 +8817,7 @@ SWIGEXPORT(void) initcontrolsc() { d = PyModule_GetDict(m); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultValidator",_wrap_wxDefaultValidator_get, _wrap_wxDefaultValidator_set); + PyDict_SetItemString(d,"wxEVT_COMMAND_TOGGLEBUTTON_CLICKED", PyInt_FromLong((long) wxEVT_COMMAND_TOGGLEBUTTON_CLICKED)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 974248219c..99523aed00 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -831,6 +831,29 @@ class wxSpinCtrl(wxSpinCtrlPtr): +class wxToggleButtonPtr(wxControlPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def SetValue(self, *_args, **_kwargs): + val = apply(controlsc.wxToggleButton_SetValue,(self,) + _args, _kwargs) + return val + def GetValue(self, *_args, **_kwargs): + val = apply(controlsc.wxToggleButton_GetValue,(self,) + _args, _kwargs) + return val + def SetLabel(self, *_args, **_kwargs): + val = apply(controlsc.wxToggleButton_SetLabel,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxToggleButton(wxToggleButtonPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(controlsc.new_wxToggleButton,_args,_kwargs) + self.thisown = 1 + + + + #-------------- FUNCTION WRAPPERS ------------------ @@ -846,3 +869,4 @@ def wxButton_GetDefaultSize(*_args, **_kwargs): cvar = controlsc.cvar wxDefaultValidator = wxValidatorPtr(controlsc.cvar.wxDefaultValidator) +wxEVT_COMMAND_TOGGLEBUTTON_CLICKED = controlsc.wxEVT_COMMAND_TOGGLEBUTTON_CLICKED diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index 18fe544203..efc2ff1a38 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -8725,6 +8725,7 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_ACTIVATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK)); PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_END_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_END_DRAG)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index ed3bb0c9b7..1dd621cd73 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -934,3 +934,4 @@ wxEVT_COMMAND_TREE_KEY_DOWN = controls2c.wxEVT_COMMAND_TREE_KEY_DOWN wxEVT_COMMAND_TREE_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_TREE_ITEM_ACTIVATED wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK +wxEVT_COMMAND_TREE_END_DRAG = controls2c.wxEVT_COMMAND_TREE_END_DRAG diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp index d7a20a3695..782920488a 100644 --- a/wxPython/src/msw/events.cpp +++ b/wxPython/src/msw/events.cpp @@ -2205,6 +2205,87 @@ static PyObject *_wrap_wxMouseEvent_GetY(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define wxMouseEvent_GetWheelRotation(_swigobj) (_swigobj->GetWheelRotation()) +static PyObject *_wrap_wxMouseEvent_GetWheelRotation(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_GetWheelRotation",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_GetWheelRotation. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_GetWheelRotation(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_GetWheelDelta(_swigobj) (_swigobj->GetWheelDelta()) +static PyObject *_wrap_wxMouseEvent_GetWheelDelta(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_GetWheelDelta",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_GetWheelDelta. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_GetWheelDelta(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_GetLinesPerAction(_swigobj) (_swigobj->GetLinesPerAction()) +static PyObject *_wrap_wxMouseEvent_GetLinesPerAction(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_GetLinesPerAction",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_GetLinesPerAction. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_GetLinesPerAction(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxMouseEvent_m_x_set(_swigobj,_swigval) (_swigobj->m_x = _swigval,_swigval) static PyObject *_wrap_wxMouseEvent_m_x_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2714,6 +2795,171 @@ static PyObject *_wrap_wxMouseEvent_m_metaDown_get(PyObject *self, PyObject *arg return _resultobj; } +#define wxMouseEvent_m_wheelRotation_set(_swigobj,_swigval) (_swigobj->m_wheelRotation = _swigval,_swigval) +static PyObject *_wrap_wxMouseEvent_m_wheelRotation_set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","m_wheelRotation", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxMouseEvent_m_wheelRotation_set",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_wheelRotation_set. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_wheelRotation_set(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_m_wheelRotation_get(_swigobj) ((int ) _swigobj->m_wheelRotation) +static PyObject *_wrap_wxMouseEvent_m_wheelRotation_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_m_wheelRotation_get",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_wheelRotation_get. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_wheelRotation_get(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_m_wheelDelta_set(_swigobj,_swigval) (_swigobj->m_wheelDelta = _swigval,_swigval) +static PyObject *_wrap_wxMouseEvent_m_wheelDelta_set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","m_wheelDelta", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxMouseEvent_m_wheelDelta_set",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_wheelDelta_set. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_wheelDelta_set(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_m_wheelDelta_get(_swigobj) ((int ) _swigobj->m_wheelDelta) +static PyObject *_wrap_wxMouseEvent_m_wheelDelta_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_m_wheelDelta_get",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_wheelDelta_get. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_wheelDelta_get(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_m_linesPerAction_set(_swigobj,_swigval) (_swigobj->m_linesPerAction = _swigval,_swigval) +static PyObject *_wrap_wxMouseEvent_m_linesPerAction_set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","m_linesPerAction", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxMouseEvent_m_linesPerAction_set",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_linesPerAction_set. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_linesPerAction_set(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxMouseEvent_m_linesPerAction_get(_swigobj) ((int ) _swigobj->m_linesPerAction) +static PyObject *_wrap_wxMouseEvent_m_linesPerAction_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxMouseEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseEvent_m_linesPerAction_get",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseEvent_m_linesPerAction_get. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxMouseEvent_m_linesPerAction_get(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxKeyEventTowxEvent(void *ptr) { wxKeyEvent *src; wxEvent *dest; @@ -6210,6 +6456,12 @@ static PyMethodDef eventscMethods[] = { { "wxKeyEvent_MetaDown", (PyCFunction) _wrap_wxKeyEvent_MetaDown, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_ControlDown", (PyCFunction) _wrap_wxKeyEvent_ControlDown, METH_VARARGS | METH_KEYWORDS }, { "new_wxKeyEvent", (PyCFunction) _wrap_new_wxKeyEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_linesPerAction_get", (PyCFunction) _wrap_wxMouseEvent_m_linesPerAction_get, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_linesPerAction_set", (PyCFunction) _wrap_wxMouseEvent_m_linesPerAction_set, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_wheelDelta_get", (PyCFunction) _wrap_wxMouseEvent_m_wheelDelta_get, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_wheelDelta_set", (PyCFunction) _wrap_wxMouseEvent_m_wheelDelta_set, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_wheelRotation_get", (PyCFunction) _wrap_wxMouseEvent_m_wheelRotation_get, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_m_wheelRotation_set", (PyCFunction) _wrap_wxMouseEvent_m_wheelRotation_set, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_m_metaDown_get", (PyCFunction) _wrap_wxMouseEvent_m_metaDown_get, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_m_metaDown_set", (PyCFunction) _wrap_wxMouseEvent_m_metaDown_set, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_m_altDown_get", (PyCFunction) _wrap_wxMouseEvent_m_altDown_get, METH_VARARGS | METH_KEYWORDS }, @@ -6228,6 +6480,9 @@ static PyMethodDef eventscMethods[] = { { "wxMouseEvent_m_y_set", (PyCFunction) _wrap_wxMouseEvent_m_y_set, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_m_x_get", (PyCFunction) _wrap_wxMouseEvent_m_x_get, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_m_x_set", (PyCFunction) _wrap_wxMouseEvent_m_x_set, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_GetLinesPerAction", (PyCFunction) _wrap_wxMouseEvent_GetLinesPerAction, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_GetWheelDelta", (PyCFunction) _wrap_wxMouseEvent_GetWheelDelta, METH_VARARGS | METH_KEYWORDS }, + { "wxMouseEvent_GetWheelRotation", (PyCFunction) _wrap_wxMouseEvent_GetWheelRotation, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_GetY", (PyCFunction) _wrap_wxMouseEvent_GetY, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_GetX", (PyCFunction) _wrap_wxMouseEvent_GetX, METH_VARARGS | METH_KEYWORDS }, { "wxMouseEvent_GetLogicalPosition", (PyCFunction) _wrap_wxMouseEvent_GetLogicalPosition, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/events.py b/wxPython/src/msw/events.py index 8dbc2d265c..f305171982 100644 --- a/wxPython/src/msw/events.py +++ b/wxPython/src/msw/events.py @@ -298,6 +298,15 @@ class wxMouseEventPtr(wxEventPtr): def GetY(self, *_args, **_kwargs): val = apply(eventsc.wxMouseEvent_GetY,(self,) + _args, _kwargs) return val + def GetWheelRotation(self, *_args, **_kwargs): + val = apply(eventsc.wxMouseEvent_GetWheelRotation,(self,) + _args, _kwargs) + return val + def GetWheelDelta(self, *_args, **_kwargs): + val = apply(eventsc.wxMouseEvent_GetWheelDelta,(self,) + _args, _kwargs) + return val + def GetLinesPerAction(self, *_args, **_kwargs): + val = apply(eventsc.wxMouseEvent_GetLinesPerAction,(self,) + _args, _kwargs) + return val def __setattr__(self,name,value): if name == "m_x" : eventsc.wxMouseEvent_m_x_set(self,value) @@ -326,6 +335,15 @@ class wxMouseEventPtr(wxEventPtr): if name == "m_metaDown" : eventsc.wxMouseEvent_m_metaDown_set(self,value) return + if name == "m_wheelRotation" : + eventsc.wxMouseEvent_m_wheelRotation_set(self,value) + return + if name == "m_wheelDelta" : + eventsc.wxMouseEvent_m_wheelDelta_set(self,value) + return + if name == "m_linesPerAction" : + eventsc.wxMouseEvent_m_linesPerAction_set(self,value) + return self.__dict__[name] = value def __getattr__(self,name): if name == "m_x" : @@ -346,6 +364,12 @@ class wxMouseEventPtr(wxEventPtr): return eventsc.wxMouseEvent_m_altDown_get(self) if name == "m_metaDown" : return eventsc.wxMouseEvent_m_metaDown_get(self) + if name == "m_wheelRotation" : + return eventsc.wxMouseEvent_m_wheelRotation_get(self) + if name == "m_wheelDelta" : + return eventsc.wxMouseEvent_m_wheelDelta_get(self) + if name == "m_linesPerAction" : + return eventsc.wxMouseEvent_m_linesPerAction_get(self) raise AttributeError,name def __repr__(self): return "" % (self.this,) diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index 071e38d270..49b88ac2ac 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -2913,6 +2913,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDataObject","_wxDataObject",0}, { "_wxStaticLine","_class_wxStaticLine",0}, { "_wxBrush","_class_wxBrush",0}, + { "_wxToggleButton","_class_wxToggleButton",0}, { "_wxDataFormat","_class_wxDataFormat",0}, { "_class_wxDataObjectSimple","_wxDataObjectSimple",0}, { "_wxShowEvent","_class_wxShowEvent",0}, @@ -3131,6 +3132,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEraseEvent","_class_wxEraseEvent",0}, { "_wxDataObjectComposite","_class_wxDataObjectComposite",0}, { "_class_wxJoystickEvent","_wxJoystickEvent",0}, + { "_class_wxToggleButton","_wxToggleButton",0}, { "_wxRegion","_class_wxRegion",0}, { "_wxSizer","_class_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer}, { "_wxSizer","_wxFlexGridSizer",SwigwxFlexGridSizerTowxSizer}, diff --git a/wxPython/src/msw/sizers.py b/wxPython/src/msw/sizers.py index 9dbce08acb..bfd80918ca 100644 --- a/wxPython/src/msw/sizers.py +++ b/wxPython/src/msw/sizers.py @@ -182,37 +182,37 @@ class wxSizerPtr : def __repr__(self): return "" % (self.this,) - def Add(self, *args): + def Add(self, *args, **kw): if type(args[0]) == type(1): - apply(self.AddSpacer, args) + apply(self.AddSpacer, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.AddSizer, args) + apply(self.AddSizer, args, kw) else: - apply(self.AddWindow, args) + apply(self.AddWindow, args, kw) - def Insert(self, *args): + def Insert(self, *args, **kw): if type(args[1]) == type(1): - apply(self.InsertSpacer, args) + apply(self.InsertSpacer, args, kw) elif string.find(args[1].this, 'Sizer') != -1: - apply(self.InsertSizer, args) + apply(self.InsertSizer, args, kw) else: - apply(self.InsertWindow, args) + apply(self.InsertWindow, args, kw) - def Prepend(self, *args): + def Prepend(self, *args, **kw): if type(args[0]) == type(1): - apply(self.PrependSpacer, args) + apply(self.PrependSpacer, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.PrependSizer, args) + apply(self.PrependSizer, args, kw) else: - apply(self.PrependWindow, args) + apply(self.PrependWindow, args, kw) - def Remove(self, *args): + def Remove(self, *args, **kw): if type(args[0]) == type(1): - apply(self.RemovePos, args) + apply(self.RemovePos, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.RemoveSizer, args) + apply(self.RemoveSizer, args, kw) else: - apply(self.RemoveWindow, args) + apply(self.RemoveWindow, args, kw) def AddMany(self, widgets): for childinfo in widgets: diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index c7b632c8af..1417838505 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -6599,6 +6599,116 @@ static PyObject *_wrap_wxScrolledWindow_CalcUnscrolledPosition(PyObject *self, P return _resultobj; } +#define wxScrolledWindow_SetScale(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetScale(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxScrolledWindow_SetScale(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrolledWindow * _arg0; + double _arg1; + double _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","xs","ys", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Odd:wxScrolledWindow_SetScale",_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_SetScale. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxScrolledWindow_SetScale(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxScrolledWindow_GetScaleX(_swigobj) (_swigobj->GetScaleX()) +static PyObject *_wrap_wxScrolledWindow_GetScaleX(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_GetScaleX",_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_GetScaleX. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (double )wxScrolledWindow_GetScaleX(_arg0); + + wxPy_END_ALLOW_THREADS; +} _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; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (double )wxScrolledWindow_GetScaleY(_arg0); + + wxPy_END_ALLOW_THREADS; +} _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; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxScrolledWindow_AdjustScrollbars(_arg0); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxMenuTowxEvtHandler(void *ptr) { wxMenu *src; wxEvtHandler *dest; @@ -10209,6 +10319,10 @@ static PyMethodDef windowscMethods[] = { { "wxMenu_AppendMenu", (PyCFunction) _wrap_wxMenu_AppendMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Append", (PyCFunction) _wrap_wxMenu_Append, METH_VARARGS | METH_KEYWORDS }, { "new_wxMenu", (PyCFunction) _wrap_new_wxMenu, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_AdjustScrollbars", (PyCFunction) _wrap_wxScrolledWindow_AdjustScrollbars, METH_VARARGS | METH_KEYWORDS }, + { "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_ViewStart", (PyCFunction) _wrap_wxScrolledWindow_ViewStart, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 55bd7cbc9d..bb7a321ced 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -705,6 +705,18 @@ class wxScrolledWindowPtr(wxPanelPtr): def CalcUnscrolledPosition(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_CalcUnscrolledPosition,(self,) + _args, _kwargs) return val + def SetScale(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_SetScale,(self,) + _args, _kwargs) + return val + def GetScaleX(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetScaleX,(self,) + _args, _kwargs) + return val + def GetScaleY(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetScaleY,(self,) + _args, _kwargs) + return val + def AdjustScrollbars(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_AdjustScrollbars,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxScrolledWindow(wxScrolledWindowPtr): diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index cf5f953a68..a3a80ea265 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -1923,6 +1923,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStaticLine","_class_wxStaticLine",0}, { "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0}, { "_wxBrush","_class_wxBrush",0}, + { "_wxToggleButton","_class_wxToggleButton",0}, { "_wxMiniFrame","_class_wxMiniFrame",0}, { "_class_wxNotebookEvent","_wxNotebookEvent",0}, { "_class_wxPyPrintout","_wxPyPrintout",0}, @@ -2245,6 +2246,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxDataObjectComposite","_class_wxDataObjectComposite",0}, { "_class_wxJoystickEvent","_wxJoystickEvent",0}, { "_class_wxTipProvider","_wxTipProvider",0}, + { "_class_wxToggleButton","_wxToggleButton",0}, { "_class_wxMiniFrame","_wxMiniFrame",0}, { "_wxFontDialog","_class_wxFontDialog",0}, { "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0}, @@ -2615,6 +2617,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxJOY_BUTTON3", PyInt_FromLong((long) wxJOY_BUTTON3)); PyDict_SetItemString(d,"wxJOY_BUTTON4", PyInt_FromLong((long) wxJOY_BUTTON4)); PyDict_SetItemString(d,"wxJOY_BUTTON_ANY", PyInt_FromLong((long) wxJOY_BUTTON_ANY)); + PyDict_SetItemString(d,"wxWS_EX_VALIDATE_RECURSIVELY", PyInt_FromLong((long) wxWS_EX_VALIDATE_RECURSIVELY)); PyDict_SetItemString(d,"wxDEFAULT", PyInt_FromLong((long) wxDEFAULT)); PyDict_SetItemString(d,"wxDECORATIVE", PyInt_FromLong((long) wxDECORATIVE)); PyDict_SetItemString(d,"wxROMAN", PyInt_FromLong((long) wxROMAN)); @@ -2898,6 +2901,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_TOOL_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_TOOL_ENTER)); PyDict_SetItemString(d,"wxEVT_SET_FOCUS", PyInt_FromLong((long) wxEVT_SET_FOCUS)); PyDict_SetItemString(d,"wxEVT_KILL_FOCUS", PyInt_FromLong((long) wxEVT_KILL_FOCUS)); + PyDict_SetItemString(d,"wxEVT_MOUSEWHEEL", PyInt_FromLong((long) wxEVT_MOUSEWHEEL)); PyDict_SetItemString(d,"wxEVT_LEFT_DOWN", PyInt_FromLong((long) wxEVT_LEFT_DOWN)); PyDict_SetItemString(d,"wxEVT_LEFT_UP", PyInt_FromLong((long) wxEVT_LEFT_UP)); PyDict_SetItemString(d,"wxEVT_MIDDLE_DOWN", PyInt_FromLong((long) wxEVT_MIDDLE_DOWN)); @@ -2989,7 +2993,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_ENTER)); PyDict_SetItemString(d,"wxEVT_NAVIGATION_KEY", PyInt_FromLong((long) wxEVT_NAVIGATION_KEY)); PyDict_SetItemString(d,"wxEVT_TIMER", PyInt_FromLong((long) wxEVT_TIMER)); - PyDict_SetItemString(d,"wxWS_EX_VALIDATE_RECURSIVELY", PyInt_FromLong((long) wxWS_EX_VALIDATE_RECURSIVELY)); PyDict_SetItemString(d,"__version__", PyString_FromString("0.0.0")); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultPosition",_wrap_wxDefaultPosition_get, _wrap_wxDefaultPosition_set); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 848e3ce687..b651c3792a 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -454,6 +454,7 @@ wxJOY_BUTTON2 = wxc.wxJOY_BUTTON2 wxJOY_BUTTON3 = wxc.wxJOY_BUTTON3 wxJOY_BUTTON4 = wxc.wxJOY_BUTTON4 wxJOY_BUTTON_ANY = wxc.wxJOY_BUTTON_ANY +wxWS_EX_VALIDATE_RECURSIVELY = wxc.wxWS_EX_VALIDATE_RECURSIVELY wxDEFAULT = wxc.wxDEFAULT wxDECORATIVE = wxc.wxDECORATIVE wxROMAN = wxc.wxROMAN @@ -737,6 +738,7 @@ wxEVT_COMMAND_TOOL_RCLICKED = wxc.wxEVT_COMMAND_TOOL_RCLICKED wxEVT_COMMAND_TOOL_ENTER = wxc.wxEVT_COMMAND_TOOL_ENTER wxEVT_SET_FOCUS = wxc.wxEVT_SET_FOCUS wxEVT_KILL_FOCUS = wxc.wxEVT_KILL_FOCUS +wxEVT_MOUSEWHEEL = wxc.wxEVT_MOUSEWHEEL wxEVT_LEFT_DOWN = wxc.wxEVT_LEFT_DOWN wxEVT_LEFT_UP = wxc.wxEVT_LEFT_UP wxEVT_MIDDLE_DOWN = wxc.wxEVT_MIDDLE_DOWN @@ -828,7 +830,6 @@ wxEVT_COMMAND_KILL_FOCUS = wxc.wxEVT_COMMAND_KILL_FOCUS wxEVT_COMMAND_ENTER = wxc.wxEVT_COMMAND_ENTER wxEVT_NAVIGATION_KEY = wxc.wxEVT_NAVIGATION_KEY wxEVT_TIMER = wxc.wxEVT_TIMER -wxWS_EX_VALIDATE_RECURSIVELY = wxc.wxWS_EX_VALIDATE_RECURSIVELY __version__ = wxc.__version__ cvar = wxc.cvar wxDefaultPosition = wxPointPtr(wxc.cvar.wxDefaultPosition) @@ -1008,6 +1009,8 @@ def EVT_LEAVE_WINDOW(win, func): def EVT_ENTER_WINDOW(win, func): win.Connect(-1, -1, wxEVT_ENTER_WINDOW, func) +def EVT_MOUSEWHEEL(win, func): + win.Connect(-1, -1, wxEVT_MOUSEWHEEL, func) # all mouse events def EVT_MOUSE_EVENTS(win, func): @@ -1282,6 +1285,9 @@ def EVT_TREE_BEGIN_DRAG(win, id, func): def EVT_TREE_BEGIN_RDRAG(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_RDRAG, func) +def EVT_TREE_END_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TREE_END_DRAG, func) + def EVT_TREE_BEGIN_LABEL_EDIT(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, func) @@ -1472,6 +1478,11 @@ def EVT_JOYSTICK_EVENTS(win, func): win.Connect(-1, -1, wxEVT_JOY_MOVE, func) win.Connect(-1, -1, wxEVT_JOY_ZMOVE, func) + +def EVT_TOGGLEBUTTON(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, func) + + #---------------------------------------------------------------------- class wxTimer(wxPyTimer): diff --git a/wxPython/src/sizers.i b/wxPython/src/sizers.i index ab4bd97f15..1c025d3f92 100644 --- a/wxPython/src/sizers.i +++ b/wxPython/src/sizers.i @@ -159,37 +159,37 @@ public: %pragma(python) addtoclass = " - def Add(self, *args): + def Add(self, *args, **kw): if type(args[0]) == type(1): - apply(self.AddSpacer, args) + apply(self.AddSpacer, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.AddSizer, args) + apply(self.AddSizer, args, kw) else: - apply(self.AddWindow, args) + apply(self.AddWindow, args, kw) - def Insert(self, *args): + def Insert(self, *args, **kw): if type(args[1]) == type(1): - apply(self.InsertSpacer, args) + apply(self.InsertSpacer, args, kw) elif string.find(args[1].this, 'Sizer') != -1: - apply(self.InsertSizer, args) + apply(self.InsertSizer, args, kw) else: - apply(self.InsertWindow, args) + apply(self.InsertWindow, args, kw) - def Prepend(self, *args): + def Prepend(self, *args, **kw): if type(args[0]) == type(1): - apply(self.PrependSpacer, args) + apply(self.PrependSpacer, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.PrependSizer, args) + apply(self.PrependSizer, args, kw) else: - apply(self.PrependWindow, args) + apply(self.PrependWindow, args, kw) - def Remove(self, *args): + def Remove(self, *args, **kw): if type(args[0]) == type(1): - apply(self.RemovePos, args) + apply(self.RemovePos, args, kw) elif string.find(args[0].this, 'Sizer') != -1: - apply(self.RemoveSizer, args) + apply(self.RemoveSizer, args, kw) else: - apply(self.RemoveWindow, args) + apply(self.RemoveWindow, args, kw) def AddMany(self, widgets): for childinfo in widgets: diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 1babb143a1..91d186aeea 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -597,6 +597,11 @@ public: void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT); + void SetScale(double xs, double ys); + double GetScaleX(); + double GetScaleY(); + + void AdjustScrollbars(); }; //---------------------------------------------------------------------- -- 2.45.2