From aaad759f90972578f8c8bfbf3218f496e0f8c547 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 14 Aug 2002 23:26:42 +0000 Subject: [PATCH] Allow AddWindow and RemoveWindow to be overridden in classes derived in Python git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/helpers.h | 24 ++++ wxPython/src/msw/windows2.cpp | 246 ++++++++++++++++++++++++++++++++++ wxPython/src/msw/windows2.py | 18 +++ wxPython/src/windows2.i | 29 +++- 4 files changed, 315 insertions(+), 2 deletions(-) diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index acc450dce6..e0cb056cf7 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -1315,6 +1315,30 @@ void wxPyCBH_delete(wxPyCallbackHelper* cbh); //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_VOID_WXWINBASE(CBNAME) \ + void CBNAME(wxWindowBase* a); \ + void base_##CBNAME(wxWindowBase* a); + + +#define IMP_PYCALLBACK_VOID_WXWINBASE(CLASS, PCLASS, CBNAME) \ + void CLASS::CBNAME(wxWindowBase* a) { \ + bool found; \ + wxPyBeginBlockThreads(); \ + if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \ + PyObject* obj = wxPyMake_wxObject(a); \ + wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \ + Py_DECREF(obj); \ + } \ + wxPyEndBlockThreads(); \ + if (! found) \ + PCLASS::CBNAME(a); \ + } \ + void CLASS::base_##CBNAME(wxWindowBase* a) { \ + PCLASS::CBNAME(a); \ + } + +//--------------------------------------------------------------------------- + #define DEC_PYCALLBACK_BOOL_(CBNAME) \ bool CBNAME(); \ bool base_##CBNAME(); diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index 779f3fe1c3..cdfe069380 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -136,6 +136,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -162,6 +165,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, RemoveChild); + // C++ version of Python aware wxControl class wxPyControl : public wxControl { @@ -198,6 +204,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -224,6 +233,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild); + // C++ version of Python aware wxPanel class wxPyPanel : public wxPanel { @@ -259,6 +271,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -285,6 +300,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, RemoveChild); + #ifdef __cplusplus extern "C" { #endif @@ -3326,6 +3344,80 @@ static PyObject *_wrap_wxPyWindow_base_GetMaxSize(PyObject *self, PyObject *args return _resultobj; } +#define wxPyWindow_base_AddChild(_swigobj,_swigarg0) (_swigobj->base_AddChild(_swigarg0)) +static PyObject *_wrap_wxPyWindow_base_AddChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyWindow * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyWindow_base_AddChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyWindow_base_AddChild. Expected _wxPyWindow_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 wxPyWindow_base_AddChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyWindow_base_AddChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxPyWindow_base_RemoveChild(_swigobj,_swigarg0) (_swigobj->base_RemoveChild(_swigarg0)) +static PyObject *_wrap_wxPyWindow_base_RemoveChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyWindow * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyWindow_base_RemoveChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyWindow_base_RemoveChild. Expected _wxPyWindow_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 wxPyWindow_base_RemoveChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyWindow_base_RemoveChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxPyControlTowxControl(void *ptr) { wxPyControl *src; wxControl *dest; @@ -3999,6 +4091,80 @@ static PyObject *_wrap_wxPyControl_base_GetMaxSize(PyObject *self, PyObject *arg return _resultobj; } +#define wxPyControl_base_AddChild(_swigobj,_swigarg0) (_swigobj->base_AddChild(_swigarg0)) +static PyObject *_wrap_wxPyControl_base_AddChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyControl * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyControl_base_AddChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyControl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyControl_base_AddChild. Expected _wxPyControl_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 wxPyControl_base_AddChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyControl_base_AddChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxPyControl_base_RemoveChild(_swigobj,_swigarg0) (_swigobj->base_RemoveChild(_swigarg0)) +static PyObject *_wrap_wxPyControl_base_RemoveChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyControl * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyControl_base_RemoveChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyControl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyControl_base_RemoveChild. Expected _wxPyControl_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 wxPyControl_base_RemoveChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyControl_base_RemoveChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxPyPanelTowxPanel(void *ptr) { wxPyPanel *src; wxPanel *dest; @@ -4663,7 +4829,83 @@ static PyObject *_wrap_wxPyPanel_base_GetMaxSize(PyObject *self, PyObject *args, return _resultobj; } +#define wxPyPanel_base_AddChild(_swigobj,_swigarg0) (_swigobj->base_AddChild(_swigarg0)) +static PyObject *_wrap_wxPyPanel_base_AddChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyPanel * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyPanel_base_AddChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyPanel_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyPanel_base_AddChild. Expected _wxPyPanel_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 wxPyPanel_base_AddChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyPanel_base_AddChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxPyPanel_base_RemoveChild(_swigobj,_swigarg0) (_swigobj->base_RemoveChild(_swigarg0)) +static PyObject *_wrap_wxPyPanel_base_RemoveChild(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyPanel * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","child", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyPanel_base_RemoveChild",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyPanel_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyPanel_base_RemoveChild. Expected _wxPyPanel_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 wxPyPanel_base_RemoveChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxPyPanel_base_RemoveChild(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static PyMethodDef windows2cMethods[] = { + { "wxPyPanel_base_RemoveChild", (PyCFunction) _wrap_wxPyPanel_base_RemoveChild, METH_VARARGS | METH_KEYWORDS }, + { "wxPyPanel_base_AddChild", (PyCFunction) _wrap_wxPyPanel_base_AddChild, METH_VARARGS | METH_KEYWORDS }, { "wxPyPanel_base_GetMaxSize", (PyCFunction) _wrap_wxPyPanel_base_GetMaxSize, METH_VARARGS | METH_KEYWORDS }, { "wxPyPanel_base_AcceptsFocusFromKeyboard", (PyCFunction) _wrap_wxPyPanel_base_AcceptsFocusFromKeyboard, METH_VARARGS | METH_KEYWORDS }, { "wxPyPanel_base_AcceptsFocus", (PyCFunction) _wrap_wxPyPanel_base_AcceptsFocus, METH_VARARGS | METH_KEYWORDS }, @@ -4682,6 +4924,8 @@ static PyMethodDef windows2cMethods[] = { { "wxPyPanel_base_DoMoveWindow", (PyCFunction) _wrap_wxPyPanel_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS }, { "wxPyPanel__setCallbackInfo", (PyCFunction) _wrap_wxPyPanel__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyPanel", (PyCFunction) _wrap_new_wxPyPanel, METH_VARARGS | METH_KEYWORDS }, + { "wxPyControl_base_RemoveChild", (PyCFunction) _wrap_wxPyControl_base_RemoveChild, METH_VARARGS | METH_KEYWORDS }, + { "wxPyControl_base_AddChild", (PyCFunction) _wrap_wxPyControl_base_AddChild, METH_VARARGS | METH_KEYWORDS }, { "wxPyControl_base_GetMaxSize", (PyCFunction) _wrap_wxPyControl_base_GetMaxSize, METH_VARARGS | METH_KEYWORDS }, { "wxPyControl_base_AcceptsFocusFromKeyboard", (PyCFunction) _wrap_wxPyControl_base_AcceptsFocusFromKeyboard, METH_VARARGS | METH_KEYWORDS }, { "wxPyControl_base_AcceptsFocus", (PyCFunction) _wrap_wxPyControl_base_AcceptsFocus, METH_VARARGS | METH_KEYWORDS }, @@ -4700,6 +4944,8 @@ static PyMethodDef windows2cMethods[] = { { "wxPyControl_base_DoMoveWindow", (PyCFunction) _wrap_wxPyControl_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS }, { "wxPyControl__setCallbackInfo", (PyCFunction) _wrap_wxPyControl__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyControl", (PyCFunction) _wrap_new_wxPyControl, METH_VARARGS | METH_KEYWORDS }, + { "wxPyWindow_base_RemoveChild", (PyCFunction) _wrap_wxPyWindow_base_RemoveChild, METH_VARARGS | METH_KEYWORDS }, + { "wxPyWindow_base_AddChild", (PyCFunction) _wrap_wxPyWindow_base_AddChild, METH_VARARGS | METH_KEYWORDS }, { "wxPyWindow_base_GetMaxSize", (PyCFunction) _wrap_wxPyWindow_base_GetMaxSize, METH_VARARGS | METH_KEYWORDS }, { "wxPyWindow_base_AcceptsFocusFromKeyboard", (PyCFunction) _wrap_wxPyWindow_base_AcceptsFocusFromKeyboard, METH_VARARGS | METH_KEYWORDS }, { "wxPyWindow_base_AcceptsFocus", (PyCFunction) _wrap_wxPyWindow_base_AcceptsFocus, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index f985011582..1956c91f0e 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -342,6 +342,12 @@ class wxPyWindowPtr(wxWindowPtr): val = apply(windows2c.wxPyWindow_base_GetMaxSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 return val + def base_AddChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyWindow_base_AddChild,(self,) + _args, _kwargs) + return val + def base_RemoveChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyWindow_base_RemoveChild,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxPyWindow(wxPyWindowPtr): @@ -412,6 +418,12 @@ class wxPyControlPtr(wxControlPtr): val = apply(windows2c.wxPyControl_base_GetMaxSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 return val + def base_AddChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyControl_base_AddChild,(self,) + _args, _kwargs) + return val + def base_RemoveChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyControl_base_RemoveChild,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxPyControl(wxPyControlPtr): @@ -482,6 +494,12 @@ class wxPyPanelPtr(wxPanelPtr): val = apply(windows2c.wxPyPanel_base_GetMaxSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 return val + def base_AddChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyPanel_base_AddChild,(self,) + _args, _kwargs) + return val + def base_RemoveChild(self, *_args, **_kwargs): + val = apply(windows2c.wxPyPanel_base_RemoveChild,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxPyPanel(wxPyPanelPtr): diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index 39b3ceaac9..2e6872bccf 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -306,7 +306,6 @@ public: // the virtual methods in Python derived classes. // Which (any?) of these should be done also??? -// AddChild // Destroy // DoCaptureMouse // DoClientToScreen @@ -323,7 +322,6 @@ public: // GetClientAreaOrigin // GetDefaultItem // IsTopLevel -// RemoveChild // SetBackgroundColour // SetDefaultItem // SetFocus @@ -369,6 +367,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -395,6 +396,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, RemoveChild); + %} // And now the one for SWIG to see @@ -433,6 +437,9 @@ public: bool base_AcceptsFocus() const; bool base_AcceptsFocusFromKeyboard() const; wxSize base_GetMaxSize() const; + + void base_AddChild(wxWindow* child); + void base_RemoveChild(wxWindow* child); } //--------------------------------------------------------------------------- @@ -475,6 +482,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -501,6 +511,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild); + %} // And now the one for SWIG to see @@ -540,6 +553,9 @@ public: bool base_AcceptsFocus() const; bool base_AcceptsFocusFromKeyboard() const; wxSize base_GetMaxSize() const; + + void base_AddChild(wxWindow* child); + void base_RemoveChild(wxWindow* child); } //--------------------------------------------------------------------------- @@ -580,6 +596,9 @@ public: DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); DEC_PYCALLBACK_SIZE_const(GetMaxSize); + DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); + DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); + PYPRIVATE; }; @@ -606,6 +625,9 @@ IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocus); IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocusFromKeyboard); IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, GetMaxSize); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, AddChild); +IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, RemoveChild); + %} // And now the one for SWIG to see @@ -644,6 +666,9 @@ public: bool base_AcceptsFocus() const; bool base_AcceptsFocusFromKeyboard() const; wxSize base_GetMaxSize() const; + + void base_AddChild(wxWindow* child); + void base_RemoveChild(wxWindow* child); } -- 2.45.2