From ebf4302cbe16578f60e51dca83e3defaebb6db28 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 25 Nov 2001 09:10:01 +0000 Subject: [PATCH] Added wxDynamicSashWindow to wxPython, plus other odds and ends. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 7 +- wxPython/MANIFEST.in | 9 + wxPython/contrib/gizmos/.cvsignore | 1 + wxPython/contrib/gizmos/_gizmoextras.py | 5 + wxPython/contrib/gizmos/gizmos.cpp | 610 ++++++++++++++++++++++++ wxPython/contrib/gizmos/gizmos.i | 169 +++++++ wxPython/contrib/gizmos/gizmos.py | 130 +++++ wxPython/contrib/stc/msw/stc_.cpp | 127 ++++- wxPython/contrib/stc/msw/stc_.py | 11 +- wxPython/demo/Main.py | 2 + wxPython/demo/wxDynamicSashWindow.py | 151 ++++++ wxPython/distrib/make_installer.py | 1 + wxPython/setup.py | 48 +- wxPython/src/_defs.i | 14 +- wxPython/src/controls.i | 3 + wxPython/src/controls2.i | 3 +- wxPython/src/events.i | 2 +- wxPython/src/msw/controls.cpp | 29 ++ wxPython/src/msw/controls.py | 3 + wxPython/src/msw/controls2.cpp | 117 ++--- wxPython/src/msw/controls2.py | 13 +- wxPython/src/msw/events.cpp | 28 -- wxPython/src/msw/events.py | 5 +- wxPython/src/msw/wx.cpp | 9 +- wxPython/src/msw/wx.py | 9 +- 25 files changed, 1359 insertions(+), 147 deletions(-) create mode 100644 wxPython/contrib/gizmos/.cvsignore create mode 100644 wxPython/contrib/gizmos/_gizmoextras.py create mode 100644 wxPython/contrib/gizmos/gizmos.cpp create mode 100644 wxPython/contrib/gizmos/gizmos.i create mode 100644 wxPython/contrib/gizmos/gizmos.py create mode 100644 wxPython/demo/wxDynamicSashWindow.py diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 4b3e749313..168cee6bb5 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -2,7 +2,7 @@ CHANGES.txt for wxPython ---------------------------------------------------------------------- -2.3.2 (pre) +2.3.2 ----- Added EVT_HELP, EVT_HELP_RANGE, EVT_DETAILED_HELP, EVT_DETAILED_HELP_RANGE, EVT_CONTEXT_MENU, wxHelpEvent, @@ -88,6 +88,11 @@ Added wxPopupWindow and wxPopupTransientWindow. Added wxFileHistory. +Added wxDynamicSashWindow, whcih allows you to endlessly split widnows +by dragging a little tab next to the scrollbars. Added a demo to show +this and also the ability of multiple wxStyledStectCtrls to share the +same document. + diff --git a/wxPython/MANIFEST.in b/wxPython/MANIFEST.in index 43b0fcbc1b..fd87a7b4c0 100644 --- a/wxPython/MANIFEST.in +++ b/wxPython/MANIFEST.in @@ -156,3 +156,12 @@ include contrib/xrc/contrib/src/xrc/expat/xmlparse/*.c include contrib/xrc/contrib/src/xrc/expat/xmlparse/*.h include contrib/xrc/contrib/src/xrc/expat/xmltok/*.c include contrib/xrc/contrib/src/xrc/expat/xmltok/*.h + +include contrib/gizmos/*.txt +include contrib/gizmos/*.i +include contrib/gizmos/*.py +include contrib/gizmos/*.cpp +include contrib/gizmos/*.c +include contrib/gizmos/*.h +include contrib/gizmos/contrib/include/wx/gizmos/*.h +include contrib/gizmos/contrib/src/gizmos/*.cpp diff --git a/wxPython/contrib/gizmos/.cvsignore b/wxPython/contrib/gizmos/.cvsignore new file mode 100644 index 0000000000..41ca5f0c6b --- /dev/null +++ b/wxPython/contrib/gizmos/.cvsignore @@ -0,0 +1 @@ +contrib diff --git a/wxPython/contrib/gizmos/_gizmoextras.py b/wxPython/contrib/gizmos/_gizmoextras.py new file mode 100644 index 0000000000..43ed797c50 --- /dev/null +++ b/wxPython/contrib/gizmos/_gizmoextras.py @@ -0,0 +1,5 @@ +# Stuff these names into the wx namespace so wxPyConstructObject can find them + +wx.wxDynamicSashSplitEventPtr = wxDynamicSashSplitEventPtr +wx.wxDynamicSashUnifyEventPtr = wxDynamicSashUnifyEventPtr +wx.wxDynamicSashWindowPtr = wxDynamicSashWindowPtr diff --git a/wxPython/contrib/gizmos/gizmos.cpp b/wxPython/contrib/gizmos/gizmos.cpp new file mode 100644 index 0000000000..65cb5bad2a --- /dev/null +++ b/wxPython/contrib/gizmos/gizmos.cpp @@ -0,0 +1,610 @@ +/* + * FILE : contrib/gizmos/gizmos.cpp + * + * This file was automatically generated by : + * Simplified Wrapper and Interface Generator (SWIG) + * Version 1.1 (Build 883) + * + * Portions Copyright (c) 1995-1998 + * The University of Utah and The Regents of the University of California. + * Permission is granted to distribute this file in any manner provided + * this notice remains intact. + * + * Do not make changes to this file--changes will be lost! + * + */ + + +#define SWIGCODE +/* Implementation : PYTHON */ + +#define SWIGPYTHON +#include +#include +/* Definitions for Windows/Unix exporting */ +#if defined(__WIN32__) +# if defined(_MSC_VER) +# define SWIGEXPORT(a) __declspec(dllexport) a +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +#endif + +#include "Python.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern void SWIG_MakePtr(char *, void *, char *); +extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); +extern char *SWIG_GetPtr(char *, void **, char *); +extern char *SWIG_GetPtrObj(PyObject *, void **, char *); +extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); +extern PyObject *SWIG_newvarlink(void); +#ifdef __cplusplus +} +#endif +#define SWIG_init initgizmosc + +#define SWIG_name "gizmosc" + +#include "export.h" +#include "wx/gizmos/dynamicsash.h" + + +static PyObject* t_output_helper(PyObject* target, PyObject* o) { + PyObject* o2; + PyObject* o3; + + if (!target) { + target = o; + } else if (target == Py_None) { + Py_DECREF(Py_None); + target = o; + } else { + if (!PyTuple_Check(target)) { + o2 = target; + target = PyTuple_New(1); + PyTuple_SetItem(target, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SetItem(o3, 0, o); + + o2 = target; + target = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return target; +} + +#if PYTHON_API_VERSION >= 1009 + static char* wxStringErrorMsg = "String or Unicode type required"; +#else + static char* wxStringErrorMsg = "String type required"; +#endif +#ifdef __cplusplus +extern "C" { +#endif +static void *SwigwxDynamicSashSplitEventTowxCommandEvent(void *ptr) { + wxDynamicSashSplitEvent *src; + wxCommandEvent *dest; + src = (wxDynamicSashSplitEvent *) ptr; + dest = (wxCommandEvent *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashSplitEventTowxEvent(void *ptr) { + wxDynamicSashSplitEvent *src; + wxEvent *dest; + src = (wxDynamicSashSplitEvent *) ptr; + dest = (wxEvent *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashSplitEventTowxObject(void *ptr) { + wxDynamicSashSplitEvent *src; + wxObject *dest; + src = (wxDynamicSashSplitEvent *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxDynamicSashSplitEvent(_swigarg0) (new wxDynamicSashSplitEvent(_swigarg0)) +static PyObject *_wrap_new_wxDynamicSashSplitEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDynamicSashSplitEvent * _result; + wxObject * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "target", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxDynamicSashSplitEvent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDynamicSashSplitEvent. Expected _wxObject_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxDynamicSashSplitEvent *)new_wxDynamicSashSplitEvent(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDynamicSashSplitEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static void *SwigwxDynamicSashUnifyEventTowxCommandEvent(void *ptr) { + wxDynamicSashUnifyEvent *src; + wxCommandEvent *dest; + src = (wxDynamicSashUnifyEvent *) ptr; + dest = (wxCommandEvent *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashUnifyEventTowxEvent(void *ptr) { + wxDynamicSashUnifyEvent *src; + wxEvent *dest; + src = (wxDynamicSashUnifyEvent *) ptr; + dest = (wxEvent *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashUnifyEventTowxObject(void *ptr) { + wxDynamicSashUnifyEvent *src; + wxObject *dest; + src = (wxDynamicSashUnifyEvent *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxDynamicSashUnifyEvent(_swigarg0) (new wxDynamicSashUnifyEvent(_swigarg0)) +static PyObject *_wrap_new_wxDynamicSashUnifyEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDynamicSashUnifyEvent * _result; + wxObject * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "target", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxDynamicSashUnifyEvent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxObject_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxDynamicSashUnifyEvent. Expected _wxObject_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxDynamicSashUnifyEvent *)new_wxDynamicSashUnifyEvent(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDynamicSashUnifyEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static void *SwigwxDynamicSashWindowTowxWindow(void *ptr) { + wxDynamicSashWindow *src; + wxWindow *dest; + src = (wxDynamicSashWindow *) ptr; + dest = (wxWindow *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashWindowTowxEvtHandler(void *ptr) { + wxDynamicSashWindow *src; + wxEvtHandler *dest; + src = (wxDynamicSashWindow *) ptr; + dest = (wxEvtHandler *) src; + return (void *) dest; +} + +static void *SwigwxDynamicSashWindowTowxObject(void *ptr) { + wxDynamicSashWindow *src; + wxObject *dest; + src = (wxDynamicSashWindow *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxDynamicSashWindow(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (new wxDynamicSashWindow(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) +static PyObject *_wrap_new_wxDynamicSashWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDynamicSashWindow * _result; + wxWindow * _arg0; + wxWindowID _arg1; + wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; + wxSize * _arg3 = (wxSize *) &wxDefaultSize; + long _arg4 = (long ) wxCLIP_CHILDREN|(wxDS_MANAGE_SCROLLBARS)|(wxDS_DRAG_CORNER); + char * _arg5 = (char *) "dynamicSashWindow"; + PyObject * _argo0 = 0; + wxPoint temp; + PyObject * _obj2 = 0; + wxSize temp0; + PyObject * _obj3 = 0; + char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxDynamicSashWindow",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + 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_wxDynamicSashWindow. Expected _wxWindow_p."); + return NULL; + } + } + if (_obj2) +{ + _arg2 = &temp; + if (! wxPoint_helper(_obj2, &_arg2)) + return NULL; +} + if (_obj3) +{ + _arg3 = &temp0; + if (! wxSize_helper(_obj3, &_arg3)) + return NULL; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxDynamicSashWindow *)new_wxDynamicSashWindow(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDynamicSashWindow_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxPreDynamicSashWindow() (new wxDynamicSashWindow()) +static PyObject *_wrap_new_wxPreDynamicSashWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDynamicSashWindow * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxPreDynamicSashWindow",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxDynamicSashWindow *)new_wxPreDynamicSashWindow(); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDynamicSashWindow_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxDynamicSashWindow_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) +static PyObject *_wrap_wxDynamicSashWindow_Create(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxDynamicSashWindow * _arg0; + wxWindow * _arg1; + wxWindowID _arg2; + wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; + wxSize * _arg4 = (wxSize *) &wxDefaultSize; + long _arg5 = (long ) wxCLIP_CHILDREN|(wxDS_MANAGE_SCROLLBARS)|(wxDS_DRAG_CORNER); + char * _arg6 = (char *) "dynamicSashWindow"; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + wxPoint temp; + PyObject * _obj3 = 0; + wxSize temp0; + PyObject * _obj4 = 0; + char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|OOls:wxDynamicSashWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_arg6)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDynamicSashWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDynamicSashWindow_Create. Expected _wxDynamicSashWindow_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDynamicSashWindow_Create. Expected _wxWindow_p."); + return NULL; + } + } + if (_obj3) +{ + _arg3 = &temp; + if (! wxPoint_helper(_obj3, &_arg3)) + return NULL; +} + if (_obj4) +{ + _arg4 = &temp0; + if (! wxSize_helper(_obj4, &_arg4)) + return NULL; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxDynamicSashWindow_Create(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxDynamicSashWindow_GetHScrollBar(_swigobj,_swigarg0) (_swigobj->GetHScrollBar(_swigarg0)) +static PyObject *_wrap_wxDynamicSashWindow_GetHScrollBar(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrollBar * _result; + wxDynamicSashWindow * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDynamicSashWindow_GetHScrollBar",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDynamicSashWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDynamicSashWindow_GetHScrollBar. Expected _wxDynamicSashWindow_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDynamicSashWindow_GetHScrollBar. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxScrollBar *)wxDynamicSashWindow_GetHScrollBar(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxScrollBar_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxDynamicSashWindow_GetVScrollBar(_swigobj,_swigarg0) (_swigobj->GetVScrollBar(_swigarg0)) +static PyObject *_wrap_wxDynamicSashWindow_GetVScrollBar(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrollBar * _result; + wxDynamicSashWindow * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDynamicSashWindow_GetVScrollBar",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDynamicSashWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDynamicSashWindow_GetVScrollBar. Expected _wxDynamicSashWindow_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDynamicSashWindow_GetVScrollBar. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxScrollBar *)wxDynamicSashWindow_GetVScrollBar(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxScrollBar_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static PyMethodDef gizmoscMethods[] = { + { "wxDynamicSashWindow_GetVScrollBar", (PyCFunction) _wrap_wxDynamicSashWindow_GetVScrollBar, METH_VARARGS | METH_KEYWORDS }, + { "wxDynamicSashWindow_GetHScrollBar", (PyCFunction) _wrap_wxDynamicSashWindow_GetHScrollBar, METH_VARARGS | METH_KEYWORDS }, + { "wxDynamicSashWindow_Create", (PyCFunction) _wrap_wxDynamicSashWindow_Create, METH_VARARGS | METH_KEYWORDS }, + { "new_wxPreDynamicSashWindow", (PyCFunction) _wrap_new_wxPreDynamicSashWindow, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDynamicSashWindow", (PyCFunction) _wrap_new_wxDynamicSashWindow, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDynamicSashUnifyEvent", (PyCFunction) _wrap_new_wxDynamicSashUnifyEvent, METH_VARARGS | METH_KEYWORDS }, + { "new_wxDynamicSashSplitEvent", (PyCFunction) _wrap_new_wxDynamicSashSplitEvent, METH_VARARGS | METH_KEYWORDS }, + { NULL, NULL } +}; +#ifdef __cplusplus +} +#endif +/* + * This table is used by the pointer type-checker + */ +static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { + { "_wxEvent","_wxDynamicSashUnifyEvent",SwigwxDynamicSashUnifyEventTowxEvent}, + { "_wxEvent","_wxDynamicSashSplitEvent",SwigwxDynamicSashSplitEventTowxEvent}, + { "_signed_long","_long",0}, + { "_wxPrintQuality","_wxCoord",0}, + { "_wxPrintQuality","_int",0}, + { "_wxPrintQuality","_signed_int",0}, + { "_wxPrintQuality","_unsigned_int",0}, + { "_wxPrintQuality","_wxWindowID",0}, + { "_wxPrintQuality","_uint",0}, + { "_wxPrintQuality","_EBool",0}, + { "_wxPrintQuality","_size_t",0}, + { "_wxPrintQuality","_time_t",0}, + { "_byte","_unsigned_char",0}, + { "_long","_unsigned_long",0}, + { "_long","_signed_long",0}, + { "_size_t","_wxCoord",0}, + { "_size_t","_wxPrintQuality",0}, + { "_size_t","_time_t",0}, + { "_size_t","_unsigned_int",0}, + { "_size_t","_int",0}, + { "_size_t","_wxWindowID",0}, + { "_size_t","_uint",0}, + { "_uint","_wxCoord",0}, + { "_uint","_wxPrintQuality",0}, + { "_uint","_time_t",0}, + { "_uint","_size_t",0}, + { "_uint","_unsigned_int",0}, + { "_uint","_int",0}, + { "_uint","_wxWindowID",0}, + { "_wxChar","_char",0}, + { "_wxCommandEvent","_wxDynamicSashUnifyEvent",SwigwxDynamicSashUnifyEventTowxCommandEvent}, + { "_wxCommandEvent","_wxDynamicSashSplitEvent",SwigwxDynamicSashSplitEventTowxCommandEvent}, + { "_char","_wxChar",0}, + { "_struct_wxNativeFontInfo","_wxNativeFontInfo",0}, + { "_EBool","_wxCoord",0}, + { "_EBool","_wxPrintQuality",0}, + { "_EBool","_signed_int",0}, + { "_EBool","_int",0}, + { "_EBool","_wxWindowID",0}, + { "_unsigned_long","_long",0}, + { "_wxNativeFontInfo","_struct_wxNativeFontInfo",0}, + { "_signed_int","_wxCoord",0}, + { "_signed_int","_wxPrintQuality",0}, + { "_signed_int","_EBool",0}, + { "_signed_int","_wxWindowID",0}, + { "_signed_int","_int",0}, + { "_WXTYPE","_wxDateTime_t",0}, + { "_WXTYPE","_short",0}, + { "_WXTYPE","_signed_short",0}, + { "_WXTYPE","_unsigned_short",0}, + { "_unsigned_short","_wxDateTime_t",0}, + { "_unsigned_short","_WXTYPE",0}, + { "_unsigned_short","_short",0}, + { "_wxObject","_wxDynamicSashWindow",SwigwxDynamicSashWindowTowxObject}, + { "_wxObject","_wxDynamicSashUnifyEvent",SwigwxDynamicSashUnifyEventTowxObject}, + { "_wxObject","_wxDynamicSashSplitEvent",SwigwxDynamicSashSplitEventTowxObject}, + { "_signed_short","_WXTYPE",0}, + { "_signed_short","_short",0}, + { "_unsigned_char","_byte",0}, + { "_unsigned_int","_wxCoord",0}, + { "_unsigned_int","_wxPrintQuality",0}, + { "_unsigned_int","_time_t",0}, + { "_unsigned_int","_size_t",0}, + { "_unsigned_int","_uint",0}, + { "_unsigned_int","_wxWindowID",0}, + { "_unsigned_int","_int",0}, + { "_short","_wxDateTime_t",0}, + { "_short","_WXTYPE",0}, + { "_short","_unsigned_short",0}, + { "_short","_signed_short",0}, + { "_wxWindowID","_wxCoord",0}, + { "_wxWindowID","_wxPrintQuality",0}, + { "_wxWindowID","_time_t",0}, + { "_wxWindowID","_size_t",0}, + { "_wxWindowID","_EBool",0}, + { "_wxWindowID","_uint",0}, + { "_wxWindowID","_int",0}, + { "_wxWindowID","_signed_int",0}, + { "_wxWindowID","_unsigned_int",0}, + { "_int","_wxCoord",0}, + { "_int","_wxPrintQuality",0}, + { "_int","_time_t",0}, + { "_int","_size_t",0}, + { "_int","_EBool",0}, + { "_int","_uint",0}, + { "_int","_wxWindowID",0}, + { "_int","_unsigned_int",0}, + { "_int","_signed_int",0}, + { "_wxDateTime_t","_unsigned_short",0}, + { "_wxDateTime_t","_short",0}, + { "_wxDateTime_t","_WXTYPE",0}, + { "_time_t","_wxCoord",0}, + { "_time_t","_wxPrintQuality",0}, + { "_time_t","_unsigned_int",0}, + { "_time_t","_int",0}, + { "_time_t","_wxWindowID",0}, + { "_time_t","_uint",0}, + { "_time_t","_size_t",0}, + { "_wxCoord","_int",0}, + { "_wxCoord","_signed_int",0}, + { "_wxCoord","_unsigned_int",0}, + { "_wxCoord","_wxWindowID",0}, + { "_wxCoord","_uint",0}, + { "_wxCoord","_EBool",0}, + { "_wxCoord","_size_t",0}, + { "_wxCoord","_time_t",0}, + { "_wxCoord","_wxPrintQuality",0}, + { "_wxEvtHandler","_wxDynamicSashWindow",SwigwxDynamicSashWindowTowxEvtHandler}, + { "_wxWindow","_wxDynamicSashWindow",SwigwxDynamicSashWindowTowxWindow}, +{0,0,0}}; + +static PyObject *SWIG_globals; +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) initgizmosc() { + PyObject *m, *d; + SWIG_globals = SWIG_newvarlink(); + m = Py_InitModule("gizmosc", gizmoscMethods); + d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxEVT_DYNAMIC_SASH_SPLIT", PyInt_FromLong((long) wxEVT_DYNAMIC_SASH_SPLIT)); + PyDict_SetItemString(d,"wxEVT_DYNAMIC_SASH_UNIFY", PyInt_FromLong((long) wxEVT_DYNAMIC_SASH_UNIFY)); + PyDict_SetItemString(d,"wxDS_MANAGE_SCROLLBARS", PyInt_FromLong((long) wxDS_MANAGE_SCROLLBARS)); + PyDict_SetItemString(d,"wxDS_DRAG_CORNER", PyInt_FromLong((long) wxDS_DRAG_CORNER)); + + + wxClassInfo::CleanUpClasses(); + wxClassInfo::InitializeClasses(); + +{ + int i; + for (i = 0; _swig_mapping[i].n1; i++) + SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv); +} +} diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i new file mode 100644 index 0000000000..36a475aab7 --- /dev/null +++ b/wxPython/contrib/gizmos/gizmos.i @@ -0,0 +1,169 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: gizmos.i +// Purpose: Wrappers for the "gizmo" classes in wx/contrib +// +// Author: Robin Dunn +// +// Created: 23-Nov-2001 +// RCS-ID: $Id$ +// Copyright: (c) 2001 by Total Control Software +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +%module gizmos + + +%{ +#include "export.h" +#include "wx/gizmos/dynamicsash.h" +%} + +//--------------------------------------------------------------------------- + +%include typemaps.i +%include my_typemaps.i + +%extern wx.i +%extern windows.i +%extern _defs.i +%extern events.i +%extern controls.i + + +//---------------------------------------------------------------------- + +enum { + wxEVT_DYNAMIC_SASH_SPLIT, + wxEVT_DYNAMIC_SASH_UNIFY, + + wxDS_MANAGE_SCROLLBARS, + wxDS_DRAG_CORNER, +}; + + +/* + wxDynamicSashSplitEvents are sent to your view by wxDynamicSashWindow + whenever your view is being split by the user. It is your + responsibility to handle this event by creating a new view window as + a child of the wxDynamicSashWindow. wxDynamicSashWindow will + automatically reparent it to the proper place in its window hierarchy. +*/ +class wxDynamicSashSplitEvent : public wxCommandEvent { +public: + wxDynamicSashSplitEvent(wxObject *target); +}; + + +/* + wxDynamicSashUnifyEvents are sent to your view by wxDynamicSashWindow + whenever the sash which splits your view and its sibling is being + reunified such that your view is expanding to replace its sibling. + You needn't do anything with this event if you are allowing + wxDynamicSashWindow to manage your view's scrollbars, but it is useful + if you are managing the scrollbars yourself so that you can keep + the scrollbars' event handlers connected to your view's event handler + class. +*/ +class wxDynamicSashUnifyEvent : public wxCommandEvent { +public: + wxDynamicSashUnifyEvent(wxObject *target); +}; + + + +/* + + wxDynamicSashWindow + + wxDynamicSashWindow widgets manages the way other widgets are viewed. + When a wxDynamicSashWindow is first shown, it will contain one child + view, a viewport for that child, and a pair of scrollbars to allow the + user to navigate the child view area. Next to each scrollbar is a small + tab. By clicking on either tab and dragging to the appropriate spot, a + user can split the view area into two smaller views separated by a + draggable sash. Later, when the user wishes to reunify the two subviews, + the user simply drags the sash to the side of the window. + wxDynamicSashWindow will automatically reparent the appropriate child + view back up the window hierarchy, and the wxDynamicSashWindow will have + only one child view once again. + + As an application developer, you will simply create a wxDynamicSashWindow + using either the Create() function or the more complex constructor + provided below, and then create a viewfrom wxPython.wx import * window whose parent is the + wxDynamicSashWindow. The child should respond to + wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by + constructing a new view window whose parent is also the + wxDynamicSashWindow. That's it! Now your users can dynamically split + and reunify the view you provided. + + If you wish to handle the scrollbar events for your view, rather than + allowing wxDynamicSashWindow to do it for you, things are a bit more + complex. (You might want to handle scrollbar events yourself, if, + for instance, you wish to scroll a subwindow of the view you add to + your wxDynamicSashWindow object, rather than scrolling the whole view.) + In this case, you will need to construfrom wxPython.wx import *ct your wxDynamicSashWindow without + the wxDS_MANAGE_SCROLLBARS style and you will need to use the + GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar + controls and call SetEventHanler() on them to redirect the scrolling + events whenever your window is reparented by wxDyanmicSashWindow. + You will need to set the scrollbars' event handler at three times: + + * When your view is created + * When your view receives a wxDynamicSashSplitEvent + * When your view receives a wxDynamicSashUnifyEvent + + See the dynsash_switch sample application for an example which does this. + +*/ + +class wxDynamicSashWindow : public wxWindow { +public: + wxDynamicSashWindow(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, + const char* name = "dynamicSashWindow"); + %name(wxPreDynamicSashWindow)wxDynamicSashWindow(); + + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, + const char* name = "dynamicSashWindow"); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreDynamicSashWindow:val._setOORInfo(val)" + + wxScrollBar *GetHScrollBar(const wxWindow *child) const; + wxScrollBar *GetVScrollBar(const wxWindow *child) const; +}; + + + +//---------------------------------------------------------------------- +// Python functions to act like the event macros + +%pragma(python) code = " +def EVT_DYNAMIC_SASH_SPLIT(win, id, func): + win.Connect(id, -1, wxEVT_DYNAMIC_SASH_SPLIT, func) + +def EVT_DYNAMIC_SASH_UNIFY(win, id, func): + win.Connect(id, -1, wxEVT_DYNAMIC_SASH_UNIFY, func) +" + +//---------------------------------------------------------------------- + +%init %{ + + wxClassInfo::CleanUpClasses(); + wxClassInfo::InitializeClasses(); + +%} + + +//---------------------------------------------------------------------- + +%pragma(python) include="_gizmoextras.py"; + +//---------------------------------------------------------------------- +//---------------------------------------------------------------------- + + diff --git a/wxPython/contrib/gizmos/gizmos.py b/wxPython/contrib/gizmos/gizmos.py new file mode 100644 index 0000000000..35c80ee5f8 --- /dev/null +++ b/wxPython/contrib/gizmos/gizmos.py @@ -0,0 +1,130 @@ +# This file was created automatically by SWIG. +import gizmosc + +from misc import * + +from misc2 import * + +from windows import * + +from gdi import * + +from clip_dnd import * + +from events import * + +from streams import * + +from utils import * + +from mdi import * + +from frames import * + +from stattool import * + +from controls import * + +from controls2 import * + +from windows2 import * + +from cmndlgs import * + +from windows3 import * + +from image import * + +from printfw import * + +from sizers import * + +from filesys import * + +def EVT_DYNAMIC_SASH_SPLIT(win, id, func): + win.Connect(id, -1, wxEVT_DYNAMIC_SASH_SPLIT, func) + +def EVT_DYNAMIC_SASH_UNIFY(win, id, func): + win.Connect(id, -1, wxEVT_DYNAMIC_SASH_UNIFY, func) + +class wxDynamicSashSplitEventPtr(wxCommandEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxDynamicSashSplitEvent(wxDynamicSashSplitEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gizmosc.new_wxDynamicSashSplitEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxDynamicSashUnifyEventPtr(wxCommandEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxDynamicSashUnifyEvent(wxDynamicSashUnifyEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gizmosc.new_wxDynamicSashUnifyEvent,_args,_kwargs) + self.thisown = 1 + + + + +class wxDynamicSashWindowPtr(wxWindowPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def Create(self, *_args, **_kwargs): + val = apply(gizmosc.wxDynamicSashWindow_Create,(self,) + _args, _kwargs) + return val + def GetHScrollBar(self, *_args, **_kwargs): + val = apply(gizmosc.wxDynamicSashWindow_GetHScrollBar,(self,) + _args, _kwargs) + if val: val = wxScrollBarPtr(val) + return val + def GetVScrollBar(self, *_args, **_kwargs): + val = apply(gizmosc.wxDynamicSashWindow_GetVScrollBar,(self,) + _args, _kwargs) + if val: val = wxScrollBarPtr(val) + return val + def __repr__(self): + return "" % (self.this,) +class wxDynamicSashWindow(wxDynamicSashWindowPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(gizmosc.new_wxDynamicSashWindow,_args,_kwargs) + self.thisown = 1 + self._setOORInfo(self) + + + +def wxPreDynamicSashWindow(*_args,**_kwargs): + val = wxDynamicSashWindowPtr(apply(gizmosc.new_wxPreDynamicSashWindow,_args,_kwargs)) + val.thisown = 1 + val._setOORInfo(val) + return val + + + + +#-------------- FUNCTION WRAPPERS ------------------ + + + +#-------------- VARIABLE WRAPPERS ------------------ + +wxEVT_DYNAMIC_SASH_SPLIT = gizmosc.wxEVT_DYNAMIC_SASH_SPLIT +wxEVT_DYNAMIC_SASH_UNIFY = gizmosc.wxEVT_DYNAMIC_SASH_UNIFY +wxDS_MANAGE_SCROLLBARS = gizmosc.wxDS_MANAGE_SCROLLBARS +wxDS_DRAG_CORNER = gizmosc.wxDS_DRAG_CORNER + + +#-------------- USER INCLUDE ----------------------- + +# Stuff these names into the wx namespace so wxPyConstructObject can find them + +wx.wxDynamicSashSplitEventPtr = wxDynamicSashSplitEventPtr +wx.wxDynamicSashUnifyEventPtr = wxDynamicSashUnifyEventPtr +wx.wxDynamicSashWindowPtr = wxDynamicSashWindowPtr diff --git a/wxPython/contrib/stc/msw/stc_.cpp b/wxPython/contrib/stc/msw/stc_.cpp index 8efbd78fd8..92c7a19131 100644 --- a/wxPython/contrib/stc/msw/stc_.cpp +++ b/wxPython/contrib/stc/msw/stc_.cpp @@ -8661,6 +8661,78 @@ static PyObject *_wrap_wxStyledTextCtrl_SendMsg(PyObject *self, PyObject *args, return _resultobj; } +#define wxStyledTextCtrl_SetVScrollBar(_swigobj,_swigarg0) (_swigobj->SetVScrollBar(_swigarg0)) +static PyObject *_wrap_wxStyledTextCtrl_SetVScrollBar(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxStyledTextCtrl * _arg0; + wxScrollBar * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","bar", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetVScrollBar",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetVScrollBar. Expected _wxStyledTextCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxScrollBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetVScrollBar. Expected _wxScrollBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxStyledTextCtrl_SetVScrollBar(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxStyledTextCtrl_SetHScrollBar(_swigobj,_swigarg0) (_swigobj->SetHScrollBar(_swigarg0)) +static PyObject *_wrap_wxStyledTextCtrl_SetHScrollBar(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxStyledTextCtrl * _arg0; + wxScrollBar * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","bar", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextCtrl_SetHScrollBar",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextCtrl_SetHScrollBar. Expected _wxStyledTextCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxScrollBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextCtrl_SetHScrollBar. Expected _wxScrollBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxStyledTextCtrl_SetHScrollBar(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxStyledTextEventTowxCommandEvent(void *ptr) { wxStyledTextEvent *src; wxCommandEvent *dest; @@ -8685,21 +8757,28 @@ static void *SwigwxStyledTextEventTowxObject(void *ptr) { return (void *) dest; } -#define new_wxStyledTextEvent(_swigarg0,_swigarg1) (new wxStyledTextEvent(_swigarg0,_swigarg1)) +#define new_wxStyledTextEvent(_swigarg0) (new wxStyledTextEvent(_swigarg0)) static PyObject *_wrap_new_wxStyledTextEvent(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxStyledTextEvent * _result; - wxEventType _arg0 = (wxEventType ) 0; - int _arg1 = (int ) 0; - char *_kwnames[] = { "commandType","id", NULL }; + wxStyledTextEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "event", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:new_wxStyledTextEvent",_kwnames,&_arg0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxStyledTextEvent",_kwnames,&_argo0)) return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxStyledTextEvent. Expected _wxStyledTextEvent_p."); + return NULL; + } + } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxStyledTextEvent *)new_wxStyledTextEvent(_arg0,_arg1); + _result = (wxStyledTextEvent *)new_wxStyledTextEvent(*_arg0); wxPy_END_ALLOW_THREADS; } if (_result) { @@ -9955,44 +10034,42 @@ static PyObject *_wrap_wxStyledTextEvent_GetAlt(PyObject *self, PyObject *args, return _resultobj; } -#define wxStyledTextEvent_CopyObject(_swigobj,_swigarg0) (_swigobj->CopyObject(_swigarg0)) -static PyObject *_wrap_wxStyledTextEvent_CopyObject(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxStyledTextEvent_Clone(_swigobj) (_swigobj->Clone()) +static PyObject *_wrap_wxStyledTextEvent_Clone(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + wxEvent * _result; wxStyledTextEvent * _arg0; - wxObject * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","obj", NULL }; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxStyledTextEvent_CopyObject",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxStyledTextEvent_Clone",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxStyledTextEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_CopyObject. Expected _wxStyledTextEvent_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxObject_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxStyledTextEvent_CopyObject. Expected _wxObject_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxStyledTextEvent_Clone. Expected _wxStyledTextEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxStyledTextEvent_CopyObject(_arg0,*_arg1); + _result = (wxEvent *)wxStyledTextEvent_Clone(_arg0); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } static PyMethodDef stc_cMethods[] = { - { "wxStyledTextEvent_CopyObject", (PyCFunction) _wrap_wxStyledTextEvent_CopyObject, METH_VARARGS | METH_KEYWORDS }, + { "wxStyledTextEvent_Clone", (PyCFunction) _wrap_wxStyledTextEvent_Clone, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextEvent_GetAlt", (PyCFunction) _wrap_wxStyledTextEvent_GetAlt, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextEvent_GetControl", (PyCFunction) _wrap_wxStyledTextEvent_GetControl, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextEvent_GetShift", (PyCFunction) _wrap_wxStyledTextEvent_GetShift, METH_VARARGS | METH_KEYWORDS }, @@ -10038,6 +10115,8 @@ static PyMethodDef stc_cMethods[] = { { "wxStyledTextEvent_SetPosition", (PyCFunction) _wrap_wxStyledTextEvent_SetPosition, METH_VARARGS | METH_KEYWORDS }, { "delete_wxStyledTextEvent", (PyCFunction) _wrap_delete_wxStyledTextEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxStyledTextEvent", (PyCFunction) _wrap_new_wxStyledTextEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxStyledTextCtrl_SetHScrollBar", (PyCFunction) _wrap_wxStyledTextCtrl_SetHScrollBar, METH_VARARGS | METH_KEYWORDS }, + { "wxStyledTextCtrl_SetVScrollBar", (PyCFunction) _wrap_wxStyledTextCtrl_SetVScrollBar, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_SendMsg", (PyCFunction) _wrap_wxStyledTextCtrl_SendMsg, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_ScrollToColumn", (PyCFunction) _wrap_wxStyledTextCtrl_ScrollToColumn, METH_VARARGS | METH_KEYWORDS }, { "wxStyledTextCtrl_ScrollToLine", (PyCFunction) _wrap_wxStyledTextCtrl_ScrollToLine, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/contrib/stc/msw/stc_.py b/wxPython/contrib/stc/msw/stc_.py index 6450b0d0ff..3e45afeeaa 100644 --- a/wxPython/contrib/stc/msw/stc_.py +++ b/wxPython/contrib/stc/msw/stc_.py @@ -933,6 +933,12 @@ class wxStyledTextCtrlPtr(wxControlPtr): def SendMsg(self, *_args, **_kwargs): val = apply(stc_c.wxStyledTextCtrl_SendMsg,(self,) + _args, _kwargs) return val + def SetVScrollBar(self, *_args, **_kwargs): + val = apply(stc_c.wxStyledTextCtrl_SetVScrollBar,(self,) + _args, _kwargs) + return val + def SetHScrollBar(self, *_args, **_kwargs): + val = apply(stc_c.wxStyledTextCtrl_SetHScrollBar,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxStyledTextCtrl(wxStyledTextCtrlPtr): @@ -1080,8 +1086,9 @@ class wxStyledTextEventPtr(wxCommandEventPtr): def GetAlt(self, *_args, **_kwargs): val = apply(stc_c.wxStyledTextEvent_GetAlt,(self,) + _args, _kwargs) return val - def CopyObject(self, *_args, **_kwargs): - val = apply(stc_c.wxStyledTextEvent_CopyObject,(self,) + _args, _kwargs) + def Clone(self, *_args, **_kwargs): + val = apply(stc_c.wxStyledTextEvent_Clone,(self,) + _args, _kwargs) + if val: val = wxEventPtr(val) return val def __repr__(self): return "" % (self.this,) diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 525e0b13d2..07e93efb9a 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -36,6 +36,7 @@ _treeList = [ 'URLDragAndDrop', 'wxMimeTypesManager', 'wxPopupWindow', + 'wxDynamicSashWindow', ]), ('Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame', @@ -45,6 +46,7 @@ _treeList = [ 'wxHtmlWindow', 'wxStyledTextCtrl_1', 'wxStyledTextCtrl_2', 'wxPopupWindow', + 'wxDynamicSashWindow', ]), ('Common Dialogs', ['wxColourDialog', 'wxDirDialog', 'wxFileDialog', diff --git a/wxPython/demo/wxDynamicSashWindow.py b/wxPython/demo/wxDynamicSashWindow.py new file mode 100644 index 0000000000..02abd17c42 --- /dev/null +++ b/wxPython/demo/wxDynamicSashWindow.py @@ -0,0 +1,151 @@ + +from wxPython.wx import * +from wxPython.gizmos import * +from wxPython.stc import * + +#---------------------------------------------------------------------- +# This is an example of the complex view that manages its own scrollbars +# as described in the overview below. + +class TestView(wxStyledTextCtrl): + def __init__(self, parent, ID, log): + wxStyledTextCtrl.__init__(self, parent, ID, style=wxNO_BORDER) + self.dyn_sash = parent + self.log = log + self.SetMarginWidth(1,0) + self.StyleSetFont(wxSTC_STYLE_DEFAULT, + wxFont(10, wxMODERN, wxNORMAL, wxNORMAL)) + self.SetupScrollBars() + EVT_DYNAMIC_SASH_SPLIT(self, -1, self.OnSplit) + EVT_DYNAMIC_SASH_UNIFY(self, -1, self.OnUnify) + + + def SetupScrollBars(self): + # hook the scrollbars provided by the wxDynamicSashWindow + # to this view + v_bar = self.dyn_sash.GetVScrollBar(self) + h_bar = self.dyn_sash.GetHScrollBar(self) + EVT_SCROLL(v_bar, self.OnSBScroll) + EVT_SCROLL(h_bar, self.OnSBScroll) + EVT_SET_FOCUS(v_bar, self.OnSBFocus) + EVT_SET_FOCUS(h_bar, self.OnSBFocus) + + # And set the wxStyledText to use these scrollbars instead + # of its built-in ones. + self.SetVScrollBar(v_bar) + self.SetHScrollBar(h_bar) + + + def __del__(self): + self.log.write("TestView.__del__\n") + + def OnSplit(self, evt): + self.log.write("TestView.OnSplit\n"); + newview = TestView(self.dyn_sash, -1, self.log) + newview.SetDocPointer(self.GetDocPointer()) # use the same document + self.SetupScrollBars() + + + def OnUnify(self, evt): + self.log.write("TestView.OnUnify\n"); + self.SetupScrollBars() + + + def OnSBScroll(self, evt): + # redirect the scroll events from the dyn_sash's scrollbars to the STC + self.GetEventHandler().ProcessEvent(evt) + + def OnSBFocus(self, evt): + # when the scrollbar gets the focus move it back to the STC + self.SetFocus() + + +sampleText="""\ +You can drag the little tabs above the vertical scrollbar, or to the +left of the horizontal scrollbar to split this view, and you can +continue splitting the new views as much as you like. Try it and see. + +In this case the views also share the same document so changes in one +are instantly seen in the others. This is a feature of the +wxStyledTextCtrl that is used for the view class in this sample. +""" + +#---------------------------------------------------------------------- +# This one is simpler, but doesn't do anything with the scrollbars +# except the default wxDynamicSashWindow behaviour + +class SimpleView(wxPanel): + def __init__(self, parent, ID, log): + wxPanel.__init__(self, parent, ID) + self.dyn_sash = parent + self.log = log + self.SetBackgroundColour("LIGHT BLUE") + EVT_DYNAMIC_SASH_SPLIT(self, -1, self.OnSplit) + + def OnSplit(self, evt): + v = SimpleView(self.dyn_sash, -1, self.log) + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + if 1: + win = wxDynamicSashWindow(nb, -1, style = 0 + | wxCLIP_CHILDREN + #| wxDS_MANAGE_SCROLLBARS + #| wxDS_DRAG_CORNER + ) + win.SetFont(wxFont(10, wxMODERN, wxNORMAL, wxNORMAL)) + view = TestView(win, -1, log) + view.SetText(sampleText) + else: + win = wxDynamicSashWindow(nb, -1) + view = SimpleView(win, -1, log) + return win + +#---------------------------------------------------------------------- + +overview = """\ + +

