From 59988cd01058e38ea408b0751fdf8bf9cab09f38 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 13 Apr 2002 03:42:53 +0000 Subject: [PATCH 1/1] SWIGged updates for wxMAC git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/mac/controls.cpp | 38 +++++ wxPython/src/mac/controls.py | 3 + wxPython/src/mac/controls2.cpp | 3 + wxPython/src/mac/controls2.py | 3 + wxPython/src/mac/events.cpp | 260 +++++++++++++++++++++++++++++++++ wxPython/src/mac/events.py | 33 +++++ wxPython/src/mac/fonts.cpp | 62 +++++++- wxPython/src/mac/fonts.py | 10 ++ wxPython/src/mac/frames.py | 2 + wxPython/src/mac/gdi.cpp | 29 ++++ wxPython/src/mac/gdi.py | 5 + wxPython/src/mac/grid.cpp | 17 ++- wxPython/src/mac/html.cpp | 4 +- wxPython/src/mac/image.cpp | 50 ------- wxPython/src/mac/image.py | 3 - wxPython/src/mac/misc.cpp | 8 + wxPython/src/mac/misc2.cpp | 73 ++++++++- wxPython/src/mac/misc2.py | 2 + wxPython/src/mac/sizers.cpp | 2 +- wxPython/src/mac/utils.cpp | 5 +- wxPython/src/mac/windows.cpp | 228 +++++++++++++++++------------ wxPython/src/mac/windows.py | 25 ++-- wxPython/src/mac/wx.cpp | 11 +- wxPython/src/mac/wx.py | 44 +++++- 24 files changed, 752 insertions(+), 168 deletions(-) diff --git a/wxPython/src/mac/controls.cpp b/wxPython/src/mac/controls.cpp index dd7393c6ea..6537b7c797 100644 --- a/wxPython/src/mac/controls.cpp +++ b/wxPython/src/mac/controls.cpp @@ -6919,6 +6919,43 @@ static PyObject *_wrap_wxTextCtrl_AppendText(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxTextCtrl_EmulateKeyPress(_swigobj,_swigarg0) (_swigobj->EmulateKeyPress(_swigarg0)) +static PyObject *_wrap_wxTextCtrl_EmulateKeyPress(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxTextCtrl * _arg0; + wxKeyEvent * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","event", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTextCtrl_EmulateKeyPress",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextCtrl_EmulateKeyPress. Expected _wxTextCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTextCtrl_EmulateKeyPress. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxTextCtrl_EmulateKeyPress(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxTextCtrl_SetStyle(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetStyle(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_wxTextCtrl_SetStyle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -11042,6 +11079,7 @@ static PyMethodDef controlscMethods[] = { { "wxTextCtrl_GetDefaultStyle", (PyCFunction) _wrap_wxTextCtrl_GetDefaultStyle, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_SetDefaultStyle", (PyCFunction) _wrap_wxTextCtrl_SetDefaultStyle, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_SetStyle", (PyCFunction) _wrap_wxTextCtrl_SetStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxTextCtrl_EmulateKeyPress", (PyCFunction) _wrap_wxTextCtrl_EmulateKeyPress, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_AppendText", (PyCFunction) _wrap_wxTextCtrl_AppendText, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_WriteText", (PyCFunction) _wrap_wxTextCtrl_WriteText, METH_VARARGS | METH_KEYWORDS }, { "wxTextCtrl_SetMaxLength", (PyCFunction) _wrap_wxTextCtrl_SetMaxLength, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/controls.py b/wxPython/src/mac/controls.py index c109ede933..f8c4f6655d 100644 --- a/wxPython/src/mac/controls.py +++ b/wxPython/src/mac/controls.py @@ -664,6 +664,9 @@ class wxTextCtrlPtr(wxControlPtr): def AppendText(self, *_args, **_kwargs): val = apply(controlsc.wxTextCtrl_AppendText,(self,) + _args, _kwargs) return val + def EmulateKeyPress(self, *_args, **_kwargs): + val = apply(controlsc.wxTextCtrl_EmulateKeyPress,(self,) + _args, _kwargs) + return val def SetStyle(self, *_args, **_kwargs): val = apply(controlsc.wxTextCtrl_SetStyle,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/mac/controls2.cpp b/wxPython/src/mac/controls2.cpp index 965b0d0eb7..0d9e647a9e 100644 --- a/wxPython/src/mac/controls2.cpp +++ b/wxPython/src/mac/controls2.cpp @@ -11183,6 +11183,9 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxDIRCTRL_SELECT_FIRST", PyInt_FromLong((long) wxDIRCTRL_SELECT_FIRST)); PyDict_SetItemString(d,"wxDIRCTRL_SHOW_FILTERS", PyInt_FromLong((long) wxDIRCTRL_SHOW_FILTERS)); PyDict_SetItemString(d,"wxDIRCTRL_3D_INTERNAL", PyInt_FromLong((long) wxDIRCTRL_3D_INTERNAL)); + PyDict_SetItemString(d,"wxDIRCTRL_EDIT_LABELS", PyInt_FromLong((long) wxDIRCTRL_EDIT_LABELS)); + PyDict_SetItemString(d,"wxID_TREECTRL", PyInt_FromLong((long) wxID_TREECTRL)); + PyDict_SetItemString(d,"wxID_FILTERLISTCTRL", PyInt_FromLong((long) wxID_FILTERLISTCTRL)); // Map renamed classes back to their common name for OOR wxPyPtrTypeMap_Add("wxTreeItemData", "wxPyTreeItemData"); diff --git a/wxPython/src/mac/controls2.py b/wxPython/src/mac/controls2.py index 0df7c67c10..20795adaef 100644 --- a/wxPython/src/mac/controls2.py +++ b/wxPython/src/mac/controls2.py @@ -1415,3 +1415,6 @@ wxDIRCTRL_DIR_ONLY = controls2c.wxDIRCTRL_DIR_ONLY wxDIRCTRL_SELECT_FIRST = controls2c.wxDIRCTRL_SELECT_FIRST wxDIRCTRL_SHOW_FILTERS = controls2c.wxDIRCTRL_SHOW_FILTERS wxDIRCTRL_3D_INTERNAL = controls2c.wxDIRCTRL_3D_INTERNAL +wxDIRCTRL_EDIT_LABELS = controls2c.wxDIRCTRL_EDIT_LABELS +wxID_TREECTRL = controls2c.wxID_TREECTRL +wxID_FILTERLISTCTRL = controls2c.wxID_FILTERLISTCTRL diff --git a/wxPython/src/mac/events.cpp b/wxPython/src/mac/events.cpp index f3b78a7cf3..76a016a658 100644 --- a/wxPython/src/mac/events.cpp +++ b/wxPython/src/mac/events.cpp @@ -3132,6 +3132,86 @@ static PyObject *_wrap_wxMouseEvent_m_linesPerAction_get(PyObject *self, PyObjec return _resultobj; } +static void *SwigwxMouseCaptureChangedEventTowxEvent(void *ptr) { + wxMouseCaptureChangedEvent *src; + wxEvent *dest; + src = (wxMouseCaptureChangedEvent *) ptr; + dest = (wxEvent *) src; + return (void *) dest; +} + +static void *SwigwxMouseCaptureChangedEventTowxObject(void *ptr) { + wxMouseCaptureChangedEvent *src; + wxObject *dest; + src = (wxMouseCaptureChangedEvent *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxMouseCaptureChangedEvent(_swigarg0,_swigarg1) (new wxMouseCaptureChangedEvent(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxMouseCaptureChangedEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMouseCaptureChangedEvent * _result; + wxWindowID _arg0 = (wxWindowID ) 0; + wxWindow * _arg1 = (wxWindow *) NULL; + PyObject * _argo1 = 0; + char *_kwnames[] = { "id","gainedCapture", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|iO:new_wxMouseCaptureChangedEvent",_kwnames,&_arg0,&_argo1)) + 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 new_wxMouseCaptureChangedEvent. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxMouseCaptureChangedEvent *)new_wxMouseCaptureChangedEvent(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMouseCaptureChangedEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxMouseCaptureChangedEvent_GetCapturedWindow(_swigobj) (_swigobj->GetCapturedWindow()) +static PyObject *_wrap_wxMouseCaptureChangedEvent_GetCapturedWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxMouseCaptureChangedEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMouseCaptureChangedEvent_GetCapturedWindow",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxMouseCaptureChangedEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMouseCaptureChangedEvent_GetCapturedWindow. Expected _wxMouseCaptureChangedEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxMouseCaptureChangedEvent_GetCapturedWindow(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + static void *SwigwxKeyEventTowxEvent(void *ptr) { wxKeyEvent *src; wxEvent *dest; @@ -3371,6 +3451,62 @@ static PyObject *_wrap_wxKeyEvent_HasModifiers(PyObject *self, PyObject *args, P return _resultobj; } +#define wxKeyEvent_GetRawKeyCode(_swigobj) (_swigobj->GetRawKeyCode()) +static PyObject *_wrap_wxKeyEvent_GetRawKeyCode(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxKeyEvent_GetRawKeyCode",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_GetRawKeyCode. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_GetRawKeyCode(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxKeyEvent_GetRawKeyFlags(_swigobj) (_swigobj->GetRawKeyFlags()) +static PyObject *_wrap_wxKeyEvent_GetRawKeyFlags(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxKeyEvent_GetRawKeyFlags",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_GetRawKeyFlags. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_GetRawKeyFlags(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + #define wxKeyEvent_GetX(_swigobj) (_swigobj->GetX()) static PyObject *_wrap_wxKeyEvent_GetX(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3971,6 +4107,120 @@ static PyObject *_wrap_wxKeyEvent_m_scanCode_get(PyObject *self, PyObject *args, return _resultobj; } +#define wxKeyEvent_m_rawCode_set(_swigobj,_swigval) (_swigobj->m_rawCode = _swigval,_swigval) +static PyObject *_wrap_wxKeyEvent_m_rawCode_set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","m_rawCode", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxKeyEvent_m_rawCode_set",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_m_rawCode_set. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_m_rawCode_set(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxKeyEvent_m_rawCode_get(_swigobj) ((long ) _swigobj->m_rawCode) +static PyObject *_wrap_wxKeyEvent_m_rawCode_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxKeyEvent_m_rawCode_get",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_m_rawCode_get. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_m_rawCode_get(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxKeyEvent_m_rawFlags_set(_swigobj,_swigval) (_swigobj->m_rawFlags = _swigval,_swigval) +static PyObject *_wrap_wxKeyEvent_m_rawFlags_set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","m_rawFlags", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxKeyEvent_m_rawFlags_set",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_m_rawFlags_set. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_m_rawFlags_set(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxKeyEvent_m_rawFlags_get(_swigobj) ((long ) _swigobj->m_rawFlags) +static PyObject *_wrap_wxKeyEvent_m_rawFlags_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxKeyEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxKeyEvent_m_rawFlags_get",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxKeyEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxKeyEvent_m_rawFlags_get. Expected _wxKeyEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (long )wxKeyEvent_m_rawFlags_get(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + static void *SwigwxNavigationKeyEventTowxEvent(void *ptr) { wxNavigationKeyEvent *src; wxEvent *dest; @@ -7213,6 +7463,10 @@ static PyMethodDef eventscMethods[] = { { "wxNavigationKeyEvent_SetDirection", (PyCFunction) _wrap_wxNavigationKeyEvent_SetDirection, METH_VARARGS | METH_KEYWORDS }, { "wxNavigationKeyEvent_GetDirection", (PyCFunction) _wrap_wxNavigationKeyEvent_GetDirection, METH_VARARGS | METH_KEYWORDS }, { "new_wxNavigationKeyEvent", (PyCFunction) _wrap_new_wxNavigationKeyEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_m_rawFlags_get", (PyCFunction) _wrap_wxKeyEvent_m_rawFlags_get, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_m_rawFlags_set", (PyCFunction) _wrap_wxKeyEvent_m_rawFlags_set, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_m_rawCode_get", (PyCFunction) _wrap_wxKeyEvent_m_rawCode_get, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_m_rawCode_set", (PyCFunction) _wrap_wxKeyEvent_m_rawCode_set, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_m_scanCode_get", (PyCFunction) _wrap_wxKeyEvent_m_scanCode_get, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_m_scanCode_set", (PyCFunction) _wrap_wxKeyEvent_m_scanCode_set, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_m_metaDown_get", (PyCFunction) _wrap_wxKeyEvent_m_metaDown_get, METH_VARARGS | METH_KEYWORDS }, @@ -7233,6 +7487,8 @@ static PyMethodDef eventscMethods[] = { { "wxKeyEvent_GetPosition", (PyCFunction) _wrap_wxKeyEvent_GetPosition, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_GetY", (PyCFunction) _wrap_wxKeyEvent_GetY, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_GetX", (PyCFunction) _wrap_wxKeyEvent_GetX, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_GetRawKeyFlags", (PyCFunction) _wrap_wxKeyEvent_GetRawKeyFlags, METH_VARARGS | METH_KEYWORDS }, + { "wxKeyEvent_GetRawKeyCode", (PyCFunction) _wrap_wxKeyEvent_GetRawKeyCode, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_HasModifiers", (PyCFunction) _wrap_wxKeyEvent_HasModifiers, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_GetKeyCode", (PyCFunction) _wrap_wxKeyEvent_GetKeyCode, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_KeyCode", (PyCFunction) _wrap_wxKeyEvent_KeyCode, METH_VARARGS | METH_KEYWORDS }, @@ -7241,6 +7497,8 @@ 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 }, + { "wxMouseCaptureChangedEvent_GetCapturedWindow", (PyCFunction) _wrap_wxMouseCaptureChangedEvent_GetCapturedWindow, METH_VARARGS | METH_KEYWORDS }, + { "new_wxMouseCaptureChangedEvent", (PyCFunction) _wrap_new_wxMouseCaptureChangedEvent, 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 }, @@ -7378,6 +7636,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvent","_wxMoveEvent",SwigwxMoveEventTowxEvent}, { "_wxEvent","_wxNavigationKeyEvent",SwigwxNavigationKeyEventTowxEvent}, { "_wxEvent","_wxKeyEvent",SwigwxKeyEventTowxEvent}, + { "_wxEvent","_wxMouseCaptureChangedEvent",SwigwxMouseCaptureChangedEventTowxEvent}, { "_wxEvent","_wxMouseEvent",SwigwxMouseEventTowxEvent}, { "_wxEvent","_wxSpinEvent",SwigwxSpinEventTowxEvent}, { "_wxEvent","_wxScrollWinEvent",SwigwxScrollWinEventTowxEvent}, @@ -7469,6 +7728,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxMoveEvent",SwigwxMoveEventTowxObject}, { "_wxObject","_wxNavigationKeyEvent",SwigwxNavigationKeyEventTowxObject}, { "_wxObject","_wxKeyEvent",SwigwxKeyEventTowxObject}, + { "_wxObject","_wxMouseCaptureChangedEvent",SwigwxMouseCaptureChangedEventTowxObject}, { "_wxObject","_wxMouseEvent",SwigwxMouseEventTowxObject}, { "_wxObject","_wxSpinEvent",SwigwxSpinEventTowxObject}, { "_wxObject","_wxScrollWinEvent",SwigwxScrollWinEventTowxObject}, diff --git a/wxPython/src/mac/events.py b/wxPython/src/mac/events.py index abb06e397a..067c8ed1f5 100644 --- a/wxPython/src/mac/events.py +++ b/wxPython/src/mac/events.py @@ -389,6 +389,23 @@ class wxMouseEvent(wxMouseEventPtr): +class wxMouseCaptureChangedEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetCapturedWindow(self, *_args, **_kwargs): + val = apply(eventsc.wxMouseCaptureChangedEvent_GetCapturedWindow,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxMouseCaptureChangedEvent(wxMouseCaptureChangedEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxMouseCaptureChangedEvent,_args,_kwargs) + self.thisown = 1 + + + + class wxKeyEventPtr(wxEventPtr): def __init__(self,this): self.this = this @@ -414,6 +431,12 @@ class wxKeyEventPtr(wxEventPtr): def HasModifiers(self, *_args, **_kwargs): val = apply(eventsc.wxKeyEvent_HasModifiers,(self,) + _args, _kwargs) return val + def GetRawKeyCode(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetRawKeyCode,(self,) + _args, _kwargs) + return val + def GetRawKeyFlags(self, *_args, **_kwargs): + val = apply(eventsc.wxKeyEvent_GetRawKeyFlags,(self,) + _args, _kwargs) + return val def GetX(self, *_args, **_kwargs): val = apply(eventsc.wxKeyEvent_GetX,(self,) + _args, _kwargs) return val @@ -452,6 +475,12 @@ class wxKeyEventPtr(wxEventPtr): if name == "m_scanCode" : eventsc.wxKeyEvent_m_scanCode_set(self,value) return + if name == "m_rawCode" : + eventsc.wxKeyEvent_m_rawCode_set(self,value) + return + if name == "m_rawFlags" : + eventsc.wxKeyEvent_m_rawFlags_set(self,value) + return self.__dict__[name] = value def __getattr__(self,name): if name == "m_x" : @@ -470,6 +499,10 @@ class wxKeyEventPtr(wxEventPtr): return eventsc.wxKeyEvent_m_metaDown_get(self) if name == "m_scanCode" : return eventsc.wxKeyEvent_m_scanCode_get(self) + if name == "m_rawCode" : + return eventsc.wxKeyEvent_m_rawCode_get(self) + if name == "m_rawFlags" : + return eventsc.wxKeyEvent_m_rawFlags_get(self) raise AttributeError,name def __repr__(self): return "" % (self.this,) diff --git a/wxPython/src/mac/fonts.cpp b/wxPython/src/mac/fonts.cpp index de9234308a..44d84dd54f 100644 --- a/wxPython/src/mac/fonts.cpp +++ b/wxPython/src/mac/fonts.cpp @@ -58,7 +58,6 @@ extern PyObject *SWIG_newvarlink(void); #include "helpers.h" #include #include -#include #include #include #include @@ -893,6 +892,65 @@ static PyObject *_wrap_delete_wxFontMapper(PyObject *self, PyObject *args, PyObj return _resultobj; } +static PyObject *_wrap_wxFontMapper_Get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxFontMapper_Get",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxFontMapper *)wxFontMapper::Get(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxFontMapper_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +static PyObject *_wrap_wxFontMapper_Set(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFontMapper * _result; + wxFontMapper * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "mapper", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFontMapper_Set",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFontMapper_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFontMapper_Set. Expected _wxFontMapper_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxFontMapper *)wxFontMapper::Set(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxFontMapper_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static PyObject * wxFontMapper_GetAltForEncoding(wxFontMapper *self,wxFontEncoding encoding,const wxString & facename,bool interactive) { wxFontEncoding alt_enc; if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive)) @@ -3660,6 +3718,8 @@ static PyMethodDef fontscMethods[] = { { "wxFontMapper_CharsetToEncoding", (PyCFunction) _wrap_wxFontMapper_CharsetToEncoding, METH_VARARGS | METH_KEYWORDS }, { "wxFontMapper_IsEncodingAvailable", (PyCFunction) _wrap_wxFontMapper_IsEncodingAvailable, METH_VARARGS | METH_KEYWORDS }, { "wxFontMapper_GetAltForEncoding", (PyCFunction) _wrap_wxFontMapper_GetAltForEncoding, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_Set", (PyCFunction) _wrap_wxFontMapper_Set, METH_VARARGS | METH_KEYWORDS }, + { "wxFontMapper_Get", (PyCFunction) _wrap_wxFontMapper_Get, METH_VARARGS | METH_KEYWORDS }, { "delete_wxFontMapper", (PyCFunction) _wrap_delete_wxFontMapper, METH_VARARGS | METH_KEYWORDS }, { "new_wxFontMapper", (PyCFunction) _wrap_new_wxFontMapper, METH_VARARGS | METH_KEYWORDS }, { "wxNativeFontInfo_ToUserString", (PyCFunction) _wrap_wxNativeFontInfo_ToUserString, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/fonts.py b/wxPython/src/mac/fonts.py index 6b237f4e73..67f10f0940 100644 --- a/wxPython/src/mac/fonts.py +++ b/wxPython/src/mac/fonts.py @@ -381,6 +381,16 @@ def wxGetLocale(*_args, **_kwargs): wxGetTranslation = fontsc.wxGetTranslation +def wxFontMapper_Get(*_args, **_kwargs): + val = apply(fontsc.wxFontMapper_Get,_args,_kwargs) + if val: val = wxFontMapperPtr(val) + return val + +def wxFontMapper_Set(*_args, **_kwargs): + val = apply(fontsc.wxFontMapper_Set,_args,_kwargs) + if val: val = wxFontMapperPtr(val) + return val + wxFontMapper_GetEncodingName = fontsc.wxFontMapper_GetEncodingName wxFontMapper_GetEncodingDescription = fontsc.wxFontMapper_GetEncodingDescription diff --git a/wxPython/src/mac/frames.py b/wxPython/src/mac/frames.py index 0e4465a5da..d2ac054f6a 100644 --- a/wxPython/src/mac/frames.py +++ b/wxPython/src/mac/frames.py @@ -234,6 +234,7 @@ class wxSplashScreenWindow(wxSplashScreenWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(framesc.new_wxSplashScreenWindow,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) @@ -258,6 +259,7 @@ class wxSplashScreen(wxSplashScreenPtr): def __init__(self,*_args,**_kwargs): self.this = apply(framesc.new_wxSplashScreen,_args,_kwargs) self.thisown = 1 + self._setOORInfo(self) diff --git a/wxPython/src/mac/gdi.cpp b/wxPython/src/mac/gdi.cpp index 86b0a56be1..6734886fdc 100644 --- a/wxPython/src/mac/gdi.cpp +++ b/wxPython/src/mac/gdi.cpp @@ -7870,6 +7870,34 @@ static PyObject *_wrap_new_wxBufferedDCInternalBuffer(PyObject *self, PyObject * return _resultobj; } +#define wxBufferedDC_UnMask(_swigobj) (_swigobj->UnMask()) +static PyObject *_wrap_wxBufferedDC_UnMask(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBufferedDC * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBufferedDC_UnMask",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBufferedDC_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBufferedDC_UnMask. Expected _wxBufferedDC_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxBufferedDC_UnMask(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxBufferedPaintDCTowxBufferedDC(void *ptr) { wxBufferedPaintDC *src; wxBufferedDC *dest; @@ -10011,6 +10039,7 @@ static PyMethodDef gdicMethods[] = { { "wxScreenDC_StartDrawingOnTopWin", (PyCFunction) _wrap_wxScreenDC_StartDrawingOnTopWin, METH_VARARGS | METH_KEYWORDS }, { "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxBufferedPaintDC", (PyCFunction) _wrap_new_wxBufferedPaintDC, METH_VARARGS | METH_KEYWORDS }, + { "wxBufferedDC_UnMask", (PyCFunction) _wrap_wxBufferedDC_UnMask, METH_VARARGS | METH_KEYWORDS }, { "new_wxBufferedDCInternalBuffer", (PyCFunction) _wrap_new_wxBufferedDCInternalBuffer, METH_VARARGS | METH_KEYWORDS }, { "new_wxBufferedDC", (PyCFunction) _wrap_new_wxBufferedDC, METH_VARARGS | METH_KEYWORDS }, { "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/gdi.py b/wxPython/src/mac/gdi.py index c79782389b..1d3121d918 100644 --- a/wxPython/src/mac/gdi.py +++ b/wxPython/src/mac/gdi.py @@ -786,18 +786,23 @@ class wxBufferedDCPtr(wxMemoryDCPtr): def __init__(self,this): self.this = this self.thisown = 0 + def UnMask(self, *_args, **_kwargs): + val = apply(gdic.wxBufferedDC_UnMask,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxBufferedDC(wxBufferedDCPtr): def __init__(self,*_args,**_kwargs): self.this = apply(gdic.new_wxBufferedDC,_args,_kwargs) self.thisown = 1 + self._dc = _args[0] # save a ref so the other dc won't be deleted before self def wxBufferedDCInternalBuffer(*_args,**_kwargs): val = wxBufferedDCPtr(apply(gdic.new_wxBufferedDCInternalBuffer,_args,_kwargs)) val.thisown = 1 + val._dc = _args[0] # save a ref so the other dc won't be deleted before self return val diff --git a/wxPython/src/mac/grid.cpp b/wxPython/src/mac/grid.cpp index cf35e96616..1191e26f06 100644 --- a/wxPython/src/mac/grid.cpp +++ b/wxPython/src/mac/grid.cpp @@ -519,8 +519,23 @@ public: wxPyConstructObject((void*)&dc, "wxDC", 0), row, col)); if (ro) { - if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p")) + const char* errmsg = "GetBestSize should return a 2-tuple of integers or a wxSize object."; + if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p")) { rval = *ptr; + } + else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { + PyObject* o1 = PySequence_GetItem(ro, 0); + PyObject* o2 = PySequence_GetItem(ro, 1); + if (PyNumber_Check(o1) && PyNumber_Check(o2)) + rval = wxSize(PyInt_AsLong(o1), PyInt_AsLong(o2)); + else + PyErr_SetString(PyExc_TypeError, errmsg); + Py_DECREF(o1); + Py_DECREF(o2); + } + else { + PyErr_SetString(PyExc_TypeError, errmsg); + } Py_DECREF(ro); } } diff --git a/wxPython/src/mac/html.cpp b/wxPython/src/mac/html.cpp index f50735be24..37e1ac0410 100644 --- a/wxPython/src/mac/html.cpp +++ b/wxPython/src/mac/html.cpp @@ -4066,7 +4066,7 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject wxSize temp0; PyObject * _obj3 = 0; PyObject * _obj5 = 0; - char *_kwnames[] = { "parent","id","pos","size","flags","name", NULL }; + char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; @@ -4161,7 +4161,7 @@ static PyObject *_wrap_wxHtmlWindow_Create(PyObject *self, PyObject *args, PyObj wxSize temp0; PyObject * _obj4 = 0; PyObject * _obj6 = 0; - char *_kwnames[] = { "self","parent","id","pos","size","flags","name", NULL }; + char *_kwnames[] = { "self","parent","id","pos","size","style","name", NULL }; self = self; if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|iOOiO:wxHtmlWindow_Create",_kwnames,&_argo0,&_argo1,&_arg2,&_obj3,&_obj4,&_arg5,&_obj6)) diff --git a/wxPython/src/mac/image.cpp b/wxPython/src/mac/image.cpp index 39103bd585..4fd7dc32aa 100644 --- a/wxPython/src/mac/image.cpp +++ b/wxPython/src/mac/image.cpp @@ -1685,55 +1685,6 @@ static PyObject *_wrap_wxImage_SetMaskFromImage(PyObject *self, PyObject *args, return _resultobj; } -#define wxImage_DoFloodFill(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5) (_swigobj->DoFloodFill(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5)) -static PyObject *_wrap_wxImage_DoFloodFill(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxImage * _arg0; - wxCoord _arg1; - wxCoord _arg2; - wxBrush * _arg3; - wxColour * _arg4; - int _arg5 = (int ) wxFLOOD_SURFACE; - int _arg6 = (int ) wxCOPY; - PyObject * _argo0 = 0; - PyObject * _argo3 = 0; - wxColour temp; - PyObject * _obj4 = 0; - char *_kwnames[] = { "self","x","y","fillBrush","testColour","style","LogicalFunction", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiiOO|ii:wxImage_DoFloodFill",_kwnames,&_argo0,&_arg1,&_arg2,&_argo3,&_obj4,&_arg5,&_arg6)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxImage_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxImage_DoFloodFill. Expected _wxImage_p."); - return NULL; - } - } - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxBrush_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxImage_DoFloodFill. Expected _wxBrush_p."); - return NULL; - } - } -{ - _arg4 = &temp; - if (! wxColour_helper(_obj4, &_arg4)) - return NULL; -} -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxImage_DoFloodFill(_arg0,_arg1,_arg2,*_arg3,*_arg4,_arg5,_arg6); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - static PyObject *_wrap_wxImage_CanRead(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; @@ -3192,7 +3143,6 @@ static PyMethodDef imagecMethods[] = { { "wxImage_LoadFile", (PyCFunction) _wrap_wxImage_LoadFile, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetImageCount", (PyCFunction) _wrap_wxImage_GetImageCount, METH_VARARGS | METH_KEYWORDS }, { "wxImage_CanRead", (PyCFunction) _wrap_wxImage_CanRead, METH_VARARGS | METH_KEYWORDS }, - { "wxImage_DoFloodFill", (PyCFunction) _wrap_wxImage_DoFloodFill, METH_VARARGS | METH_KEYWORDS }, { "wxImage_SetMaskFromImage", (PyCFunction) _wrap_wxImage_SetMaskFromImage, METH_VARARGS | METH_KEYWORDS }, { "wxImage_FindFirstUnusedColour", (PyCFunction) _wrap_wxImage_FindFirstUnusedColour, METH_VARARGS | METH_KEYWORDS }, { "wxImage_GetBlue", (PyCFunction) _wrap_wxImage_GetBlue, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/image.py b/wxPython/src/mac/image.py index a96f5b3829..844a22e954 100644 --- a/wxPython/src/mac/image.py +++ b/wxPython/src/mac/image.py @@ -227,9 +227,6 @@ class wxImagePtr(wxObjectPtr): def SetMaskFromImage(self, *_args, **_kwargs): val = apply(imagec.wxImage_SetMaskFromImage,(self,) + _args, _kwargs) return val - def DoFloodFill(self, *_args, **_kwargs): - val = apply(imagec.wxImage_DoFloodFill,(self,) + _args, _kwargs) - return val def LoadFile(self, *_args, **_kwargs): val = apply(imagec.wxImage_LoadFile,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/mac/misc.cpp b/wxPython/src/mac/misc.cpp index a79f65f43d..fc1e1ea340 100644 --- a/wxPython/src/mac/misc.cpp +++ b/wxPython/src/mac/misc.cpp @@ -1383,9 +1383,11 @@ static PyObject *_wrap_wxSize_SetHeight(PyObject *self, PyObject *args, PyObject } static PyObject * wxSize_asTuple(wxSize *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxSize_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -1653,9 +1655,11 @@ static PyObject *_wrap_wxRealPoint_Set(PyObject *self, PyObject *args, PyObject } static PyObject * wxRealPoint_asTuple(wxRealPoint *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyFloat_FromDouble(self->x)); PyTuple_SET_ITEM(tup, 1, PyFloat_FromDouble(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxRealPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -2003,9 +2007,11 @@ static PyObject *_wrap_wxPoint_Set(PyObject *self, PyObject *args, PyObject *kwa } static PyObject * wxPoint_asTuple(wxPoint *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxPoint_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { @@ -2989,11 +2995,13 @@ static PyObject *_wrap_wxRect_height_get(PyObject *self, PyObject *args, PyObjec } static PyObject * wxRect_asTuple(wxRect *self) { + wxPyBeginBlockThreads(); PyObject* tup = PyTuple_New(4); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->x)); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->y)); PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(self->width)); PyTuple_SET_ITEM(tup, 3, PyInt_FromLong(self->height)); + wxPyEndBlockThreads(); return tup; } static PyObject *_wrap_wxRect_asTuple(PyObject *self, PyObject *args, PyObject *kwargs) { diff --git a/wxPython/src/mac/misc2.cpp b/wxPython/src/mac/misc2.cpp index 502787d225..d24019e3c1 100644 --- a/wxPython/src/mac/misc2.cpp +++ b/wxPython/src/mac/misc2.cpp @@ -103,7 +103,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { // Put some wx default wxChar* values into wxStrings. DECLARE_DEF_STRING(FileSelectorPromptStr); DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); - + DECLARE_DEF_STRING(DirSelectorPromptStr); static const wxString wxPyEmptyString(wxT("")); int wxCaret_GetBlinkTime() { @@ -515,6 +515,76 @@ static PyObject *_wrap_wxSaveFileSelector(PyObject *self, PyObject *args, PyObje return _resultobj; } +static PyObject *_wrap_wxDirSelector(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxString * _arg0 = (wxString *) &wxPyDirSelectorPromptStr; + wxString * _arg1 = (wxString *) &wxPyEmptyString; + long _arg2 = (long ) wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxDD_NEW_DIR_BUTTON; + wxPoint * _arg3 = (wxPoint *) &wxDefaultPosition; + wxWindow * _arg4 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + wxPoint temp; + PyObject * _obj3 = 0; + PyObject * _argo4 = 0; + char *_kwnames[] = { "message","defaultPath","style","pos","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOlOO:wxDirSelector",_kwnames,&_obj0,&_obj1,&_arg2,&_obj3,&_argo4)) + return NULL; + if (_obj0) +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + return NULL; +} + if (_obj1) +{ + _arg1 = wxString_in_helper(_obj1); + if (_arg1 == NULL) + return NULL; +} + if (_obj3) +{ + _arg3 = &temp; + if (! wxPoint_helper(_obj3, &_arg3)) + return NULL; +} + if (_argo4) { + if (_argo4 == Py_None) { _arg4 = NULL; } + else if (SWIG_GetPtrObj(_argo4,(void **) &_arg4,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 5 of wxDirSelector. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxString (wxDirSelector(*_arg0,*_arg1,_arg2,*_arg3,_arg4)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ +#if wxUSE_UNICODE + _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len()); +#else + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +#endif +} +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + delete _result; +} + return _resultobj; +} + static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; @@ -9990,6 +10060,7 @@ static PyMethodDef misc2cMethods[] = { { "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS }, { "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS }, + { "wxDirSelector", (PyCFunction) _wrap_wxDirSelector, METH_VARARGS | METH_KEYWORDS }, { "wxSaveFileSelector", (PyCFunction) _wrap_wxSaveFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxLoadFileSelector", (PyCFunction) _wrap_wxLoadFileSelector, METH_VARARGS | METH_KEYWORDS }, { "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/misc2.py b/wxPython/src/mac/misc2.py index 6d76b60b3d..ed4dcf89ef 100644 --- a/wxPython/src/mac/misc2.py +++ b/wxPython/src/mac/misc2.py @@ -963,6 +963,8 @@ wxLoadFileSelector = misc2c.wxLoadFileSelector wxSaveFileSelector = misc2c.wxSaveFileSelector +wxDirSelector = misc2c.wxDirSelector + wxGetTextFromUser = misc2c.wxGetTextFromUser wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser diff --git a/wxPython/src/mac/sizers.cpp b/wxPython/src/mac/sizers.cpp index f5ddce5e15..eff8cbc850 100644 --- a/wxPython/src/mac/sizers.cpp +++ b/wxPython/src/mac/sizers.cpp @@ -860,7 +860,7 @@ static void *SwigwxSizerTowxObject(void *ptr) { } static void wxSizer__setOORInfo(wxSizer *self,PyObject * _self) { - self->SetClientObject(new wxPyClientData(_self)); + self->SetClientObject(new wxPyOORClientData(_self)); } static PyObject *_wrap_wxSizer__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; diff --git a/wxPython/src/mac/utils.cpp b/wxPython/src/mac/utils.cpp index 2d98462ff9..8c87577cbd 100644 --- a/wxPython/src/mac/utils.cpp +++ b/wxPython/src/mac/utils.cpp @@ -55,14 +55,13 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "utilsc" -#include "export.h" +#include "helpers.h" #include #include #include // Put some wx default wxChar* values into wxStrings. - static const wxChar* wxDateFormatStr = wxT("sashWindow"); - DECLARE_DEF_STRING(DateFormatStr); + DECLARE_DEF_STRING2(DateFormatStr, wxT("sashWindow")); static const wxString wxPyEmptyString(wxT("")); diff --git a/wxPython/src/mac/windows.cpp b/wxPython/src/mac/windows.cpp index f504f5c7e6..8449941978 100644 --- a/wxPython/src/mac/windows.cpp +++ b/wxPython/src/mac/windows.cpp @@ -522,7 +522,7 @@ static PyObject *_wrap_wxEvtHandler_Disconnect(PyObject *self, PyObject *args, P } static void wxEvtHandler__setOORInfo(wxEvtHandler *self,PyObject * _self) { - self->SetClientObject(new wxPyClientData(_self)); + self->SetClientObject(new wxPyOORClientData(_self)); } static PyObject *_wrap_wxEvtHandler__setOORInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -995,34 +995,6 @@ static PyObject *_wrap_wxWindow_Create(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxWindow_CaptureMouse(_swigobj) (_swigobj->CaptureMouse()) -static PyObject *_wrap_wxWindow_CaptureMouse(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWindow * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_CaptureMouse",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CaptureMouse. Expected _wxWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWindow_CaptureMouse(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxWindow_Center(_swigobj,_swigarg0) (_swigobj->Center(_swigarg0)) static PyObject *_wrap_wxWindow_Center(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3605,34 +3577,6 @@ static PyObject *_wrap_wxWindow_RefreshRect(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxWindow_ReleaseMouse(_swigobj) (_swigobj->ReleaseMouse()) -static PyObject *_wrap_wxWindow_ReleaseMouse(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWindow * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_ReleaseMouse",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_ReleaseMouse. Expected _wxWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWindow_ReleaseMouse(_arg0); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxWindow_RemoveChild(_swigobj,_swigarg0) (_swigobj->RemoveChild(_swigarg0)) static PyObject *_wrap_wxWindow_RemoveChild(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4802,36 +4746,6 @@ static PyObject *_wrap_wxWindow_Validate(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxWindow_WarpPointer(_swigobj,_swigarg0,_swigarg1) (_swigobj->WarpPointer(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxWindow_WarpPointer(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWindow * _arg0; - int _arg1; - int _arg2; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","x","y", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxWindow_WarpPointer",_kwnames,&_argo0,&_arg1,&_arg2)) - 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 wxWindow_WarpPointer. Expected _wxWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWindow_WarpPointer(_arg0,_arg1,_arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - #define wxWindow_ConvertDialogPointToPixels(_swigobj,_swigarg0) (_swigobj->ConvertDialogToPixels(_swigarg0)) static PyObject *_wrap_wxWindow_ConvertDialogPointToPixels(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -5998,6 +5912,138 @@ static PyObject *_wrap_wxWindow_SetDefaultItem(PyObject *self, PyObject *args, P return _resultobj; } +#define wxWindow_WarpPointer(_swigobj,_swigarg0,_swigarg1) (_swigobj->WarpPointer(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxWindow_WarpPointer(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","x","y", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxWindow_WarpPointer",_kwnames,&_argo0,&_arg1,&_arg2)) + 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 wxWindow_WarpPointer. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_WarpPointer(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_CaptureMouse(_swigobj) (_swigobj->CaptureMouse()) +static PyObject *_wrap_wxWindow_CaptureMouse(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_CaptureMouse",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_CaptureMouse. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_CaptureMouse(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_ReleaseMouse(_swigobj) (_swigobj->ReleaseMouse()) +static PyObject *_wrap_wxWindow_ReleaseMouse(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_ReleaseMouse",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_ReleaseMouse. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_ReleaseMouse(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +static PyObject *_wrap_wxWindow_GetCapture(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + char *_kwnames[] = { NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxWindow_GetCapture",_kwnames)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxWindow::GetCapture(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxWindow_HasCapture(_swigobj) (_swigobj->HasCapture()) +static PyObject *_wrap_wxWindow_HasCapture(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_HasCapture",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_HasCapture. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxWindow_HasCapture(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxPanelTowxWindow(void *ptr) { wxPanel *src; wxWindow *dest; @@ -10816,6 +10862,11 @@ static PyMethodDef windowscMethods[] = { { "wxPanel_Create", (PyCFunction) _wrap_wxPanel_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPrePanel", (PyCFunction) _wrap_new_wxPrePanel, METH_VARARGS | METH_KEYWORDS }, { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_HasCapture", (PyCFunction) _wrap_wxWindow_HasCapture, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_GetCapture", (PyCFunction) _wrap_wxWindow_GetCapture, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_ReleaseMouse", (PyCFunction) _wrap_wxWindow_ReleaseMouse, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_CaptureMouse", (PyCFunction) _wrap_wxWindow_CaptureMouse, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_WarpPointer", (PyCFunction) _wrap_wxWindow_WarpPointer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetDefaultItem", (PyCFunction) _wrap_wxWindow_SetDefaultItem, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetDefaultItem", (PyCFunction) _wrap_wxWindow_GetDefaultItem, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetAcceleratorTable", (PyCFunction) _wrap_wxWindow_GetAcceleratorTable, METH_VARARGS | METH_KEYWORDS }, @@ -10855,7 +10906,6 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_DLG_PNT", (PyCFunction) _wrap_wxWindow_ConvertDialogPointToPixels, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_ConvertDialogSizeToPixels", (PyCFunction) _wrap_wxWindow_ConvertDialogSizeToPixels, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_ConvertDialogPointToPixels", (PyCFunction) _wrap_wxWindow_ConvertDialogPointToPixels, METH_VARARGS | METH_KEYWORDS }, - { "wxWindow_WarpPointer", (PyCFunction) _wrap_wxWindow_WarpPointer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Validate", (PyCFunction) _wrap_wxWindow_Validate, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_UpdateWindowUI", (PyCFunction) _wrap_wxWindow_UpdateWindowUI, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_TransferDataToWindow", (PyCFunction) _wrap_wxWindow_TransferDataToWindow, METH_VARARGS | METH_KEYWORDS }, @@ -10890,7 +10940,6 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_ScreenToClientXY", (PyCFunction) _wrap_wxWindow_ScreenToClientXY, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Reparent", (PyCFunction) _wrap_wxWindow_Reparent, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_RemoveChild", (PyCFunction) _wrap_wxWindow_RemoveChild, METH_VARARGS | METH_KEYWORDS }, - { "wxWindow_ReleaseMouse", (PyCFunction) _wrap_wxWindow_ReleaseMouse, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_RefreshRect", (PyCFunction) _wrap_wxWindow_RefreshRect, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Refresh", (PyCFunction) _wrap_wxWindow_Refresh, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Raise", (PyCFunction) _wrap_wxWindow_Raise, METH_VARARGS | METH_KEYWORDS }, @@ -10968,7 +11017,6 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_CentreOnParent", (PyCFunction) _wrap_wxWindow_CentreOnParent, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Centre", (PyCFunction) _wrap_wxWindow_Centre, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Center", (PyCFunction) _wrap_wxWindow_Center, METH_VARARGS | METH_KEYWORDS }, - { "wxWindow_CaptureMouse", (PyCFunction) _wrap_wxWindow_CaptureMouse, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Create", (PyCFunction) _wrap_wxWindow_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreWindow", (PyCFunction) _wrap_new_wxPreWindow, METH_VARARGS | METH_KEYWORDS }, { "new_wxWindow", (PyCFunction) _wrap_new_wxWindow, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/windows.py b/wxPython/src/mac/windows.py index 58b4c2b007..1c80450298 100644 --- a/wxPython/src/mac/windows.py +++ b/wxPython/src/mac/windows.py @@ -119,9 +119,6 @@ class wxWindowPtr(wxEvtHandlerPtr): def Create(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Create,(self,) + _args, _kwargs) return val - def CaptureMouse(self, *_args, **_kwargs): - val = apply(windowsc.wxWindow_CaptureMouse,(self,) + _args, _kwargs) - return val def Center(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Center,(self,) + _args, _kwargs) return val @@ -365,9 +362,6 @@ class wxWindowPtr(wxEvtHandlerPtr): def RefreshRect(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_RefreshRect,(self,) + _args, _kwargs) return val - def ReleaseMouse(self, *_args, **_kwargs): - val = apply(windowsc.wxWindow_ReleaseMouse,(self,) + _args, _kwargs) - return val def RemoveChild(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_RemoveChild,(self,) + _args, _kwargs) return val @@ -471,9 +465,6 @@ class wxWindowPtr(wxEvtHandlerPtr): def Validate(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Validate,(self,) + _args, _kwargs) return val - def WarpPointer(self, *_args, **_kwargs): - val = apply(windowsc.wxWindow_WarpPointer,(self,) + _args, _kwargs) - return val def ConvertDialogPointToPixels(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_ConvertDialogPointToPixels,(self,) + _args, _kwargs) if val: val = wxPointPtr(val) ; val.thisown = 1 @@ -589,6 +580,18 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetDefaultItem(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetDefaultItem,(self,) + _args, _kwargs) return val + def WarpPointer(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_WarpPointer,(self,) + _args, _kwargs) + return val + def CaptureMouse(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_CaptureMouse,(self,) + _args, _kwargs) + return val + def ReleaseMouse(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_ReleaseMouse,(self,) + _args, _kwargs) + return val + def HasCapture(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_HasCapture,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) # replaces broken shadow method @@ -1083,6 +1086,10 @@ wxWindow_NextControlId = windowsc.wxWindow_NextControlId wxWindow_PrevControlId = windowsc.wxWindow_PrevControlId +def wxWindow_GetCapture(*_args, **_kwargs): + val = apply(windowsc.wxWindow_GetCapture,_args,_kwargs) + return val + wxMenuItem_GetLabelFromText = windowsc.wxMenuItem_GetLabelFromText diff --git a/wxPython/src/mac/wx.cpp b/wxPython/src/mac/wx.cpp index f04873bd5b..18d10299be 100644 --- a/wxPython/src/mac/wx.cpp +++ b/wxPython/src/mac/wx.cpp @@ -677,7 +677,11 @@ static wxPyCoreAPI API = { wxPyMake_wxSizer, wxPyPtrTypeMap_Add, wxArrayString2PyList_helper, - wxArrayInt2PyList_helper + wxArrayInt2PyList_helper, + + wxPyClientData_dtor, + wxPyUserData_dtor, + wxPyOORClientData_dtor }; @@ -1870,6 +1874,8 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxTB_DOCKABLE", PyInt_FromLong((long) wxTB_DOCKABLE)); PyDict_SetItemString(d,"wxTB_NOICONS", PyInt_FromLong((long) wxTB_NOICONS)); PyDict_SetItemString(d,"wxTB_TEXT", PyInt_FromLong((long) wxTB_TEXT)); + PyDict_SetItemString(d,"wxTB_NODIVIDER", PyInt_FromLong((long) wxTB_NODIVIDER)); + PyDict_SetItemString(d,"wxTB_NOALIGN", PyInt_FromLong((long) wxTB_NOALIGN)); PyDict_SetItemString(d,"wxCOLOURED", PyInt_FromLong((long) wxCOLOURED)); PyDict_SetItemString(d,"wxFIXED_LENGTH", PyInt_FromLong((long) wxFIXED_LENGTH)); PyDict_SetItemString(d,"wxALIGN_LEFT", PyInt_FromLong((long) wxALIGN_LEFT)); @@ -2062,6 +2068,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxPD_ELAPSED_TIME", PyInt_FromLong((long) wxPD_ELAPSED_TIME)); PyDict_SetItemString(d,"wxPD_ESTIMATED_TIME", PyInt_FromLong((long) wxPD_ESTIMATED_TIME)); PyDict_SetItemString(d,"wxPD_REMAINING_TIME", PyInt_FromLong((long) wxPD_REMAINING_TIME)); + PyDict_SetItemString(d,"wxDD_NEW_DIR_BUTTON", PyInt_FromLong((long) wxDD_NEW_DIR_BUTTON)); PyDict_SetItemString(d,"wxMENU_TEAROFF", PyInt_FromLong((long) wxMENU_TEAROFF)); PyDict_SetItemString(d,"wxMB_DOCKABLE", PyInt_FromLong((long) wxMB_DOCKABLE)); PyDict_SetItemString(d,"wxNO_FULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxNO_FULL_REPAINT_ON_RESIZE)); @@ -2465,6 +2472,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_LEFT_DCLICK", PyInt_FromLong((long) wxEVT_LEFT_DCLICK)); PyDict_SetItemString(d,"wxEVT_MIDDLE_DCLICK", PyInt_FromLong((long) wxEVT_MIDDLE_DCLICK)); PyDict_SetItemString(d,"wxEVT_RIGHT_DCLICK", PyInt_FromLong((long) wxEVT_RIGHT_DCLICK)); + PyDict_SetItemString(d,"wxEVT_MOUSE_CAPTURE_CHANGED", PyInt_FromLong((long) wxEVT_MOUSE_CAPTURE_CHANGED)); PyDict_SetItemString(d,"wxEVT_NC_LEFT_DOWN", PyInt_FromLong((long) wxEVT_NC_LEFT_DOWN)); PyDict_SetItemString(d,"wxEVT_NC_LEFT_UP", PyInt_FromLong((long) wxEVT_NC_LEFT_UP)); PyDict_SetItemString(d,"wxEVT_NC_MIDDLE_DOWN", PyInt_FromLong((long) wxEVT_NC_MIDDLE_DOWN)); @@ -2510,7 +2518,6 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_SHOW", PyInt_FromLong((long) wxEVT_SHOW)); PyDict_SetItemString(d,"wxEVT_ICONIZE", PyInt_FromLong((long) wxEVT_ICONIZE)); PyDict_SetItemString(d,"wxEVT_MAXIMIZE", PyInt_FromLong((long) wxEVT_MAXIMIZE)); - PyDict_SetItemString(d,"wxEVT_MOUSE_CAPTURE_CHANGED", PyInt_FromLong((long) wxEVT_MOUSE_CAPTURE_CHANGED)); PyDict_SetItemString(d,"wxEVT_PAINT", PyInt_FromLong((long) wxEVT_PAINT)); PyDict_SetItemString(d,"wxEVT_ERASE_BACKGROUND", PyInt_FromLong((long) wxEVT_ERASE_BACKGROUND)); PyDict_SetItemString(d,"wxEVT_NC_PAINT", PyInt_FromLong((long) wxEVT_NC_PAINT)); diff --git a/wxPython/src/mac/wx.py b/wxPython/src/mac/wx.py index 35c8c179f1..64ef51ce33 100644 --- a/wxPython/src/mac/wx.py +++ b/wxPython/src/mac/wx.py @@ -215,6 +215,8 @@ wxTB_FLAT = wxc.wxTB_FLAT wxTB_DOCKABLE = wxc.wxTB_DOCKABLE wxTB_NOICONS = wxc.wxTB_NOICONS wxTB_TEXT = wxc.wxTB_TEXT +wxTB_NODIVIDER = wxc.wxTB_NODIVIDER +wxTB_NOALIGN = wxc.wxTB_NOALIGN wxCOLOURED = wxc.wxCOLOURED wxFIXED_LENGTH = wxc.wxFIXED_LENGTH wxALIGN_LEFT = wxc.wxALIGN_LEFT @@ -407,6 +409,7 @@ wxPD_CAN_ABORT = wxc.wxPD_CAN_ABORT wxPD_ELAPSED_TIME = wxc.wxPD_ELAPSED_TIME wxPD_ESTIMATED_TIME = wxc.wxPD_ESTIMATED_TIME wxPD_REMAINING_TIME = wxc.wxPD_REMAINING_TIME +wxDD_NEW_DIR_BUTTON = wxc.wxDD_NEW_DIR_BUTTON wxMENU_TEAROFF = wxc.wxMENU_TEAROFF wxMB_DOCKABLE = wxc.wxMB_DOCKABLE wxNO_FULL_REPAINT_ON_RESIZE = wxc.wxNO_FULL_REPAINT_ON_RESIZE @@ -810,6 +813,7 @@ wxEVT_LEAVE_WINDOW = wxc.wxEVT_LEAVE_WINDOW wxEVT_LEFT_DCLICK = wxc.wxEVT_LEFT_DCLICK wxEVT_MIDDLE_DCLICK = wxc.wxEVT_MIDDLE_DCLICK wxEVT_RIGHT_DCLICK = wxc.wxEVT_RIGHT_DCLICK +wxEVT_MOUSE_CAPTURE_CHANGED = wxc.wxEVT_MOUSE_CAPTURE_CHANGED wxEVT_NC_LEFT_DOWN = wxc.wxEVT_NC_LEFT_DOWN wxEVT_NC_LEFT_UP = wxc.wxEVT_NC_LEFT_UP wxEVT_NC_MIDDLE_DOWN = wxc.wxEVT_NC_MIDDLE_DOWN @@ -855,7 +859,6 @@ wxEVT_DESTROY = wxc.wxEVT_DESTROY wxEVT_SHOW = wxc.wxEVT_SHOW wxEVT_ICONIZE = wxc.wxEVT_ICONIZE wxEVT_MAXIMIZE = wxc.wxEVT_MAXIMIZE -wxEVT_MOUSE_CAPTURE_CHANGED = wxc.wxEVT_MOUSE_CAPTURE_CHANGED wxEVT_PAINT = wxc.wxEVT_PAINT wxEVT_ERASE_BACKGROUND = wxc.wxEVT_ERASE_BACKGROUND wxEVT_NC_PAINT = wxc.wxEVT_NC_PAINT @@ -1097,6 +1100,9 @@ def EVT_MOUSE_EVENTS(win, func): win.Connect(-1, -1, wxEVT_LEAVE_WINDOW, func) win.Connect(-1, -1, wxEVT_ENTER_WINDOW, func) +def EVT_MOUSE_CAPTURE_CHANGED(win, func): + win.Connect(-1, -1, wxEVT_MOUSE_CAPTURE_CHANGED, func) + # EVT_COMMAND def EVT_COMMAND(win, id, cmd, func): win.Connect(id, -1, cmd, func) @@ -1546,6 +1552,34 @@ def wxPyTypeCast(obj, typeStr): return theObj +#---------------------------------------------------------------------------- + +class wxPyDeadObjectError(AttributeError): + pass + +class _wxPyDeadObject: + """ + Instances of wx objects that are OOR capable will have their __class__ + changed to this class when the C++ object is deleted. This should help + prevent crashes due to referencing a bogus C++ pointer. + """ + reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" + attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." + + def __repr__( self ): + if not hasattr(self, "_name"): + self._name = "[unknown]" + return self.reprStr % self._name + + def __getattr__( self, *args ): + if not hasattr(self, "_name"): + self._name = "[unknown]" + raise wxPyDeadObjectError( self.attrStr % self._name ) + + def __nonzero__(self): + return 0 + + #---------------------------------------------------------------------- #---------------------------------------------------------------------- @@ -1662,10 +1696,10 @@ class wxPyWidgetTester(wxApp): self.frame.Show(true) #---------------------------------------------------------------------------- -# DO NOT hold any other references to this object. This is how we know when -# to cleanup system resources that wxWin is holding. When this module is -# unloaded, the refcount on __cleanMeUp goes to zero and it calls the -# wxApp_CleanUp function. +# DO NOT hold any other references to this object. This is how we +# know when to cleanup system resources that wxWin is holding. When +# the sys module is unloaded, the refcount on sys.__wxPythonCleanup +# goes to zero and it calls the wxApp_CleanUp function. class __wxPyCleanup: def __init__(self): -- 2.45.2