From 722a4a3c4b4726c648dcb7a91a855e836b8f2197 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 27 May 2002 19:34:53 +0000 Subject: [PATCH] SWIGged updates for wxMac git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/mac/events.cpp | 209 +++++++++++++++++++++++++++++++++++ wxPython/src/mac/events.py | 30 +++++ wxPython/src/mac/frames.cpp | 2 +- wxPython/src/mac/misc2.cpp | 78 ------------- wxPython/src/mac/misc2.py | 8 -- wxPython/src/mac/windows.cpp | 202 ++++++++++++++++++++++++++++++++- wxPython/src/mac/windows.py | 19 ++++ wxPython/src/mac/wx.cpp | 8 +- wxPython/src/mac/wx.py | 11 +- 9 files changed, 475 insertions(+), 92 deletions(-) diff --git a/wxPython/src/mac/events.cpp b/wxPython/src/mac/events.cpp index 76a016a658..d29f730f89 100644 --- a/wxPython/src/mac/events.cpp +++ b/wxPython/src/mac/events.cpp @@ -3212,6 +3212,207 @@ static PyObject *_wrap_wxMouseCaptureChangedEvent_GetCapturedWindow(PyObject *se return _resultobj; } +static void *SwigwxSetCursorEventTowxEvent(void *ptr) { + wxSetCursorEvent *src; + wxEvent *dest; + src = (wxSetCursorEvent *) ptr; + dest = (wxEvent *) src; + return (void *) dest; +} + +static void *SwigwxSetCursorEventTowxObject(void *ptr) { + wxSetCursorEvent *src; + wxObject *dest; + src = (wxSetCursorEvent *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxSetCursorEvent(_swigarg0,_swigarg1) (new wxSetCursorEvent(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxSetCursorEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSetCursorEvent * _result; + wxCoord _arg0 = (wxCoord ) 0; + wxCoord _arg1 = (wxCoord ) 0; + char *_kwnames[] = { "x","y", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|ii:new_wxSetCursorEvent",_kwnames,&_arg0,&_arg1)) + return NULL; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxSetCursorEvent *)new_wxSetCursorEvent(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxSetCursorEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxSetCursorEvent_GetX(_swigobj) (_swigobj->GetX()) +static PyObject *_wrap_wxSetCursorEvent_GetX(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCoord _result; + wxSetCursorEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSetCursorEvent_GetX",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSetCursorEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSetCursorEvent_GetX. Expected _wxSetCursorEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxCoord )wxSetCursorEvent_GetX(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxSetCursorEvent_GetY(_swigobj) (_swigobj->GetY()) +static PyObject *_wrap_wxSetCursorEvent_GetY(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCoord _result; + wxSetCursorEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSetCursorEvent_GetY",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSetCursorEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSetCursorEvent_GetY. Expected _wxSetCursorEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxCoord )wxSetCursorEvent_GetY(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxSetCursorEvent_SetCursor(_swigobj,_swigarg0) (_swigobj->SetCursor(_swigarg0)) +static PyObject *_wrap_wxSetCursorEvent_SetCursor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSetCursorEvent * _arg0; + wxCursor * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","cursor", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxSetCursorEvent_SetCursor",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSetCursorEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSetCursorEvent_SetCursor. Expected _wxSetCursorEvent_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCursor_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxSetCursorEvent_SetCursor. Expected _wxCursor_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxSetCursorEvent_SetCursor(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxSetCursorEvent_GetCursor(_swigobj) (_swigobj->GetCursor()) +static PyObject *_wrap_wxSetCursorEvent_GetCursor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCursor * _result; + wxSetCursorEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSetCursorEvent_GetCursor",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSetCursorEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSetCursorEvent_GetCursor. Expected _wxSetCursorEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + const wxCursor & _result_ref = wxSetCursorEvent_GetCursor(_arg0); + _result = (wxCursor *) &_result_ref; + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxCursor_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxSetCursorEvent_HasCursor(_swigobj) (_swigobj->HasCursor()) +static PyObject *_wrap_wxSetCursorEvent_HasCursor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxSetCursorEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxSetCursorEvent_HasCursor",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSetCursorEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSetCursorEvent_HasCursor. Expected _wxSetCursorEvent_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (bool )wxSetCursorEvent_HasCursor(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxKeyEventTowxEvent(void *ptr) { wxKeyEvent *src; wxEvent *dest; @@ -7497,6 +7698,12 @@ static PyMethodDef eventscMethods[] = { { "wxKeyEvent_MetaDown", (PyCFunction) _wrap_wxKeyEvent_MetaDown, METH_VARARGS | METH_KEYWORDS }, { "wxKeyEvent_ControlDown", (PyCFunction) _wrap_wxKeyEvent_ControlDown, METH_VARARGS | METH_KEYWORDS }, { "new_wxKeyEvent", (PyCFunction) _wrap_new_wxKeyEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxSetCursorEvent_HasCursor", (PyCFunction) _wrap_wxSetCursorEvent_HasCursor, METH_VARARGS | METH_KEYWORDS }, + { "wxSetCursorEvent_GetCursor", (PyCFunction) _wrap_wxSetCursorEvent_GetCursor, METH_VARARGS | METH_KEYWORDS }, + { "wxSetCursorEvent_SetCursor", (PyCFunction) _wrap_wxSetCursorEvent_SetCursor, METH_VARARGS | METH_KEYWORDS }, + { "wxSetCursorEvent_GetY", (PyCFunction) _wrap_wxSetCursorEvent_GetY, METH_VARARGS | METH_KEYWORDS }, + { "wxSetCursorEvent_GetX", (PyCFunction) _wrap_wxSetCursorEvent_GetX, METH_VARARGS | METH_KEYWORDS }, + { "new_wxSetCursorEvent", (PyCFunction) _wrap_new_wxSetCursorEvent, 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 }, @@ -7636,6 +7843,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvent","_wxMoveEvent",SwigwxMoveEventTowxEvent}, { "_wxEvent","_wxNavigationKeyEvent",SwigwxNavigationKeyEventTowxEvent}, { "_wxEvent","_wxKeyEvent",SwigwxKeyEventTowxEvent}, + { "_wxEvent","_wxSetCursorEvent",SwigwxSetCursorEventTowxEvent}, { "_wxEvent","_wxMouseCaptureChangedEvent",SwigwxMouseCaptureChangedEventTowxEvent}, { "_wxEvent","_wxMouseEvent",SwigwxMouseEventTowxEvent}, { "_wxEvent","_wxSpinEvent",SwigwxSpinEventTowxEvent}, @@ -7728,6 +7936,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxMoveEvent",SwigwxMoveEventTowxObject}, { "_wxObject","_wxNavigationKeyEvent",SwigwxNavigationKeyEventTowxObject}, { "_wxObject","_wxKeyEvent",SwigwxKeyEventTowxObject}, + { "_wxObject","_wxSetCursorEvent",SwigwxSetCursorEventTowxObject}, { "_wxObject","_wxMouseCaptureChangedEvent",SwigwxMouseCaptureChangedEventTowxObject}, { "_wxObject","_wxMouseEvent",SwigwxMouseEventTowxObject}, { "_wxObject","_wxSpinEvent",SwigwxSpinEventTowxObject}, diff --git a/wxPython/src/mac/events.py b/wxPython/src/mac/events.py index 067c8ed1f5..14c4797811 100644 --- a/wxPython/src/mac/events.py +++ b/wxPython/src/mac/events.py @@ -406,6 +406,36 @@ class wxMouseCaptureChangedEvent(wxMouseCaptureChangedEventPtr): +class wxSetCursorEventPtr(wxEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetX(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetX,(self,) + _args, _kwargs) + return val + def GetY(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetY,(self,) + _args, _kwargs) + return val + def SetCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_SetCursor,(self,) + _args, _kwargs) + return val + def GetCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_GetCursor,(self,) + _args, _kwargs) + if val: val = wxCursorPtr(val) + return val + def HasCursor(self, *_args, **_kwargs): + val = apply(eventsc.wxSetCursorEvent_HasCursor,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxSetCursorEvent(wxSetCursorEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxSetCursorEvent,_args,_kwargs) + self.thisown = 1 + + + + class wxKeyEventPtr(wxEventPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/mac/frames.cpp b/wxPython/src/mac/frames.cpp index 7b8cc08ad4..fa5dfb8857 100644 --- a/wxPython/src/mac/frames.cpp +++ b/wxPython/src/mac/frames.cpp @@ -2451,7 +2451,7 @@ static PyObject *_wrap_new_wxSplashScreen(PyObject *self, PyObject *args, PyObje wxWindowID _arg4; wxPoint * _arg5 = (wxPoint *) &wxDefaultPosition; wxSize * _arg6 = (wxSize *) &wxDefaultSize; - long _arg7 = (long ) wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT; + long _arg7 = (long ) wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP; PyObject * _argo0 = 0; PyObject * _argo3 = 0; wxPoint temp; diff --git a/wxPython/src/mac/misc2.cpp b/wxPython/src/mac/misc2.cpp index fbfb7de59c..f8b54c9c88 100644 --- a/wxPython/src/mac/misc2.cpp +++ b/wxPython/src/mac/misc2.cpp @@ -1295,82 +1295,6 @@ static PyObject *_wrap_wxSetCursor(PyObject *self, PyObject *args, PyObject *kwa return _resultobj; } -static PyObject *_wrap_wxFindWindowByLabel(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWindow * _result; - wxString * _arg0; - wxWindow * _arg1 = (wxWindow *) NULL; - PyObject * _obj0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "label","parent", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByLabel",_kwnames,&_obj0,&_argo1)) - return NULL; -{ - _arg0 = wxString_in_helper(_obj0); - if (_arg0 == NULL) - 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 wxFindWindowByLabel. Expected _wxWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxWindow *)wxFindWindowByLabel(*_arg0,_arg1); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } -{ - if (_obj0) - delete _arg0; -} - return _resultobj; -} - -static PyObject *_wrap_wxFindWindowByName(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxWindow * _result; - wxString * _arg0; - wxWindow * _arg1 = (wxWindow *) NULL; - PyObject * _obj0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "name","parent", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByName",_kwnames,&_obj0,&_argo1)) - return NULL; -{ - _arg0 = wxString_in_helper(_obj0); - if (_arg0 == NULL) - 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 wxFindWindowByName. Expected _wxWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - _result = (wxWindow *)wxFindWindowByName(*_arg0,_arg1); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } -{ - if (_obj0) - delete _arg0; -} - return _resultobj; -} - static PyObject *_wrap_wxBeginBusyCursor(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxCursor * _arg0 = (wxCursor *) wxHOURGLASS_CURSOR; @@ -10150,8 +10074,6 @@ static PyMethodDef misc2cMethods[] = { { "wxGenericFindWindowAtPoint", (PyCFunction) _wrap_wxGenericFindWindowAtPoint, METH_VARARGS | METH_KEYWORDS }, { "wxGetActiveWindow", (PyCFunction) _wrap_wxGetActiveWindow, METH_VARARGS | METH_KEYWORDS }, { "wxBeginBusyCursor", (PyCFunction) _wrap_wxBeginBusyCursor, METH_VARARGS | METH_KEYWORDS }, - { "wxFindWindowByName", (PyCFunction) _wrap_wxFindWindowByName, METH_VARARGS | METH_KEYWORDS }, - { "wxFindWindowByLabel", (PyCFunction) _wrap_wxFindWindowByLabel, METH_VARARGS | METH_KEYWORDS }, { "wxSetCursor", (PyCFunction) _wrap_wxSetCursor, METH_VARARGS | METH_KEYWORDS }, { "wxGetClientDisplayRect", (PyCFunction) _wrap_wxGetClientDisplayRect, METH_VARARGS | METH_KEYWORDS }, { "wxClientDisplayRect", (PyCFunction) _wrap_wxClientDisplayRect, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/misc2.py b/wxPython/src/mac/misc2.py index a4378b6b21..3cb4e32448 100644 --- a/wxPython/src/mac/misc2.py +++ b/wxPython/src/mac/misc2.py @@ -1006,14 +1006,6 @@ def wxGetClientDisplayRect(*_args, **_kwargs): wxSetCursor = misc2c.wxSetCursor -def wxFindWindowByLabel(*_args, **_kwargs): - val = apply(misc2c.wxFindWindowByLabel,_args,_kwargs) - return val - -def wxFindWindowByName(*_args, **_kwargs): - val = apply(misc2c.wxFindWindowByName,_args,_kwargs) - return val - wxBeginBusyCursor = misc2c.wxBeginBusyCursor def wxGetActiveWindow(*_args, **_kwargs): diff --git a/wxPython/src/mac/windows.cpp b/wxPython/src/mac/windows.cpp index e890c28df4..1329928ad0 100644 --- a/wxPython/src/mac/windows.cpp +++ b/wxPython/src/mac/windows.cpp @@ -136,9 +136,127 @@ IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferFromWindow); IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator); + +wxWindow* wxFindWindowById( long id, const wxWindow *parent = NULL ) { + return wxWindow::FindWindowById(id, parent); +} + +wxWindow* wxFindWindowByName( const wxString& name, + const wxWindow *parent = NULL ) { + return wxWindow::FindWindowByName(name, parent); +} + +wxWindow* wxFindWindowByLabel( const wxString& label, + const wxWindow *parent = NULL ) { + return wxWindow::FindWindowByLabel(label, parent); +} #ifdef __cplusplus extern "C" { #endif +static PyObject *_wrap_wxFindWindowById(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + long _arg0; + wxWindow * _arg1 = (wxWindow *) NULL; + PyObject * _argo1 = 0; + char *_kwnames[] = { "id","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"l|O:wxFindWindowById",_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 wxFindWindowById. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxFindWindowById(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +static PyObject *_wrap_wxFindWindowByName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxString * _arg0; + wxWindow * _arg1 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "name","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByName",_kwnames,&_obj0,&_argo1)) + return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + 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 wxFindWindowByName. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxFindWindowByName(*_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + +static PyObject *_wrap_wxFindWindowByLabel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxString * _arg0; + wxWindow * _arg1 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "label","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|O:wxFindWindowByLabel",_kwnames,&_obj0,&_argo1)) + return NULL; +{ + _arg0 = wxString_in_helper(_obj0); + if (_arg0 == NULL) + 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 wxFindWindowByLabel. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxFindWindowByLabel(*_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } +{ + if (_obj0) + delete _arg0; +} + return _resultobj; +} + static void *SwigwxEvtHandlerTowxObject(void *ptr) { wxEvtHandler *src; wxObject *dest; @@ -3577,6 +3695,43 @@ static PyObject *_wrap_wxWindow_RefreshRect(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define wxWindow_AddChild(_swigobj,_swigarg0) (_swigobj->AddChild(_swigarg0)) +static PyObject *_wrap_wxWindow_AddChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_AddChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_AddChild. Expected _wxWindow_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 wxWindow_AddChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_AddChild(_arg0,_arg1); + + 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; @@ -4668,6 +4823,7 @@ static PyObject *_wrap_wxWindow_SetClientSize(PyObject *self, PyObject *args, Py #define wxWindow_SetCursor(_swigobj,_swigarg0) (_swigobj->SetCursor(_swigarg0)) static PyObject *_wrap_wxWindow_SetCursor(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + bool _result; wxWindow * _arg0; wxCursor * _arg1; PyObject * _argo0 = 0; @@ -4693,12 +4849,47 @@ static PyObject *_wrap_wxWindow_SetCursor(PyObject *self, PyObject *args, PyObje } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxWindow_SetCursor(_arg0,*_arg1); + _result = (bool )wxWindow_SetCursor(_arg0,*_arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_GetCursor(_swigobj) (_swigobj->GetCursor()) +static PyObject *_wrap_wxWindow_GetCursor(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCursor * _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetCursor",_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_GetCursor. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxCursor & _result_ref = wxWindow_GetCursor(_arg0); + _result = (wxCursor *) &_result_ref; + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxCursor_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } @@ -11253,6 +11444,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_SetTitle", (PyCFunction) _wrap_wxWindow_SetTitle, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetExtraStyle", (PyCFunction) _wrap_wxWindow_SetExtraStyle, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetEventHandler", (PyCFunction) _wrap_wxWindow_SetEventHandler, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_GetCursor", (PyCFunction) _wrap_wxWindow_GetCursor, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetCursor", (PyCFunction) _wrap_wxWindow_SetCursor, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetClientSize", (PyCFunction) _wrap_wxWindow_SetClientSize, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetClientSizeWH", (PyCFunction) _wrap_wxWindow_SetClientSizeWH, METH_VARARGS | METH_KEYWORDS }, @@ -11285,6 +11477,7 @@ 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_AddChild", (PyCFunction) _wrap_wxWindow_AddChild, 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 }, @@ -11385,6 +11578,9 @@ static PyMethodDef windowscMethods[] = { { "wxEvtHandler_AddPendingEvent", (PyCFunction) _wrap_wxEvtHandler_AddPendingEvent, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_ProcessEvent", (PyCFunction) _wrap_wxEvtHandler_ProcessEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxEvtHandler", (PyCFunction) _wrap_new_wxEvtHandler, METH_VARARGS | METH_KEYWORDS }, + { "wxFindWindowByLabel", (PyCFunction) _wrap_wxFindWindowByLabel, METH_VARARGS | METH_KEYWORDS }, + { "wxFindWindowByName", (PyCFunction) _wrap_wxFindWindowByName, METH_VARARGS | METH_KEYWORDS }, + { "wxFindWindowById", (PyCFunction) _wrap_wxFindWindowById, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; #ifdef __cplusplus diff --git a/wxPython/src/mac/windows.py b/wxPython/src/mac/windows.py index 1803ef9da0..1e1bc569d3 100644 --- a/wxPython/src/mac/windows.py +++ b/wxPython/src/mac/windows.py @@ -362,6 +362,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def RefreshRect(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_RefreshRect,(self,) + _args, _kwargs) return val + def AddChild(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_AddChild,(self,) + _args, _kwargs) + return val def RemoveChild(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_RemoveChild,(self,) + _args, _kwargs) return val @@ -460,6 +463,10 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetCursor(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetCursor,(self,) + _args, _kwargs) return val + def GetCursor(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_GetCursor,(self,) + _args, _kwargs) + if val: val = wxCursorPtr(val) + return val def SetEventHandler(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetEventHandler,(self,) + _args, _kwargs) return val @@ -1105,6 +1112,18 @@ class wxMenuItem(wxMenuItemPtr): #-------------- FUNCTION WRAPPERS ------------------ +def wxFindWindowById(*_args, **_kwargs): + val = apply(windowsc.wxFindWindowById,_args,_kwargs) + return val + +def wxFindWindowByName(*_args, **_kwargs): + val = apply(windowsc.wxFindWindowByName,_args,_kwargs) + return val + +def wxFindWindowByLabel(*_args, **_kwargs): + val = apply(windowsc.wxFindWindowByLabel,_args,_kwargs) + return val + wxValidator_IsSilent = windowsc.wxValidator_IsSilent wxValidator_SetBellOnError = windowsc.wxValidator_SetBellOnError diff --git a/wxPython/src/mac/wx.cpp b/wxPython/src/mac/wx.cpp index 4e95ce99d1..be6c9b9b77 100644 --- a/wxPython/src/mac/wx.cpp +++ b/wxPython/src/mac/wx.cpp @@ -1942,8 +1942,13 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxSB_VERTICAL", PyInt_FromLong((long) wxSB_VERTICAL)); PyDict_SetItemString(d,"wxST_SIZEGRIP", PyInt_FromLong((long) wxST_SIZEGRIP)); PyDict_SetItemString(d,"wxST_NO_AUTORESIZE", PyInt_FromLong((long) wxST_NO_AUTORESIZE)); - PyDict_SetItemString(d,"wxBU_AUTODRAW", PyInt_FromLong((long) wxBU_AUTODRAW)); PyDict_SetItemString(d,"wxBU_NOAUTODRAW", PyInt_FromLong((long) wxBU_NOAUTODRAW)); + PyDict_SetItemString(d,"wxBU_AUTODRAW", PyInt_FromLong((long) wxBU_AUTODRAW)); + PyDict_SetItemString(d,"wxBU_LEFT", PyInt_FromLong((long) wxBU_LEFT)); + PyDict_SetItemString(d,"wxBU_TOP", PyInt_FromLong((long) wxBU_TOP)); + PyDict_SetItemString(d,"wxBU_RIGHT", PyInt_FromLong((long) wxBU_RIGHT)); + PyDict_SetItemString(d,"wxBU_BOTTOM", PyInt_FromLong((long) wxBU_BOTTOM)); + PyDict_SetItemString(d,"wxBU_EXACTFIT", PyInt_FromLong((long) wxBU_EXACTFIT)); PyDict_SetItemString(d,"wxSP_VERTICAL", PyInt_FromLong((long) wxSP_VERTICAL)); PyDict_SetItemString(d,"wxSP_HORIZONTAL", PyInt_FromLong((long) wxSP_HORIZONTAL)); PyDict_SetItemString(d,"wxSP_ARROW_KEYS", PyInt_FromLong((long) wxSP_ARROW_KEYS)); @@ -2487,6 +2492,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_NC_LEFT_DCLICK", PyInt_FromLong((long) wxEVT_NC_LEFT_DCLICK)); PyDict_SetItemString(d,"wxEVT_NC_MIDDLE_DCLICK", PyInt_FromLong((long) wxEVT_NC_MIDDLE_DCLICK)); PyDict_SetItemString(d,"wxEVT_NC_RIGHT_DCLICK", PyInt_FromLong((long) wxEVT_NC_RIGHT_DCLICK)); + PyDict_SetItemString(d,"wxEVT_SET_CURSOR", PyInt_FromLong((long) wxEVT_SET_CURSOR)); PyDict_SetItemString(d,"wxEVT_CHAR", PyInt_FromLong((long) wxEVT_CHAR)); PyDict_SetItemString(d,"wxEVT_KEY_DOWN", PyInt_FromLong((long) wxEVT_KEY_DOWN)); PyDict_SetItemString(d,"wxEVT_KEY_UP", PyInt_FromLong((long) wxEVT_KEY_UP)); diff --git a/wxPython/src/mac/wx.py b/wxPython/src/mac/wx.py index b1a9333931..f1bb17fd52 100644 --- a/wxPython/src/mac/wx.py +++ b/wxPython/src/mac/wx.py @@ -282,8 +282,13 @@ wxSB_HORIZONTAL = wxc.wxSB_HORIZONTAL wxSB_VERTICAL = wxc.wxSB_VERTICAL wxST_SIZEGRIP = wxc.wxST_SIZEGRIP wxST_NO_AUTORESIZE = wxc.wxST_NO_AUTORESIZE -wxBU_AUTODRAW = wxc.wxBU_AUTODRAW wxBU_NOAUTODRAW = wxc.wxBU_NOAUTODRAW +wxBU_AUTODRAW = wxc.wxBU_AUTODRAW +wxBU_LEFT = wxc.wxBU_LEFT +wxBU_TOP = wxc.wxBU_TOP +wxBU_RIGHT = wxc.wxBU_RIGHT +wxBU_BOTTOM = wxc.wxBU_BOTTOM +wxBU_EXACTFIT = wxc.wxBU_EXACTFIT wxSP_VERTICAL = wxc.wxSP_VERTICAL wxSP_HORIZONTAL = wxc.wxSP_HORIZONTAL wxSP_ARROW_KEYS = wxc.wxSP_ARROW_KEYS @@ -827,6 +832,7 @@ wxEVT_NC_LEAVE_WINDOW = wxc.wxEVT_NC_LEAVE_WINDOW wxEVT_NC_LEFT_DCLICK = wxc.wxEVT_NC_LEFT_DCLICK wxEVT_NC_MIDDLE_DCLICK = wxc.wxEVT_NC_MIDDLE_DCLICK wxEVT_NC_RIGHT_DCLICK = wxc.wxEVT_NC_RIGHT_DCLICK +wxEVT_SET_CURSOR = wxc.wxEVT_SET_CURSOR wxEVT_CHAR = wxc.wxEVT_CHAR wxEVT_KEY_DOWN = wxc.wxEVT_KEY_DOWN wxEVT_KEY_UP = wxc.wxEVT_KEY_UP @@ -1034,6 +1040,9 @@ def EVT_WINDOW_CREATE(win, func): def EVT_WINDOW_DESTROY(win, func): win.Connect(-1, -1, wxEVT_DESTROY, func) +def EVT_SET_CURSOR(win, func): + win.Connect(-1, -1, wxEVT_SET_CURSOR, func) + def EVT_IDLE(win, func): -- 2.45.2