wxDynamicSashWindow

+

+wxDynamicSashWindow widgets manages the way other widgets are viewed. +When a wxDynamicSashWindow is first shown, it will contain one child +view, a viewport for that child, and a pair of scrollbars to allow the +user to navigate the child view area. Next to each scrollbar is a small +tab. By clicking on either tab and dragging to the appropriate spot, a +user can split the view area into two smaller views separated by a +draggable sash. Later, when the user wishes to reunify the two subviews, +the user simply drags the sash to the side of the window. +wxDynamicSashWindow will automatically reparent the appropriate child +view back up the window hierarchy, and the wxDynamicSashWindow will have +only one child view once again. +

+As an application developer, you will simply create a wxDynamicSashWindow +using either the Create() function or the more complex constructor +provided below, and then create a view window whose parent is the +wxDynamicSashWindow. The child should respond to +wxDynamicSashSplitEvents -- perhaps with an OnSplit() event handler -- by +constructing a new view window whose parent is also the +wxDynamicSashWindow. That's it! Now your users can dynamically split +and reunify the view you provided. +

+If you wish to handle the scrollbar events for your view, rather than +allowing wxDynamicSashWindow to do it for you, things are a bit more +complex. (You might want to handle scrollbar events yourself, if, +for instance, you wish to scroll a subwindow of the view you add to +your wxDynamicSashWindow object, rather than scrolling the whole view.) +In this case, you will need to construct your wxDynamicSashWindow without +the wxDS_MANAGE_SCROLLBARS style and you will need to use the +GetHScrollBar() and GetVScrollBar() methods to retrieve the scrollbar +controls and call SetEventHanler() on them to redirect the scrolling +events whenever your window is reparented by wxDyanmicSashWindow. +You will need to set the scrollbars' event handler at three times: +

