From 2a74d1415bbea79a35a56c7a48d8e8a5edd54a8c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Apr 2002 21:45:07 +0000 Subject: [PATCH] Changes to match CVS updates over the weekend. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/misc2.i | 2 + wxPython/src/msw/misc2.cpp | 28 +++ wxPython/src/msw/misc2.py | 4 + wxPython/src/msw/sizers.cpp | 76 ++++++++ wxPython/src/msw/sizers.py | 6 + wxPython/src/msw/utils.cpp | 2 +- wxPython/src/msw/windows.cpp | 337 +++++++++++++++++++++++++++++------ wxPython/src/msw/windows.py | 28 ++- wxPython/src/sizers.i | 3 + wxPython/src/utils.i | 2 +- wxPython/src/windows.i | 20 ++- 11 files changed, 449 insertions(+), 59 deletions(-) diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index eb1c5a8eb0..c8049586dd 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -176,6 +176,8 @@ bool wxCheckForInterrupt(wxWindow *wnd); void wxFlushEvents(); #endif +wxWindow* wxGetTopLevelParent(wxWindow *win); + //--------------------------------------------------------------------------- // Resource System diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index 99f178ec4f..38b1447448 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -1513,6 +1513,33 @@ static PyObject *_wrap_wxFlushEvents(PyObject *self, PyObject *args, PyObject *k return _resultobj; } +static PyObject *_wrap_wxGetTopLevelParent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "win", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGetTopLevelParent",_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 wxGetTopLevelParent. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = (wxWindow *)wxGetTopLevelParent(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + static PyObject *_wrap_wxResourceAddIdentifier(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; @@ -10102,6 +10129,7 @@ static PyMethodDef misc2cMethods[] = { { "wxResourceCreateBitmap", (PyCFunction) _wrap_wxResourceCreateBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxResourceClear", (PyCFunction) _wrap_wxResourceClear, METH_VARARGS | METH_KEYWORDS }, { "wxResourceAddIdentifier", (PyCFunction) _wrap_wxResourceAddIdentifier, METH_VARARGS | METH_KEYWORDS }, + { "wxGetTopLevelParent", (PyCFunction) _wrap_wxGetTopLevelParent, METH_VARARGS | METH_KEYWORDS }, { "wxFlushEvents", (PyCFunction) _wrap_wxFlushEvents, METH_VARARGS | METH_KEYWORDS }, { "wxCheckForInterrupt", (PyCFunction) _wrap_wxCheckForInterrupt, METH_VARARGS | METH_KEYWORDS }, { "wxFindWindowAtPoint", (PyCFunction) _wrap_wxFindWindowAtPoint, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index f977710cd5..39518f1b03 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -1032,6 +1032,10 @@ wxCheckForInterrupt = misc2c.wxCheckForInterrupt wxFlushEvents = misc2c.wxFlushEvents +def wxGetTopLevelParent(*_args, **_kwargs): + val = apply(misc2c.wxGetTopLevelParent,_args,_kwargs) + return val + wxResourceAddIdentifier = misc2c.wxResourceAddIdentifier wxResourceClear = misc2c.wxResourceClear diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index bc740b04cf..b1ea826320 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -1789,6 +1789,43 @@ static PyObject *_wrap_wxSizer_Fit(PyObject *self, PyObject *args, PyObject *kwa return _resultobj; } +#define wxSizer_FitInside(_swigobj,_swigarg0) (_swigobj->FitInside(_swigarg0)) +static PyObject *_wrap_wxSizer_FitInside(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSizer * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","window", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxSizer_FitInside",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSizer_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSizer_FitInside. Expected _wxSizer_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 wxSizer_FitInside. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxSizer_FitInside(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxSizer_SetSizeHints(_swigobj,_swigarg0) (_swigobj->SetSizeHints(_swigarg0)) static PyObject *_wrap_wxSizer_SetSizeHints(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1826,6 +1863,43 @@ static PyObject *_wrap_wxSizer_SetSizeHints(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define wxSizer_SetVirtualSizeHints(_swigobj,_swigarg0) (_swigobj->SetVirtualSizeHints(_swigarg0)) +static PyObject *_wrap_wxSizer_SetVirtualSizeHints(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSizer * _arg0; + wxWindow * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","window", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxSizer_SetVirtualSizeHints",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxSizer_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSizer_SetVirtualSizeHints. Expected _wxSizer_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 wxSizer_SetVirtualSizeHints. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxSizer_SetVirtualSizeHints(_arg0,_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxSizer_Clear(_swigobj,_swigarg0) (_swigobj->Clear(_swigarg0)) static PyObject *_wrap_wxSizer_Clear(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3006,7 +3080,9 @@ static PyMethodDef sizerscMethods[] = { { "wxSizer_GetChildren", (PyCFunction) _wrap_wxSizer_GetChildren, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_DeleteWindows", (PyCFunction) _wrap_wxSizer_DeleteWindows, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_Clear", (PyCFunction) _wrap_wxSizer_Clear, METH_VARARGS | METH_KEYWORDS }, + { "wxSizer_SetVirtualSizeHints", (PyCFunction) _wrap_wxSizer_SetVirtualSizeHints, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_SetSizeHints", (PyCFunction) _wrap_wxSizer_SetSizeHints, METH_VARARGS | METH_KEYWORDS }, + { "wxSizer_FitInside", (PyCFunction) _wrap_wxSizer_FitInside, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_Fit", (PyCFunction) _wrap_wxSizer_Fit, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_Layout", (PyCFunction) _wrap_wxSizer_Layout, METH_VARARGS | METH_KEYWORDS }, { "wxSizer_GetMinSize", (PyCFunction) _wrap_wxSizer_GetMinSize, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/sizers.py b/wxPython/src/msw/sizers.py index 5ec6b397d9..f3f88dd460 100644 --- a/wxPython/src/msw/sizers.py +++ b/wxPython/src/msw/sizers.py @@ -183,9 +183,15 @@ class wxSizerPtr(wxObjectPtr): def Fit(self, *_args, **_kwargs): val = apply(sizersc.wxSizer_Fit,(self,) + _args, _kwargs) return val + def FitInside(self, *_args, **_kwargs): + val = apply(sizersc.wxSizer_FitInside,(self,) + _args, _kwargs) + return val def SetSizeHints(self, *_args, **_kwargs): val = apply(sizersc.wxSizer_SetSizeHints,(self,) + _args, _kwargs) return val + def SetVirtualSizeHints(self, *_args, **_kwargs): + val = apply(sizersc.wxSizer_SetVirtualSizeHints,(self,) + _args, _kwargs) + return val def Clear(self, *_args, **_kwargs): val = apply(sizersc.wxSizer_Clear,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index 657cefed9c..b6a5ed4945 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -61,7 +61,7 @@ extern PyObject *SWIG_newvarlink(void); #include // Put some wx default wxChar* values into wxStrings. - DECLARE_DEF_STRING2(DateFormatStr, wxT("sashWindow")); + DECLARE_DEF_STRING2(DateFormatStr, wxT("%c")); static const wxString wxPyEmptyString(wxT("")); diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 74e174776d..b374af6227 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -4034,6 +4034,34 @@ static PyObject *_wrap_wxWindow_SetFocus(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define wxWindow_SetFocusFromKbd(_swigobj) (_swigobj->SetFocusFromKbd()) +static PyObject *_wrap_wxWindow_SetFocusFromKbd(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_SetFocusFromKbd",_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_SetFocusFromKbd. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_SetFocusFromKbd(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_AcceptsFocus(_swigobj) (_swigobj->AcceptsFocus()) static PyObject *_wrap_wxWindow_AcceptsFocus(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4422,8 +4450,8 @@ static PyObject *_wrap_wxWindow_SetRect(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_wxWindow_SetSizeHints(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxWindow * _arg0; - int _arg1 = (int ) -1; - int _arg2 = (int ) -1; + int _arg1; + int _arg2; int _arg3 = (int ) -1; int _arg4 = (int ) -1; int _arg5 = (int ) -1; @@ -4432,7 +4460,7 @@ static PyObject *_wrap_wxWindow_SetSizeHints(PyObject *self, PyObject *args, PyO char *_kwnames[] = { "self","minW","minH","maxW","maxH","incW","incH", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iiiiii:wxWindow_SetSizeHints",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii|iiii:wxWindow_SetSizeHints",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4,&_arg5,&_arg6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -4452,6 +4480,182 @@ static PyObject *_wrap_wxWindow_SetSizeHints(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxWindow_SetVirtualSizeHints(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->SetVirtualSizeHints(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxWindow_SetVirtualSizeHints(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + int _arg1; + int _arg2; + int _arg3 = (int ) -1; + int _arg4 = (int ) -1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","minW","minH","maxW","maxH", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii|ii:wxWindow_SetVirtualSizeHints",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3,&_arg4)) + 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_SetVirtualSizeHints. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_SetVirtualSizeHints(_arg0,_arg1,_arg2,_arg3,_arg4); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_SetVirtualSize(_swigobj,_swigarg0) (_swigobj->SetVirtualSize(_swigarg0)) +static PyObject *_wrap_wxWindow_SetVirtualSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + wxSize * _arg1; + PyObject * _argo0 = 0; + wxSize temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","size", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetVirtualSize",_kwnames,&_argo0,&_obj1)) + 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_SetVirtualSize. Expected _wxWindow_p."); + return NULL; + } + } +{ + _arg1 = &temp; + if (! wxSize_helper(_obj1, &_arg1)) + return NULL; +} +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_SetVirtualSize(_arg0,*_arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_SetVirtualSizeWH(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetVirtualSize(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxWindow_SetVirtualSizeWH(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_SetVirtualSizeWH",_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_SetVirtualSizeWH. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_SetVirtualSizeWH(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_GetVirtualSize(_swigobj) (_swigobj->GetVirtualSize()) +static PyObject *_wrap_wxWindow_GetVirtualSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSize * _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetVirtualSize",_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_GetVirtualSize. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + _result = new wxSize (wxWindow_GetVirtualSize(_arg0)); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + +#define wxWindow_GetVirtualSizeTuple(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetVirtualSize(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxWindow_GetVirtualSizeTuple(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + int * _arg1; + int temp; + int * _arg2; + int temp0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; +{ + _arg1 = &temp; +} +{ + _arg2 = &temp0; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetVirtualSizeTuple",_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_GetVirtualSizeTuple. Expected _wxWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_GetVirtualSizeTuple(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg1)); + _resultobj = t_output_helper(_resultobj, o); +} +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} + return _resultobj; +} + #define wxWindow_SetClientSizeWH(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetClientSize(_swigarg0,_swigarg1)) static PyObject *_wrap_wxWindow_SetClientSizeWH(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -5099,6 +5303,46 @@ static PyObject *_wrap_wxWindow_SetSizer(PyObject *self, PyObject *args, PyObjec return _resultobj; } +#define wxWindow_SetSizerAndFit(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetSizerAndFit(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxWindow_SetSizerAndFit(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + wxSizer * _arg1; + bool _arg2 = (bool ) TRUE; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + int tempbool2 = (int) TRUE; + char *_kwnames[] = { "self","sizer","deleteOld", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxWindow_SetSizerAndFit",_kwnames,&_argo0,&_argo1,&tempbool2)) + 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_SetSizerAndFit. Expected _wxWindow_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxSizer_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetSizerAndFit. Expected _wxSizer_p."); + return NULL; + } + } + _arg2 = (bool ) tempbool2; +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxWindow_SetSizerAndFit(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_GetSizer(_swigobj) (_swigobj->GetSizer()) static PyObject *_wrap_wxWindow_GetSizer(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -6757,54 +7001,6 @@ static PyObject *_wrap_wxScrolledWindow_GetTargetWindow(PyObject *self, PyObject return _resultobj; } -#define wxScrolledWindow_GetVirtualSize(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetVirtualSize(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxScrolledWindow_GetVirtualSize(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxScrolledWindow * _arg0; - int * _arg1; - int temp; - int * _arg2; - int temp0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; -{ - _arg1 = &temp; -} -{ - _arg2 = &temp0; -} - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_GetVirtualSize",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_GetVirtualSize. Expected _wxScrolledWindow_p."); - return NULL; - } - } -{ - PyThreadState* __tstate = wxPyBeginAllowThreads(); - wxScrolledWindow_GetVirtualSize(_arg0,_arg1,_arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; -{ - PyObject *o; - o = PyInt_FromLong((long) (*_arg1)); - _resultobj = t_output_helper(_resultobj, o); -} -{ - PyObject *o; - o = PyInt_FromLong((long) (*_arg2)); - _resultobj = t_output_helper(_resultobj, o); -} - return _resultobj; -} - #define wxScrolledWindow_IsRetained(_swigobj) (_swigobj->IsRetained()) static PyObject *_wrap_wxScrolledWindow_IsRetained(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7368,6 +7564,36 @@ static PyObject *_wrap_wxScrolledWindow_Layout(PyObject *self, PyObject *args, P return _resultobj; } +#define wxScrolledWindow_SetScrollRate(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetScrollRate(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxScrolledWindow_SetScrollRate(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrolledWindow * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","xstep","ystep", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_SetScrollRate",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxScrolledWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxScrolledWindow_SetScrollRate. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxScrolledWindow_SetScrollRate(_arg0,_arg1,_arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxMenuTowxEvtHandler(void *ptr) { wxMenu *src; wxEvtHandler *dest; @@ -11460,6 +11686,7 @@ static PyMethodDef windowscMethods[] = { { "wxMenu_AppendMenu", (PyCFunction) _wrap_wxMenu_AppendMenu, METH_VARARGS | METH_KEYWORDS }, { "wxMenu_Append", (PyCFunction) _wrap_wxMenu_Append, METH_VARARGS | METH_KEYWORDS }, { "new_wxMenu", (PyCFunction) _wrap_new_wxMenu, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_SetScrollRate", (PyCFunction) _wrap_wxScrolledWindow_SetScrollRate, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_Layout", (PyCFunction) _wrap_wxScrolledWindow_Layout, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_AdjustScrollbars", (PyCFunction) _wrap_wxScrolledWindow_AdjustScrollbars, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetScaleY", (PyCFunction) _wrap_wxScrolledWindow_GetScaleY, METH_VARARGS | METH_KEYWORDS }, @@ -11476,7 +11703,6 @@ static PyMethodDef windowscMethods[] = { { "wxScrolledWindow_Scroll", (PyCFunction) _wrap_wxScrolledWindow_Scroll, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_PrepareDC", (PyCFunction) _wrap_wxScrolledWindow_PrepareDC, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_IsRetained", (PyCFunction) _wrap_wxScrolledWindow_IsRetained, METH_VARARGS | METH_KEYWORDS }, - { "wxScrolledWindow_GetVirtualSize", (PyCFunction) _wrap_wxScrolledWindow_GetVirtualSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetTargetWindow", (PyCFunction) _wrap_wxScrolledWindow_GetTargetWindow, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetScrollPixelsPerUnit", (PyCFunction) _wrap_wxScrolledWindow_GetScrollPixelsPerUnit, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_GetScrollPageSize", (PyCFunction) _wrap_wxScrolledWindow_GetScrollPageSize, METH_VARARGS | METH_KEYWORDS }, @@ -11525,6 +11751,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_GetContainingSizer", (PyCFunction) _wrap_wxWindow_GetContainingSizer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetContainingSizer", (PyCFunction) _wrap_wxWindow_SetContainingSizer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetSizer", (PyCFunction) _wrap_wxWindow_GetSizer, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetSizerAndFit", (PyCFunction) _wrap_wxWindow_SetSizerAndFit, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetSizer", (PyCFunction) _wrap_wxWindow_SetSizer, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetToolTip", (PyCFunction) _wrap_wxWindow_GetToolTip, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetToolTip", (PyCFunction) _wrap_wxWindow_SetToolTip, METH_VARARGS | METH_KEYWORDS }, @@ -11546,6 +11773,11 @@ static PyMethodDef windowscMethods[] = { { "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 }, + { "wxWindow_GetVirtualSizeTuple", (PyCFunction) _wrap_wxWindow_GetVirtualSizeTuple, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_GetVirtualSize", (PyCFunction) _wrap_wxWindow_GetVirtualSize, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetVirtualSizeWH", (PyCFunction) _wrap_wxWindow_SetVirtualSizeWH, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetVirtualSize", (PyCFunction) _wrap_wxWindow_SetVirtualSize, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetVirtualSizeHints", (PyCFunction) _wrap_wxWindow_SetVirtualSizeHints, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetSizeHints", (PyCFunction) _wrap_wxWindow_SetSizeHints, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetRect", (PyCFunction) _wrap_wxWindow_SetRect, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetPosition", (PyCFunction) _wrap_wxWindow_SetPosition, METH_VARARGS | METH_KEYWORDS }, @@ -11558,6 +11790,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_SetForegroundColour", (PyCFunction) _wrap_wxWindow_SetForegroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetFont", (PyCFunction) _wrap_wxWindow_SetFont, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_AcceptsFocus", (PyCFunction) _wrap_wxWindow_AcceptsFocus, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetFocusFromKbd", (PyCFunction) _wrap_wxWindow_SetFocusFromKbd, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetFocus", (PyCFunction) _wrap_wxWindow_SetFocus, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_UnsetConstraints", (PyCFunction) _wrap_wxWindow_UnsetConstraints, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetConstraints", (PyCFunction) _wrap_wxWindow_SetConstraints, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 2cce494709..d3bba2d6d4 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -399,6 +399,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetFocus(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetFocus,(self,) + _args, _kwargs) return val + def SetFocusFromKbd(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetFocusFromKbd,(self,) + _args, _kwargs) + return val def AcceptsFocus(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_AcceptsFocus,(self,) + _args, _kwargs) return val @@ -435,6 +438,22 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetSizeHints(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetSizeHints,(self,) + _args, _kwargs) return val + def SetVirtualSizeHints(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetVirtualSizeHints,(self,) + _args, _kwargs) + return val + def SetVirtualSize(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetVirtualSize,(self,) + _args, _kwargs) + return val + def SetVirtualSizeWH(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetVirtualSizeWH,(self,) + _args, _kwargs) + return val + def GetVirtualSize(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_GetVirtualSize,(self,) + _args, _kwargs) + if val: val = wxSizePtr(val) ; val.thisown = 1 + return val + def GetVirtualSizeTuple(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_GetVirtualSizeTuple,(self,) + _args, _kwargs) + return val def SetClientSizeWH(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetClientSizeWH,(self,) + _args, _kwargs) return val @@ -504,6 +523,9 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetSizer(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetSizer,(self,) + _args, _kwargs) return val + def SetSizerAndFit(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetSizerAndFit,(self,) + _args, _kwargs) + return val def GetSizer(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs) return val @@ -676,9 +698,6 @@ class wxScrolledWindowPtr(wxPanelPtr): def GetTargetWindow(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetTargetWindow,(self,) + _args, _kwargs) return val - def GetVirtualSize(self, *_args, **_kwargs): - val = apply(windowsc.wxScrolledWindow_GetVirtualSize,(self,) + _args, _kwargs) - return val def IsRetained(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_IsRetained,(self,) + _args, _kwargs) return val @@ -729,6 +748,9 @@ class wxScrolledWindowPtr(wxPanelPtr): def Layout(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_Layout,(self,) + _args, _kwargs) return val + def SetScrollRate(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_SetScrollRate,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) ViewStart = GetViewStart diff --git a/wxPython/src/sizers.i b/wxPython/src/sizers.i index 75c9b24d90..11b6ca412b 100644 --- a/wxPython/src/sizers.i +++ b/wxPython/src/sizers.i @@ -246,7 +246,10 @@ public: void Layout(); void Fit( wxWindow *window ); + void FitInside( wxWindow *window ); + void SetSizeHints( wxWindow *window ); + void SetVirtualSizeHints( wxWindow *window ); void Clear( bool delete_windows=FALSE ); void DeleteWindows(); diff --git a/wxPython/src/utils.i b/wxPython/src/utils.i index 24a33a10ef..8c48ba0950 100644 --- a/wxPython/src/utils.i +++ b/wxPython/src/utils.i @@ -23,7 +23,7 @@ //--------------------------------------------------------------------------- %{ // Put some wx default wxChar* values into wxStrings. - DECLARE_DEF_STRING2(DateFormatStr, wxT("sashWindow")); + DECLARE_DEF_STRING2(DateFormatStr, wxT("%c")); static const wxString wxPyEmptyString(wxT("")); %} diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index e1e0cae794..484cfeb360 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -326,6 +326,7 @@ public: void SetConstraints(wxLayoutConstraints *constraints); void UnsetConstraints(wxLayoutConstraints *constraints); void SetFocus(); + void SetFocusFromKbd(); bool AcceptsFocus(); void SetFont(const wxFont& font); void SetForegroundColour(const wxColour& colour); @@ -349,7 +350,18 @@ public: } } - void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1); + void SetSizeHints(int minW, int minH, + int maxW=-1, int maxH=-1, + int incW=-1, int incH=-1); + void SetVirtualSizeHints( int minW, int minH, + int maxW = -1, int maxH = -1 ); + + void SetVirtualSize( const wxSize &size ); + %name(SetVirtualSizeWH)void SetVirtualSize( int x, int y ); + + wxSize GetVirtualSize() const; + %name(GetVirtualSizeTuple)void GetVirtualSize( int *OUTPUT, int *OUTPUT ) const; + %name(SetClientSizeWH)void SetClientSize(int width, int height); void SetClientSize(const wxSize& size); //void SetPalette(wxPalette* palette); @@ -377,6 +389,7 @@ public: wxToolTip* GetToolTip(); void SetSizer(wxSizer* sizer, bool deleteOld=TRUE); + void SetSizerAndFit(wxSizer *sizer, bool deleteOld=TRUE); wxSizer* GetSizer(); // Track if this window is a member of a sizer @@ -541,7 +554,6 @@ public: int GetScrollPageSize(int orient); void GetScrollPixelsPerUnit(int* OUTPUT, int* OUTPUT); wxWindow* GetTargetWindow(); - void GetVirtualSize(int* OUTPUT, int* OUTPUT); bool IsRetained(); void PrepareDC(wxDC& dc); void Scroll(int x, int y); @@ -584,6 +596,10 @@ public: void AdjustScrollbars(); bool Layout(); + + // Set the x, y scrolling increments. + void SetScrollRate( int xstep, int ystep ); + }; //---------------------------------------------------------------------- -- 2.45.2