+

    +
  • When your view is created +
  • When your view receives a wxDynamicSashSplitEvent +
  • When your view receives a wxDynamicSashUnifyEvent +
+ +""" diff --git a/wxPython/distrib/make_installer.py b/wxPython/distrib/make_installer.py index 4155a6bc44..8687e17cef 100644 --- a/wxPython/distrib/make_installer.py +++ b/wxPython/distrib/make_installer.py @@ -78,6 +78,7 @@ Source: "wxPython\glcanvasc.pyd"; DestDir: "{app}\wxPython"; Component Source: "wxPython\oglc.pyd"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\stc_c.pyd"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\xrcc.pyd"; DestDir: "{app}\wxPython"; Components: core +Source: "wxPython\gizmosc.pyd"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\*.py"; DestDir: "{app}\wxPython"; Components: core Source: "wxPython\lib\*.py"; DestDir: "{app}\wxPython\lib"; Components: core diff --git a/wxPython/setup.py b/wxPython/setup.py index 27f7138ff3..4a9e0fa8d2 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -33,6 +33,7 @@ BUILD_OGL = 1 # If true, build the contrib/ogl extension module BUILD_STC = 1 # If true, build the contrib/stc extension module BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental) BUILD_XRC = 1 # XML based resource system +BUILD_GIZMOS = 1 # Build a module for the gizmos contrib library CORE_ONLY = 0 # if true, don't build any of the above @@ -64,7 +65,7 @@ HYBRID = 0 # If set and not debug or FINAL, then build a # wxWindows must have been built with /MD, not /MDd # (using FINAL=hybrid will do it.) -WXDLLVER = '232' # Version part of DLL name +WXDLLVER = '232' # Version part of DLL name #---------------------------------------------------------------------- @@ -746,6 +747,51 @@ if not GL_ONLY and BUILD_XRC: +#---------------------------------------------------------------------- +# Define the GIZMOS extension module +#---------------------------------------------------------------------- + +if not GL_ONLY and BUILD_GIZMOS: + msg('Preparing GIZMOS...') + location = 'contrib/gizmos' + GIZMOLOC = opj(location, 'contrib/src/gizmos') + GIZMOINC = opj(location, 'contrib/include') + + swig_files = ['gizmos.i'] + + swig_sources = run_swig(swig_files, location, '', PKGDIR, + USE_SWIG, swig_force, swig_args) + + gizmos_includes = includes[:] + gizmos_includes.append(GIZMOINC) + + + # make sure local copy of contrib files are up to date + if IN_CVS_TREE: + contrib_copy_tree(opj(CTRB_INC, 'gizmos'), opj(GIZMOINC, 'wx/gizmos')) + contrib_copy_tree(opj(CTRB_SRC, 'gizmos'), GIZMOLOC) + + ext = Extension('gizmosc', [ + '%s/dynamicsash.cpp' % GIZMOLOC, + #'%s/editlbox.cpp' % GIZMOLOC, + #'%s/multicell.cpp' % GIZMOLOC, + '%s/splittree.cpp' % GIZMOLOC, + ] + swig_sources, + + include_dirs = gizmos_includes, + define_macros = defines, + + library_dirs = libdirs, + libraries = libs, + + extra_compile_args = cflags, + extra_link_args = lflags, + ) + + wxpExtensions.append(ext) + + + #---------------------------------------------------------------------- # Do the Setup/Build/Install/Whatever diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 1d29d12ced..e56b629216 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -184,7 +184,6 @@ enum { wxBORDER, wxSIMPLE_BORDER, wxSTATIC_BORDER, - wxBORDER_MASK, wxTRANSPARENT_WINDOW, wxNO_BORDER, wxUSER_COLOURS, @@ -489,6 +488,19 @@ enum { }; +enum wxBorder +{ + wxBORDER_DEFAULT, + wxBORDER_NONE, + wxBORDER_STATIC, + wxBORDER_SIMPLE, + wxBORDER_RAISED, + wxBORDER_SUNKEN, + wxBORDER_DOUBLE, + wxBORDER_MASK, +}; + + // // Standard error codes // enum ErrCode // { diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index 1d8b745989..e5824e6db8 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -756,6 +756,9 @@ public: int GetThumbPosition(); int GetThumbSize(); %name(GetThumbLength) int GetThumbSize(); // to match the docs + + bool IsVertical(); + void SetThumbPosition(int viewStart); void SetScrollbar(int position, int thumbSize, int range, int pageSize, diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 5994f9403f..71723b4794 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -332,16 +332,15 @@ public: wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); int m_code; + long m_oldItemIndex; long m_itemIndex; int m_col; - bool m_cancelled; wxPoint m_pointDrag; wxListItem m_item; int GetCode(); long GetIndex(); int GetColumn(); - bool Cancelled(); wxPoint GetPoint(); const wxString& GetLabel(); const wxString& GetText(); diff --git a/wxPython/src/events.i b/wxPython/src/events.i index e197bebd72..8e4190a2cc 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -35,7 +35,7 @@ int wxNewEventType(); class wxEvent : public wxObject { public: - wxEvent(int id = 0); + // wxEvent(int id = 0); // *** This class is now an ABC ~wxEvent(); wxObject* GetEventObject(); diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index 7a1cb4bc7a..586953d24a 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -7932,6 +7932,34 @@ static PyObject *_wrap_wxScrollBar_GetThumbSize(PyObject *self, PyObject *args, return _resultobj; } +#define wxScrollBar_IsVertical(_swigobj) (_swigobj->IsVertical()) +static PyObject *_wrap_wxScrollBar_IsVertical(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxScrollBar * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrollBar_IsVertical",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrollBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrollBar_IsVertical. Expected _wxScrollBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxScrollBar_IsVertical(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxScrollBar_SetThumbPosition(_swigobj,_swigarg0) (_swigobj->SetThumbPosition(_swigarg0)) static PyObject *_wrap_wxScrollBar_SetThumbPosition(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -11175,6 +11203,7 @@ static PyMethodDef controlscMethods[] = { { "new_wxSpinButton", (PyCFunction) _wrap_new_wxSpinButton, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_SetScrollbar", (PyCFunction) _wrap_wxScrollBar_SetScrollbar, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_SetThumbPosition", (PyCFunction) _wrap_wxScrollBar_SetThumbPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxScrollBar_IsVertical", (PyCFunction) _wrap_wxScrollBar_IsVertical, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetThumbLength", (PyCFunction) _wrap_wxScrollBar_GetThumbSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetThumbSize", (PyCFunction) _wrap_wxScrollBar_GetThumbSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrollBar_GetThumbPosition", (PyCFunction) _wrap_wxScrollBar_GetThumbPosition, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 563bd1a116..38059600b4 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -777,6 +777,9 @@ class wxScrollBarPtr(wxControlPtr): def GetThumbLength(self, *_args, **_kwargs): val = apply(controlsc.wxScrollBar_GetThumbLength,(self,) + _args, _kwargs) return val + def IsVertical(self, *_args, **_kwargs): + val = apply(controlsc.wxScrollBar_IsVertical,(self,) + _args, _kwargs) + return val def SetThumbPosition(self, *_args, **_kwargs): val = apply(controlsc.wxScrollBar_SetThumbPosition,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index 4b9e48d4d5..ab7241061c 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -2240,28 +2240,28 @@ static PyObject *_wrap_wxListEvent_m_code_get(PyObject *self, PyObject *args, Py return _resultobj; } -#define wxListEvent_m_itemIndex_set(_swigobj,_swigval) (_swigobj->m_itemIndex = _swigval,_swigval) -static PyObject *_wrap_wxListEvent_m_itemIndex_set(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_oldItemIndex_set(_swigobj,_swigval) (_swigobj->m_oldItemIndex = _swigval,_swigval) +static PyObject *_wrap_wxListEvent_m_oldItemIndex_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; wxListEvent * _arg0; long _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","m_itemIndex", NULL }; + char *_kwnames[] = { "self","m_oldItemIndex", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListEvent_m_itemIndex_set",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListEvent_m_oldItemIndex_set",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_itemIndex_set. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_oldItemIndex_set. Expected _wxListEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListEvent_m_itemIndex_set(_arg0,_arg1); + _result = (long )wxListEvent_m_oldItemIndex_set(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2269,8 +2269,8 @@ static PyObject *_wrap_wxListEvent_m_itemIndex_set(PyObject *self, PyObject *arg return _resultobj; } -#define wxListEvent_m_itemIndex_get(_swigobj) ((long ) _swigobj->m_itemIndex) -static PyObject *_wrap_wxListEvent_m_itemIndex_get(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_oldItemIndex_get(_swigobj) ((long ) _swigobj->m_oldItemIndex) +static PyObject *_wrap_wxListEvent_m_oldItemIndex_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; wxListEvent * _arg0; @@ -2278,18 +2278,18 @@ static PyObject *_wrap_wxListEvent_m_itemIndex_get(PyObject *self, PyObject *arg char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_itemIndex_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_oldItemIndex_get",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_itemIndex_get. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_oldItemIndex_get. Expected _wxListEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListEvent_m_itemIndex_get(_arg0); + _result = (long )wxListEvent_m_oldItemIndex_get(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2297,87 +2297,85 @@ static PyObject *_wrap_wxListEvent_m_itemIndex_get(PyObject *self, PyObject *arg return _resultobj; } -#define wxListEvent_m_col_set(_swigobj,_swigval) (_swigobj->m_col = _swigval,_swigval) -static PyObject *_wrap_wxListEvent_m_col_set(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_itemIndex_set(_swigobj,_swigval) (_swigobj->m_itemIndex = _swigval,_swigval) +static PyObject *_wrap_wxListEvent_m_itemIndex_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; + long _result; wxListEvent * _arg0; - int _arg1; + long _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","m_col", NULL }; + char *_kwnames[] = { "self","m_itemIndex", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListEvent_m_col_set",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListEvent_m_itemIndex_set",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_col_set. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_itemIndex_set. Expected _wxListEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListEvent_m_col_set(_arg0,_arg1); + _result = (long )wxListEvent_m_itemIndex_set(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxListEvent_m_col_get(_swigobj) ((int ) _swigobj->m_col) -static PyObject *_wrap_wxListEvent_m_col_get(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_itemIndex_get(_swigobj) ((long ) _swigobj->m_itemIndex) +static PyObject *_wrap_wxListEvent_m_itemIndex_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; + long _result; wxListEvent * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_col_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_itemIndex_get",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_col_get. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_itemIndex_get. Expected _wxListEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListEvent_m_col_get(_arg0); + _result = (long )wxListEvent_m_itemIndex_get(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxListEvent_m_cancelled_set(_swigobj,_swigval) (_swigobj->m_cancelled = _swigval,_swigval) -static PyObject *_wrap_wxListEvent_m_cancelled_set(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_col_set(_swigobj,_swigval) (_swigobj->m_col = _swigval,_swigval) +static PyObject *_wrap_wxListEvent_m_col_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; + int _result; wxListEvent * _arg0; - bool _arg1; + int _arg1; PyObject * _argo0 = 0; - int tempbool1; - char *_kwnames[] = { "self","m_cancelled", NULL }; + char *_kwnames[] = { "self","m_col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListEvent_m_cancelled_set",_kwnames,&_argo0,&tempbool1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListEvent_m_col_set",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_cancelled_set. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_col_set. Expected _wxListEvent_p."); return NULL; } } - _arg1 = (bool ) tempbool1; { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListEvent_m_cancelled_set(_arg0,_arg1); + _result = (int )wxListEvent_m_col_set(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2385,27 +2383,27 @@ static PyObject *_wrap_wxListEvent_m_cancelled_set(PyObject *self, PyObject *arg return _resultobj; } -#define wxListEvent_m_cancelled_get(_swigobj) ((bool ) _swigobj->m_cancelled) -static PyObject *_wrap_wxListEvent_m_cancelled_get(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListEvent_m_col_get(_swigobj) ((int ) _swigobj->m_col) +static PyObject *_wrap_wxListEvent_m_col_get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; + int _result; wxListEvent * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_cancelled_get",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_m_col_get",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_cancelled_get. Expected _wxListEvent_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_m_col_get. Expected _wxListEvent_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListEvent_m_cancelled_get(_arg0); + _result = (int )wxListEvent_m_col_get(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2640,34 +2638,6 @@ static PyObject *_wrap_wxListEvent_GetColumn(PyObject *self, PyObject *args, PyO return _resultobj; } -#define wxListEvent_Cancelled(_swigobj) (_swigobj->Cancelled()) -static PyObject *_wrap_wxListEvent_Cancelled(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxListEvent * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListEvent_Cancelled",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListEvent_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListEvent_Cancelled. Expected _wxListEvent_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListEvent_Cancelled(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - #define wxListEvent_GetPoint(_swigobj) (_swigobj->GetPoint()) static PyObject *_wrap_wxListEvent_GetPoint(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -9752,7 +9722,6 @@ static PyMethodDef controls2cMethods[] = { { "wxListEvent_GetText", (PyCFunction) _wrap_wxListEvent_GetText, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetLabel", (PyCFunction) _wrap_wxListEvent_GetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetPoint", (PyCFunction) _wrap_wxListEvent_GetPoint, METH_VARARGS | METH_KEYWORDS }, - { "wxListEvent_Cancelled", (PyCFunction) _wrap_wxListEvent_Cancelled, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetColumn", (PyCFunction) _wrap_wxListEvent_GetColumn, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetIndex", (PyCFunction) _wrap_wxListEvent_GetIndex, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetCode", (PyCFunction) _wrap_wxListEvent_GetCode, METH_VARARGS | METH_KEYWORDS }, @@ -9760,12 +9729,12 @@ static PyMethodDef controls2cMethods[] = { { "wxListEvent_m_item_set", (PyCFunction) _wrap_wxListEvent_m_item_set, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_pointDrag_get", (PyCFunction) _wrap_wxListEvent_m_pointDrag_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_pointDrag_set", (PyCFunction) _wrap_wxListEvent_m_pointDrag_set, METH_VARARGS | METH_KEYWORDS }, - { "wxListEvent_m_cancelled_get", (PyCFunction) _wrap_wxListEvent_m_cancelled_get, METH_VARARGS | METH_KEYWORDS }, - { "wxListEvent_m_cancelled_set", (PyCFunction) _wrap_wxListEvent_m_cancelled_set, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_col_get", (PyCFunction) _wrap_wxListEvent_m_col_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_col_set", (PyCFunction) _wrap_wxListEvent_m_col_set, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_itemIndex_get", (PyCFunction) _wrap_wxListEvent_m_itemIndex_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_itemIndex_set", (PyCFunction) _wrap_wxListEvent_m_itemIndex_set, METH_VARARGS | METH_KEYWORDS }, + { "wxListEvent_m_oldItemIndex_get", (PyCFunction) _wrap_wxListEvent_m_oldItemIndex_get, METH_VARARGS | METH_KEYWORDS }, + { "wxListEvent_m_oldItemIndex_set", (PyCFunction) _wrap_wxListEvent_m_oldItemIndex_set, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_code_get", (PyCFunction) _wrap_wxListEvent_m_code_get, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_m_code_set", (PyCFunction) _wrap_wxListEvent_m_code_set, METH_VARARGS | METH_KEYWORDS }, { "new_wxListEvent", (PyCFunction) _wrap_new_wxListEvent, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index 4b567d5c6b..fac780afe3 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -355,9 +355,6 @@ class wxListEventPtr(wxNotifyEventPtr): def GetColumn(self, *_args, **_kwargs): val = apply(controls2c.wxListEvent_GetColumn,(self,) + _args, _kwargs) return val - def Cancelled(self, *_args, **_kwargs): - val = apply(controls2c.wxListEvent_Cancelled,(self,) + _args, _kwargs) - return val def GetPoint(self, *_args, **_kwargs): val = apply(controls2c.wxListEvent_GetPoint,(self,) + _args, _kwargs) if val: val = wxPointPtr(val) ; val.thisown = 1 @@ -390,15 +387,15 @@ class wxListEventPtr(wxNotifyEventPtr): if name == "m_code" : controls2c.wxListEvent_m_code_set(self,value) return + if name == "m_oldItemIndex" : + controls2c.wxListEvent_m_oldItemIndex_set(self,value) + return if name == "m_itemIndex" : controls2c.wxListEvent_m_itemIndex_set(self,value) return if name == "m_col" : controls2c.wxListEvent_m_col_set(self,value) return - if name == "m_cancelled" : - controls2c.wxListEvent_m_cancelled_set(self,value) - return if name == "m_pointDrag" : controls2c.wxListEvent_m_pointDrag_set(self,value.this) return @@ -409,12 +406,12 @@ class wxListEventPtr(wxNotifyEventPtr): def __getattr__(self,name): if name == "m_code" : return controls2c.wxListEvent_m_code_get(self) + if name == "m_oldItemIndex" : + return controls2c.wxListEvent_m_oldItemIndex_get(self) if name == "m_itemIndex" : return controls2c.wxListEvent_m_itemIndex_get(self) if name == "m_col" : return controls2c.wxListEvent_m_col_get(self) - if name == "m_cancelled" : - return controls2c.wxListEvent_m_cancelled_get(self) if name == "m_pointDrag" : return wxPointPtr(controls2c.wxListEvent_m_pointDrag_get(self)) if name == "m_item" : diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp index 9b26c43a66..f926938d6d 100644 --- a/wxPython/src/msw/events.cpp +++ b/wxPython/src/msw/events.cpp @@ -119,33 +119,6 @@ static void *SwigwxEventTowxObject(void *ptr) { return (void *) dest; } -#define new_wxEvent(_swigarg0) (new wxEvent(_swigarg0)) -static PyObject *_wrap_new_wxEvent(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxEvent * _result; - int _arg0 = (int ) 0; - char *_kwnames[] = { "id", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|i:new_wxEvent",_kwnames,&_arg0)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxEvent *)new_wxEvent(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxEvent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - #define delete_wxEvent(_swigobj) (delete _swigobj) static PyObject *_wrap_delete_wxEvent(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7226,7 +7199,6 @@ static PyMethodDef eventscMethods[] = { { "wxEvent_GetEventType", (PyCFunction) _wrap_wxEvent_GetEventType, METH_VARARGS | METH_KEYWORDS }, { "wxEvent_GetEventObject", (PyCFunction) _wrap_wxEvent_GetEventObject, METH_VARARGS | METH_KEYWORDS }, { "delete_wxEvent", (PyCFunction) _wrap_delete_wxEvent, METH_VARARGS | METH_KEYWORDS }, - { "new_wxEvent", (PyCFunction) _wrap_new_wxEvent, METH_VARARGS | METH_KEYWORDS }, { "wxNewEventType", (PyCFunction) _wrap_wxNewEventType, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; diff --git a/wxPython/src/msw/events.py b/wxPython/src/msw/events.py index 3236de4adb..a50e4f988c 100644 --- a/wxPython/src/msw/events.py +++ b/wxPython/src/msw/events.py @@ -48,9 +48,8 @@ class wxEventPtr(wxObjectPtr): def __repr__(self): return "" % (self.this,) class wxEvent(wxEventPtr): - def __init__(self,*_args,**_kwargs): - self.this = apply(eventsc.new_wxEvent,_args,_kwargs) - self.thisown = 1 + def __init__(self,this): + self.this = this diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 559df4da75..85cdce4432 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -1908,7 +1908,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxBORDER", PyInt_FromLong((long) wxBORDER)); PyDict_SetItemString(d,"wxSIMPLE_BORDER", PyInt_FromLong((long) wxSIMPLE_BORDER)); PyDict_SetItemString(d,"wxSTATIC_BORDER", PyInt_FromLong((long) wxSTATIC_BORDER)); - PyDict_SetItemString(d,"wxBORDER_MASK", PyInt_FromLong((long) wxBORDER_MASK)); PyDict_SetItemString(d,"wxTRANSPARENT_WINDOW", PyInt_FromLong((long) wxTRANSPARENT_WINDOW)); PyDict_SetItemString(d,"wxNO_BORDER", PyInt_FromLong((long) wxNO_BORDER)); PyDict_SetItemString(d,"wxUSER_COLOURS", PyInt_FromLong((long) wxUSER_COLOURS)); @@ -2183,6 +2182,14 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxMM_ANISOTROPIC", PyInt_FromLong((long) wxMM_ANISOTROPIC)); PyDict_SetItemString(d,"wxMM_POINTS", PyInt_FromLong((long) wxMM_POINTS)); PyDict_SetItemString(d,"wxMM_METRIC", PyInt_FromLong((long) wxMM_METRIC)); + PyDict_SetItemString(d,"wxBORDER_DEFAULT", PyInt_FromLong((long) wxBORDER_DEFAULT)); + PyDict_SetItemString(d,"wxBORDER_NONE", PyInt_FromLong((long) wxBORDER_NONE)); + PyDict_SetItemString(d,"wxBORDER_STATIC", PyInt_FromLong((long) wxBORDER_STATIC)); + PyDict_SetItemString(d,"wxBORDER_SIMPLE", PyInt_FromLong((long) wxBORDER_SIMPLE)); + PyDict_SetItemString(d,"wxBORDER_RAISED", PyInt_FromLong((long) wxBORDER_RAISED)); + PyDict_SetItemString(d,"wxBORDER_SUNKEN", PyInt_FromLong((long) wxBORDER_SUNKEN)); + PyDict_SetItemString(d,"wxBORDER_DOUBLE", PyInt_FromLong((long) wxBORDER_DOUBLE)); + PyDict_SetItemString(d,"wxBORDER_MASK", PyInt_FromLong((long) wxBORDER_MASK)); PyDict_SetItemString(d,"wxDEFAULT", PyInt_FromLong((long) wxDEFAULT)); PyDict_SetItemString(d,"wxDECORATIVE", PyInt_FromLong((long) wxDECORATIVE)); PyDict_SetItemString(d,"wxROMAN", PyInt_FromLong((long) wxROMAN)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 9d3d2d20ee..1d084f8148 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -173,7 +173,6 @@ wxRAISED_BORDER = wxc.wxRAISED_BORDER wxBORDER = wxc.wxBORDER wxSIMPLE_BORDER = wxc.wxSIMPLE_BORDER wxSTATIC_BORDER = wxc.wxSTATIC_BORDER -wxBORDER_MASK = wxc.wxBORDER_MASK wxTRANSPARENT_WINDOW = wxc.wxTRANSPARENT_WINDOW wxNO_BORDER = wxc.wxNO_BORDER wxUSER_COLOURS = wxc.wxUSER_COLOURS @@ -448,6 +447,14 @@ wxMM_ISOTROPIC = wxc.wxMM_ISOTROPIC wxMM_ANISOTROPIC = wxc.wxMM_ANISOTROPIC wxMM_POINTS = wxc.wxMM_POINTS wxMM_METRIC = wxc.wxMM_METRIC +wxBORDER_DEFAULT = wxc.wxBORDER_DEFAULT +wxBORDER_NONE = wxc.wxBORDER_NONE +wxBORDER_STATIC = wxc.wxBORDER_STATIC +wxBORDER_SIMPLE = wxc.wxBORDER_SIMPLE +wxBORDER_RAISED = wxc.wxBORDER_RAISED +wxBORDER_SUNKEN = wxc.wxBORDER_SUNKEN +wxBORDER_DOUBLE = wxc.wxBORDER_DOUBLE +wxBORDER_MASK = wxc.wxBORDER_MASK wxDEFAULT = wxc.wxDEFAULT wxDECORATIVE = wxc.wxDECORATIVE wxROMAN = wxc.wxROMAN -- 2.45.2