From 8e425133fbdde2e2663e443bcaadf4a35914d845 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 19 Jan 2000 06:58:56 +0000 Subject: [PATCH] Various odds and ends, minor fixes, and cleanups... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/demo/GenericButtons.py | 10 +- utils/wxPython/demo/wxGLCanvas.py | 2 - utils/wxPython/demo/wxMask.py | 51 ++--- utils/wxPython/demo/wxVTKRenderWindow.py | 4 +- utils/wxPython/distrib/build.py | 14 +- utils/wxPython/lib/buttons.py | 5 +- utils/wxPython/lib/floatbar.py | 6 + utils/wxPython/lib/sizers/__init__.py | 4 +- utils/wxPython/modules/html/html.cpp | 92 ++------ utils/wxPython/modules/html/html.i | 27 ++- utils/wxPython/modules/html/html.py | 8 - utils/wxPython/src/gtk/controls2.cpp | 138 ++++++++++++ utils/wxPython/src/gtk/controls2.py | 9 + utils/wxPython/src/gtk/stattool.cpp | 19 +- utils/wxPython/src/gtk/windows.cpp | 273 ++++++++++++++++++++++- utils/wxPython/src/gtk/windows.py | 33 +++ utils/wxPython/src/gtk/windows2.cpp | 12 +- utils/wxPython/src/gtk/wx.py | 11 +- utils/wxPython/src/misc2.i | 2 + utils/wxPython/src/stattool.i | 4 +- 20 files changed, 568 insertions(+), 156 deletions(-) diff --git a/utils/wxPython/demo/GenericButtons.py b/utils/wxPython/demo/GenericButtons.py index b67a00acde..876542eae8 100644 --- a/utils/wxPython/demo/GenericButtons.py +++ b/utils/wxPython/demo/GenericButtons.py @@ -14,17 +14,17 @@ class TestPanel(wxPanel): b = wxButton(self, -1, "A real button", (10,10)) b.SetDefault() EVT_BUTTON(self, b.GetId(), self.OnButton) - b = wxButton(self, -1, "non-default", (100, 10)) + b = wxButton(self, -1, "non-default", (140, 10)) EVT_BUTTON(self, b.GetId(), self.OnButton) #wxTextCtrl(self, -1, "", (10,40)) b = wxGenButton(self, -1, 'Hello', (10,65)) EVT_BUTTON(self, b.GetId(), self.OnButton) - b = wxGenButton(self, -1, 'disabled', (100,65)) + b = wxGenButton(self, -1, 'disabled', (140,65)) EVT_BUTTON(self, b.GetId(), self.OnButton) b.Enable(false) - b = wxGenButton(self, -1, 'bigger', (195,50)) + b = wxGenButton(self, -1, 'bigger', (250,50)) EVT_BUTTON(self, b.GetId(), self.OnButton) b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false)) b.SetBezelWidth(5) @@ -38,7 +38,7 @@ class TestPanel(wxPanel): EVT_BUTTON(self, b.GetId(), self.OnButton) - b = wxGenBitmapButton(self, -1, None, (100, 130)) + b = wxGenBitmapButton(self, -1, None, (140, 130)) EVT_BUTTON(self, b.GetId(), self.OnButton) bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP) mask = wxMaskColour(bmp, wxBLUE) @@ -54,7 +54,7 @@ class TestPanel(wxPanel): EVT_BUTTON(self, b.GetId(), self.OnToggleButton) - b = wxGenBitmapToggleButton(self, -1, None, (100, 230)) + b = wxGenBitmapToggleButton(self, -1, None, (140, 230)) EVT_BUTTON(self, b.GetId(), self.OnToggleButton) bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP) mask = wxMaskColour(bmp, wxBLUE) diff --git a/utils/wxPython/demo/wxGLCanvas.py b/utils/wxPython/demo/wxGLCanvas.py index 8aada33c1f..2da77bfa2a 100644 --- a/utils/wxPython/demo/wxGLCanvas.py +++ b/utils/wxPython/demo/wxGLCanvas.py @@ -66,7 +66,6 @@ else: def OnSize(self, event): size = self.GetClientSize() - print size if self.GetContext(): self.SetCurrent() glViewport(0, 0, size.width, size.height) @@ -76,7 +75,6 @@ else: dc = wxPaintDC(self) self.SetCurrent() - print self.init if not self.init: self.InitGL() diff --git a/utils/wxPython/demo/wxMask.py b/utils/wxPython/demo/wxMask.py index f338391429..6f64860e34 100644 --- a/utils/wxPython/demo/wxMask.py +++ b/utils/wxPython/demo/wxMask.py @@ -3,27 +3,28 @@ from wxPython.wx import * #---------------------------------------------------------------------- -logic = ['']*16 -def rlf(x): - logic[eval(x)]=x - - -rlf('wxAND') -rlf('wxAND_INVERT') -rlf('wxAND_REVERSE') -rlf('wxCLEAR') -rlf('wxCOPY') -rlf('wxEQUIV') -rlf('wxINVERT') -rlf('wxNAND') -rlf('wxNOR') -rlf('wxNO_OP') -rlf('wxOR') -rlf('wxOR_INVERT') -rlf('wxOR_REVERSE') -rlf('wxSET') -rlf('wxSRC_INVERT') -rlf('wxXOR') +logicList = [ + ('wxAND', wxAND), + ('wxAND_INVERT', wxAND_INVERT), + ('wxAND_REVERSE', wxAND_REVERSE), + ('wxCLEAR', wxCLEAR), + ('wxCOPY', wxCOPY), + ('wxEQUIV', wxEQUIV), + ('wxINVERT', wxINVERT), + ('wxNAND', wxNAND), + + # this one causes an assert on wxGTK, and doesn't seem to + # do much on MSW anyway, so I'll just take it out.... + #('wxNOR', wxNOR), + + ('wxNO_OP', wxNO_OP), + ('wxOR', wxOR), + ('wxOR_INVERT', wxOR_INVERT), + ('wxOR_REVERSE', wxOR_REVERSE), + ('wxSET', wxSET), + ('wxSRC_INVERT', wxSRC_INVERT), + ('wxXOR', wxXOR), +] class TestMaskWindow(wxScrolledWindow): def __init__(self, parent): @@ -78,13 +79,13 @@ class TestMaskWindow(wxScrolledWindow): # draw array of assorted blit operations mdc = wxMemoryDC() - for i in range(16): - text = logic[i] + i = 0 + for text, code in logicList: x,y = 120+100*(i%4), 20+100*(i/4) dc.DrawText(text, x,y-20) mdc.SelectObject(self.bmp_withcolourmask) - dc.Blit(x,y, cx,cy, mdc, 0,0, i,1) - + dc.Blit(x,y, cx,cy, mdc, 0,0, code, true) + i = i + 1 diff --git a/utils/wxPython/demo/wxVTKRenderWindow.py b/utils/wxPython/demo/wxVTKRenderWindow.py index d649707af5..df1a710d0f 100644 --- a/utils/wxPython/demo/wxVTKRenderWindow.py +++ b/utils/wxPython/demo/wxVTKRenderWindow.py @@ -45,8 +45,8 @@ def runTest(frame, nb, log): else: - wxMessageBox("Unable to import VTK, which is a required component " - "of this demo. You need to download and install the " + wxMessageBox("Unable to import VTK, which is a required component\n" + "of this demo. You need to download and install the\n" "Python extension module for VTK from http://www.kitware.com/", "Import Error") return None diff --git a/utils/wxPython/distrib/build.py b/utils/wxPython/distrib/build.py index 234d5a8cae..5b4692ceca 100755 --- a/utils/wxPython/distrib/build.py +++ b/utils/wxPython/distrib/build.py @@ -322,11 +322,15 @@ class BuildConfig: # so we can do some sanity checking... if sys.platform != 'win32': if not self.CCC: - print "Warning: C++ compiler not specified (CCC). Assuming c++" - self.CCC = 'c++' - if not self.CC: - print "Warning: C compiler not specified (CC). Assuming cc" - self.CC = 'cc' + self.CCC = os.popen('wx-config --cxx', 'r').read()[:-1] + if not self.CCC: + print "Warning: C++ compiler not specified (CCC). Assuming c++" + self.CCC = 'c++' + if not self.CC: + self.CCC = os.popen('wx-config --cc', 'r').read()[:-1] + if not self.CC: + print "Warning: C compiler not specified (CC). Assuming cc" + self.CC = 'cc' #------------------------------------------------------------ def findMFValue(self, mfText, st): diff --git a/utils/wxPython/lib/buttons.py b/utils/wxPython/lib/buttons.py index 41c6865172..9c4a79110a 100644 --- a/utils/wxPython/lib/buttons.py +++ b/utils/wxPython/lib/buttons.py @@ -142,7 +142,8 @@ class wxGenButton(wxControl): highlightClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT) self.shadowPen = wxPen(shadowClr, 1, wxSOLID) self.highlightPen = wxPen(highlightClr, 1, wxSOLID) - self.focusIndPen = wxPen(textClr, 1, wxUSER_DASH) + ##self.focusIndPen = wxPen(textClr, 1, wxUSER_DASH) + self.focusIndPen = wxPen(textClr, 1, wxDOT) def SetBackgroundColour(self, colour): @@ -209,7 +210,7 @@ class wxGenButton(wxControl): bw = self.bezelWidth dc.SetLogicalFunction(wxINVERT) self.focusIndPen.SetColour(self.GetForegroundColour()) - self.focusIndPen.SetDashes([1,2,1,2]) # This isn't quite working the way I expected... + ##self.focusIndPen.SetDashes([1,2,1,2]) # This isn't quite working the way I expected... dc.SetPen(self.focusIndPen) dc.SetBrush(wxTRANSPARENT_BRUSH) dc.DrawRectangle(bw+2,bw+2, w-bw*2-4, h-bw*2-4) diff --git a/utils/wxPython/lib/floatbar.py b/utils/wxPython/lib/floatbar.py index c5a83d0b9a..7d462233c6 100644 --- a/utils/wxPython/lib/floatbar.py +++ b/utils/wxPython/lib/floatbar.py @@ -8,6 +8,12 @@ #---------------------------------------------------------------------------- from wxPython.wx import * +if wxPlatform == '__WXGTK__': + msg = "Due to a bug in wxGTK this class is not available on that "\ + "platform for this release. Sorry." + raise ImportError, msg + + _DOCKTHRESHOLD = 25 class wxFloatBar(wxToolBar): diff --git a/utils/wxPython/lib/sizers/__init__.py b/utils/wxPython/lib/sizers/__init__.py index 7aaa886dae..d73718ade5 100644 --- a/utils/wxPython/lib/sizers/__init__.py +++ b/utils/wxPython/lib/sizers/__init__.py @@ -19,7 +19,7 @@ from shape import * #---------------------------------------------------------------------------- _msg = """\ Since the wxWindows library now includes its own sizers, the -classes in wxPython.lib.sizers have been depreciated. Please +classes in wxPython.lib.sizers have been deprecated. Please see the Reference Manual for details of the new classes. To contiunue using wxPython.lib.sizers without this @@ -34,7 +34,7 @@ from wxPython.wx import wxMessageDialog, wxOK, wxICON_EXCLAMATION, wxPlatform if not os.environ.has_key('WXP_OLDSIZERS'): if wxPlatform == '__WXMSW__': dlg = wxMessageDialog(None, _msg, - "Depreciated Feature", + "Deprecated Feature", wxOK | wxICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() diff --git a/utils/wxPython/modules/html/html.cpp b/utils/wxPython/modules/html/html.cpp index 8d54500d32..bc12b9351c 100644 --- a/utils/wxPython/modules/html/html.cpp +++ b/utils/wxPython/modules/html/html.cpp @@ -213,9 +213,13 @@ public: const wxString& name = "htmlWindow") : wxHtmlWindow(parent, id, pos, size, style, name) {}; - +#ifdef POST_2_1_12 void OnLinkClicked(const wxHtmlLinkInfo& link); void base_OnLinkClicked(const wxHtmlLinkInfo& link); +#else + void OnLinkClicked(wxHtmlLinkInfo* link); + void base_OnLinkClicked(wxHtmlLinkInfo* link); +#endif DEC_PYCALLBACK__STRING(OnSetTitle); PYPRIVATE; @@ -224,17 +228,29 @@ public: IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle); -void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { +#ifdef POST_2_1_12 + void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { +#else + void wxPyHtmlWindow::OnLinkClicked(wxHtmlLinkInfo* link) { +#endif bool doSave = wxPyRestoreThread(); if (m_myInst.findCallback("OnLinkClicked")) { +#ifdef POST_2_1_12 PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo"); +#else + PyObject* obj = wxPyConstructObject(link, "wxHtmlLinkInfo"); +#endif m_myInst.callCallback(Py_BuildValue("(O)", obj)); } else wxHtmlWindow::OnLinkClicked(link); wxPySaveThread(doSave); } +#ifdef POST_2_1_12 void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) { +#else +void wxPyHtmlWindow::base_OnLinkClicked(wxHtmlLinkInfo* link) { +#endif wxHtmlWindow::OnLinkClicked(link); } @@ -410,74 +426,6 @@ static PyObject *_wrap_wxHtmlLinkInfo_GetTarget(PyObject *self, PyObject *args, return _resultobj; } -#define wxHtmlLinkInfo_GetEvent(_swigobj) (_swigobj->GetEvent()) -static PyObject *_wrap_wxHtmlLinkInfo_GetEvent(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxMouseEvent * _result; - wxHtmlLinkInfo * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlLinkInfo_GetEvent",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlLinkInfo_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlLinkInfo_GetEvent. Expected _wxHtmlLinkInfo_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxMouseEvent *)wxHtmlLinkInfo_GetEvent(_arg0); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxMouseEvent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - -#define wxHtmlLinkInfo_GetHtmlCell(_swigobj) (_swigobj->GetHtmlCell()) -static PyObject *_wrap_wxHtmlLinkInfo_GetHtmlCell(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxHtmlCell * _result; - wxHtmlLinkInfo * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxHtmlLinkInfo_GetHtmlCell",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxHtmlLinkInfo_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxHtmlLinkInfo_GetHtmlCell. Expected _wxHtmlLinkInfo_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxHtmlCell *)wxHtmlLinkInfo_GetHtmlCell(_arg0); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxHtmlCell_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - #define wxHtmlTag_GetName(_swigobj) (_swigobj->GetName()) static PyObject *_wrap_wxHtmlTag_GetName(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4476,7 +4424,7 @@ static PyObject *_wrap_wxHtmlWindow_base_OnLinkClicked(PyObject *self, PyObject } { wxPy_BEGIN_ALLOW_THREADS; - wxHtmlWindow_base_OnLinkClicked(_arg0,*_arg1); + wxHtmlWindow_base_OnLinkClicked(_arg0,_arg1); wxPy_END_ALLOW_THREADS; } Py_INCREF(Py_None); @@ -5619,8 +5567,6 @@ static PyMethodDef htmlcMethods[] = { { "wxHtmlTag_GetParam", (PyCFunction) _wrap_wxHtmlTag_GetParam, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_HasParam", (PyCFunction) _wrap_wxHtmlTag_HasParam, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlTag_GetName", (PyCFunction) _wrap_wxHtmlTag_GetName, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlLinkInfo_GetHtmlCell", (PyCFunction) _wrap_wxHtmlLinkInfo_GetHtmlCell, METH_VARARGS | METH_KEYWORDS }, - { "wxHtmlLinkInfo_GetEvent", (PyCFunction) _wrap_wxHtmlLinkInfo_GetEvent, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlLinkInfo_GetTarget", (PyCFunction) _wrap_wxHtmlLinkInfo_GetTarget, METH_VARARGS | METH_KEYWORDS }, { "wxHtmlLinkInfo_GetHref", (PyCFunction) _wrap_wxHtmlLinkInfo_GetHref, METH_VARARGS | METH_KEYWORDS }, { "new_wxHtmlLinkInfo", (PyCFunction) _wrap_new_wxHtmlLinkInfo, METH_VARARGS | METH_KEYWORDS }, diff --git a/utils/wxPython/modules/html/html.i b/utils/wxPython/modules/html/html.i index dfbe42c3dc..49d4c7d77f 100644 --- a/utils/wxPython/modules/html/html.i +++ b/utils/wxPython/modules/html/html.i @@ -90,8 +90,10 @@ public: wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString); wxString GetHref(); wxString GetTarget(); +#ifdef POST_2_1_12 wxMouseEvent* GetEvent(); wxHtmlCell* GetHtmlCell(); +#endif }; //--------------------------------------------------------------------------- @@ -410,9 +412,13 @@ public: const wxString& name = "htmlWindow") : wxHtmlWindow(parent, id, pos, size, style, name) {}; - +#ifdef POST_2_1_12 void OnLinkClicked(const wxHtmlLinkInfo& link); void base_OnLinkClicked(const wxHtmlLinkInfo& link); +#else + void OnLinkClicked(wxHtmlLinkInfo* link); + void base_OnLinkClicked(wxHtmlLinkInfo* link); +#endif DEC_PYCALLBACK__STRING(OnSetTitle); PYPRIVATE; @@ -421,17 +427,29 @@ public: IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle); -void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { +#ifdef POST_2_1_12 + void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) { +#else + void wxPyHtmlWindow::OnLinkClicked(wxHtmlLinkInfo* link) { +#endif bool doSave = wxPyRestoreThread(); if (m_myInst.findCallback("OnLinkClicked")) { +#ifdef POST_2_1_12 PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo"); +#else + PyObject* obj = wxPyConstructObject(link, "wxHtmlLinkInfo"); +#endif m_myInst.callCallback(Py_BuildValue("(O)", obj)); } else wxHtmlWindow::OnLinkClicked(link); wxPySaveThread(doSave); } +#ifdef POST_2_1_12 void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) { +#else +void wxPyHtmlWindow::base_OnLinkClicked(wxHtmlLinkInfo* link) { +#endif wxHtmlWindow::OnLinkClicked(link); } %} @@ -469,8 +487,11 @@ public: wxHtmlContainerCell* GetInternalRepresentation(); wxHtmlWinParser* GetParser(); - +#ifdef POST_2_1_12 void base_OnLinkClicked(const wxHtmlLinkInfo& link); +#else + void base_OnLinkClicked(wxHtmlLinkInfo* link); +#endif void base_OnSetTitle(const char* title); }; diff --git a/utils/wxPython/modules/html/html.py b/utils/wxPython/modules/html/html.py index 4231aac0cd..c02981a6d6 100644 --- a/utils/wxPython/modules/html/html.py +++ b/utils/wxPython/modules/html/html.py @@ -45,14 +45,6 @@ class wxHtmlLinkInfoPtr : def GetTarget(self, *_args, **_kwargs): val = apply(htmlc.wxHtmlLinkInfo_GetTarget,(self,) + _args, _kwargs) return val - def GetEvent(self, *_args, **_kwargs): - val = apply(htmlc.wxHtmlLinkInfo_GetEvent,(self,) + _args, _kwargs) - if val: val = wxMouseEventPtr(val) - return val - def GetHtmlCell(self, *_args, **_kwargs): - val = apply(htmlc.wxHtmlLinkInfo_GetHtmlCell,(self,) + _args, _kwargs) - if val: val = wxHtmlCellPtr(val) - return val def __repr__(self): return "" % (self.this,) class wxHtmlLinkInfo(wxHtmlLinkInfoPtr): diff --git a/utils/wxPython/src/gtk/controls2.cpp b/utils/wxPython/src/gtk/controls2.cpp index 42c3679d90..e1f20a0c1f 100644 --- a/utils/wxPython/src/gtk/controls2.cpp +++ b/utils/wxPython/src/gtk/controls2.cpp @@ -5565,7 +5565,145 @@ static PyObject *_wrap_wxTreeCtrl_HitTest(PyObject *self, PyObject *args, PyObje return _resultobj; } +#define wxTreeCtrl_SetItemTextColour(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemTextColour(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxTreeCtrl_SetItemTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTreeCtrl * _arg0; + wxTreeItemId * _arg1; + wxColour * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","item","col", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemTextColour",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_SetItemTextColour. Expected _wxTreeCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_SetItemTextColour. Expected _wxTreeItemId_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTreeCtrl_SetItemTextColour. Expected _wxColour_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxTreeCtrl_SetItemTextColour(_arg0,*_arg1,*_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxTreeCtrl_SetItemBackgroundColour(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemBackgroundColour(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxTreeCtrl_SetItemBackgroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTreeCtrl * _arg0; + wxTreeItemId * _arg1; + wxColour * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","item","col", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemBackgroundColour",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_SetItemBackgroundColour. Expected _wxTreeCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_SetItemBackgroundColour. Expected _wxTreeItemId_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxColour_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTreeCtrl_SetItemBackgroundColour. Expected _wxColour_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxTreeCtrl_SetItemBackgroundColour(_arg0,*_arg1,*_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxTreeCtrl_SetItemFont(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemFont(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxTreeCtrl_SetItemFont(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTreeCtrl * _arg0; + wxTreeItemId * _arg1; + wxFont * _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","item","font", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxTreeCtrl_SetItemFont",_kwnames,&_argo0,&_argo1,&_argo2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTreeCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_SetItemFont. Expected _wxTreeCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxTreeItemId_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_SetItemFont. Expected _wxTreeItemId_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxTreeCtrl_SetItemFont. Expected _wxFont_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxTreeCtrl_SetItemFont(_arg0,*_arg1,*_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static PyMethodDef controls2cMethods[] = { + { "wxTreeCtrl_SetItemFont", (PyCFunction) _wrap_wxTreeCtrl_SetItemFont, METH_VARARGS | METH_KEYWORDS }, + { "wxTreeCtrl_SetItemBackgroundColour", (PyCFunction) _wrap_wxTreeCtrl_SetItemBackgroundColour, METH_VARARGS | METH_KEYWORDS }, + { "wxTreeCtrl_SetItemTextColour", (PyCFunction) _wrap_wxTreeCtrl_SetItemTextColour, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl_HitTest", (PyCFunction) _wrap_wxTreeCtrl_HitTest, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl_IsBold", (PyCFunction) _wrap_wxTreeCtrl_IsBold, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl_SetItemBold", (PyCFunction) _wrap_wxTreeCtrl_SetItemBold, METH_VARARGS | METH_KEYWORDS }, diff --git a/utils/wxPython/src/gtk/controls2.py b/utils/wxPython/src/gtk/controls2.py index 0e9ec989e5..6ad7ab15c8 100644 --- a/utils/wxPython/src/gtk/controls2.py +++ b/utils/wxPython/src/gtk/controls2.py @@ -569,6 +569,15 @@ class wxTreeCtrlPtr(wxControlPtr): val = apply(controls2c.wxTreeCtrl_HitTest,(self,) + _args, _kwargs) if val: val = wxTreeItemIdPtr(val) ; val.thisown = 1 return val + def SetItemTextColour(self, *_args, **_kwargs): + val = apply(controls2c.wxTreeCtrl_SetItemTextColour,(self,) + _args, _kwargs) + return val + def SetItemBackgroundColour(self, *_args, **_kwargs): + val = apply(controls2c.wxTreeCtrl_SetItemBackgroundColour,(self,) + _args, _kwargs) + return val + def SetItemFont(self, *_args, **_kwargs): + val = apply(controls2c.wxTreeCtrl_SetItemFont,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) diff --git a/utils/wxPython/src/gtk/stattool.cpp b/utils/wxPython/src/gtk/stattool.cpp index f66872f8d1..bdee06b444 100644 --- a/utils/wxPython/src/gtk/stattool.cpp +++ b/utils/wxPython/src/gtk/stattool.cpp @@ -2839,18 +2839,17 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition; wxSize * _arg3 = (wxSize *) &wxPyDefaultSize; long _arg4 = (long ) wxNO_BORDER|wxTB_HORIZONTAL; - wxString * _arg5 = (wxString *) &wxToolBarNameStr; + char * _arg5 = (char *) wxToolBarNameStr; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; wxSize temp0; PyObject * _obj3 = 0; - PyObject * _obj5 = 0; char *_kwnames[] = { "parent","id","pos","size","style","name", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlO:new_wxToolBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_obj5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxToolBar",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2870,18 +2869,10 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k _arg3 = &temp0; if (! wxSize_helper(_obj3, &_arg3)) return NULL; -} - if (_obj5) -{ - if (!PyString_Check(_obj5)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg5 = new wxString(PyString_AsString(_obj5), PyString_Size(_obj5)); } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxToolBar *)new_wxToolBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5); + _result = (wxToolBar *)new_wxToolBar(_arg0,_arg1,*_arg2,*_arg3,_arg4,_arg5); wxPy_END_ALLOW_THREADS; } if (_result) { @@ -2891,10 +2882,6 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k Py_INCREF(Py_None); _resultobj = Py_None; } -{ - if (_obj5) - delete _arg5; -} return _resultobj; } diff --git a/utils/wxPython/src/gtk/windows.cpp b/utils/wxPython/src/gtk/windows.cpp index 28600f23a6..83f29c01cf 100644 --- a/utils/wxPython/src/gtk/windows.cpp +++ b/utils/wxPython/src/gtk/windows.cpp @@ -157,6 +157,16 @@ IMP_PYCALLBACK_BOOL_(wxPyValidator, wxValidator, TransferFromWindow); IMPLEMENT_DYNAMIC_CLASS(wxPyValidator, wxValidator); + + int wxWindow_NewControlId() { + return wxWindow::NewControlId(); + } + int wxWindow_NextControlId(int id) { + return wxWindow::NextControlId(id); + } + int wxWindow_PrevControlId(int id) { + return wxWindow::PrevControlId(id); + } #ifdef __cplusplus extern "C" { #endif @@ -195,6 +205,59 @@ static PyObject *_wrap_wxValidator_SetBellOnError(PyObject *self, PyObject *args return _resultobj; } +static PyObject *_wrap_wxWindow_NewControlId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + char *_kwnames[] = { NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxWindow_NewControlId",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxWindow_NewControlId(); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +static PyObject *_wrap_wxWindow_NextControlId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + int _arg0; + char *_kwnames[] = { "id", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxWindow_NextControlId",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxWindow_NextControlId(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +static PyObject *_wrap_wxWindow_PrevControlId(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + int _arg0; + char *_kwnames[] = { "id", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"i:wxWindow_PrevControlId",_kwnames,&_arg0)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxWindow_PrevControlId(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxEvtHandler_ProcessEvent(_swigobj,_swigarg0) (_swigobj->ProcessEvent(_swigarg0)) static PyObject *_wrap_wxEvtHandler_ProcessEvent(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3022,6 +3085,42 @@ static PyObject *_wrap_wxWindow_ReleaseMouse(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxWindow_RemoveChild(_swigobj,_swigarg0) (_swigobj->RemoveChild(_swigarg0)) +static PyObject *_wrap_wxWindow_RemoveChild(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_RemoveChild",_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_RemoveChild. 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_RemoveChild. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_RemoveChild(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_Reparent(_swigobj,_swigarg0) (_swigobj->Reparent(_swigarg0)) static PyObject *_wrap_wxWindow_Reparent(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3676,7 +3775,7 @@ static PyObject *_wrap_wxWindow_SetDimensions(PyObject *self, PyObject *args, Py } static void wxWindow_SetSize(wxWindow *self,const wxSize & size) { - self->SetSize(size.x, size.y); + self->SetSize(size); } static PyObject *_wrap_wxWindow_SetSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3713,7 +3812,7 @@ static PyObject *_wrap_wxWindow_SetSize(PyObject *self, PyObject *args, PyObject } static void wxWindow_SetPosition(wxWindow *self,const wxPoint & pos) { - self->SetSize(pos.x, pos.y, -1, -1); + self->Move(pos); } static PyObject *_wrap_wxWindow_SetPosition(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4561,6 +4660,76 @@ static PyObject *_wrap_wxWindow_GetBestSize(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define wxWindow_SetCaret(_swigobj,_swigarg0) (_swigobj->SetCaret(_swigarg0)) +static PyObject *_wrap_wxWindow_SetCaret(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + wxCaret * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","caret", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_SetCaret",_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_SetCaret. Expected _wxWindow_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxCaret_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_SetCaret. Expected _wxCaret_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_SetCaret(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_GetCaret(_swigobj) (_swigobj->GetCaret()) +static PyObject *_wrap_wxWindow_GetCaret(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCaret * _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_GetCaret",_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_GetCaret. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxCaret *)wxWindow_GetCaret(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxCaret_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + static void *SwigwxPanelTowxWindow(void *ptr) { wxPanel *src; wxWindow *dest; @@ -5287,6 +5456,34 @@ static PyObject *_wrap_wxScrolledWindow_EnableScrolling(PyObject *self, PyObject return _resultobj; } +#define wxScrolledWindow_GetScrollPageSize(_swigobj,_swigarg0) (_swigobj->GetScrollPageSize(_swigarg0)) +static PyObject *_wrap_wxScrolledWindow_GetScrollPageSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxScrolledWindow * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","orient", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxScrolledWindow_GetScrollPageSize",_kwnames,&_argo0,&_arg1)) + 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_GetScrollPageSize. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxScrolledWindow_GetScrollPageSize(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxScrolledWindow_GetScrollPixelsPerUnit(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetScrollPixelsPerUnit(_swigarg0,_swigarg1)) static PyObject *_wrap_wxScrolledWindow_GetScrollPixelsPerUnit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -5334,6 +5531,40 @@ static PyObject *_wrap_wxScrolledWindow_GetScrollPixelsPerUnit(PyObject *self, P return _resultobj; } +#define wxScrolledWindow_GetTargetWindow(_swigobj) (_swigobj->GetTargetWindow()) +static PyObject *_wrap_wxScrolledWindow_GetTargetWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _result; + wxScrolledWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxScrolledWindow_GetTargetWindow",_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_GetTargetWindow. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxWindow *)wxScrolledWindow_GetTargetWindow(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxWindow_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + 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; @@ -5506,6 +5737,35 @@ static PyObject *_wrap_wxScrolledWindow_SetScrollbars(PyObject *self, PyObject * return _resultobj; } +#define wxScrolledWindow_SetScrollPageSize(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetScrollPageSize(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxScrolledWindow_SetScrollPageSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxScrolledWindow * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","orient","pageSize", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxScrolledWindow_SetScrollPageSize",_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_SetScrollPageSize. Expected _wxScrolledWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxScrolledWindow_SetScrollPageSize(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxScrolledWindow_SetTargetWindow(_swigobj,_swigarg0) (_swigobj->SetTargetWindow(_swigarg0)) static PyObject *_wrap_wxScrolledWindow_SetTargetWindow(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -8552,12 +8812,15 @@ static PyMethodDef windowscMethods[] = { { "wxScrolledWindow_CalcScrolledPosition", (PyCFunction) _wrap_wxScrolledWindow_CalcScrolledPosition, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_ViewStart", (PyCFunction) _wrap_wxScrolledWindow_ViewStart, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_SetTargetWindow", (PyCFunction) _wrap_wxScrolledWindow_SetTargetWindow, METH_VARARGS | METH_KEYWORDS }, + { "wxScrolledWindow_SetScrollPageSize", (PyCFunction) _wrap_wxScrolledWindow_SetScrollPageSize, METH_VARARGS | METH_KEYWORDS }, { "wxScrolledWindow_SetScrollbars", (PyCFunction) _wrap_wxScrolledWindow_SetScrollbars, METH_VARARGS | METH_KEYWORDS }, { "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 }, { "wxScrolledWindow_EnableScrolling", (PyCFunction) _wrap_wxScrolledWindow_EnableScrolling, METH_VARARGS | METH_KEYWORDS }, { "new_wxScrolledWindow", (PyCFunction) _wrap_new_wxScrolledWindow, METH_VARARGS | METH_KEYWORDS }, { "wxDialog_SetReturnCode", (PyCFunction) _wrap_wxDialog_SetReturnCode, METH_VARARGS | METH_KEYWORDS }, @@ -8577,6 +8840,8 @@ static PyMethodDef windowscMethods[] = { { "wxPanel_GetDefaultItem", (PyCFunction) _wrap_wxPanel_GetDefaultItem, METH_VARARGS | METH_KEYWORDS }, { "wxPanel_InitDialog", (PyCFunction) _wrap_wxPanel_InitDialog, METH_VARARGS | METH_KEYWORDS }, { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_GetCaret", (PyCFunction) _wrap_wxWindow_GetCaret, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetCaret", (PyCFunction) _wrap_wxWindow_SetCaret, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetBestSize", (PyCFunction) _wrap_wxWindow_GetBestSize, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetDropTarget", (PyCFunction) _wrap_wxWindow_GetDropTarget, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetDropTarget", (PyCFunction) _wrap_wxWindow_SetDropTarget, METH_VARARGS | METH_KEYWORDS }, @@ -8624,6 +8889,7 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_ScreenToClient", (PyCFunction) _wrap_wxWindow_ScreenToClient, METH_VARARGS | METH_KEYWORDS }, { "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_Refresh", (PyCFunction) _wrap_wxWindow_Refresh, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Raise", (PyCFunction) _wrap_wxWindow_Raise, METH_VARARGS | METH_KEYWORDS }, @@ -8707,6 +8973,9 @@ static PyMethodDef windowscMethods[] = { { "wxEvtHandler_SetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_SetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_GetEvtHandlerEnabled", (PyCFunction) _wrap_wxEvtHandler_GetEvtHandlerEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_ProcessEvent", (PyCFunction) _wrap_wxEvtHandler_ProcessEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_NextControlId", (PyCFunction) _wrap_wxWindow_NextControlId, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_NewControlId", (PyCFunction) _wrap_wxWindow_NewControlId, METH_VARARGS | METH_KEYWORDS }, { "wxValidator_SetBellOnError", (PyCFunction) _wrap_wxValidator_SetBellOnError, METH_VARARGS | METH_KEYWORDS }, { "wxValidator_IsSilent", (PyCFunction) _wrap_wxValidator_IsSilent, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } diff --git a/utils/wxPython/src/gtk/windows.py b/utils/wxPython/src/gtk/windows.py index 589b81c33b..df956d3e07 100644 --- a/utils/wxPython/src/gtk/windows.py +++ b/utils/wxPython/src/gtk/windows.py @@ -326,6 +326,9 @@ class wxWindowPtr(wxEvtHandlerPtr): 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 def Reparent(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Reparent,(self,) + _args, _kwargs) return val @@ -479,8 +482,22 @@ class wxWindowPtr(wxEvtHandlerPtr): val = apply(windowsc.wxWindow_GetBestSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 return val + def SetCaret(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetCaret,(self,) + _args, _kwargs) + return val + def GetCaret(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) + if val: val = wxCaretPtr(val) + return val def __repr__(self): return "" % (self.this,) + # replaces broken shadow method + def GetCaret(self, *_args, **_kwargs): + from misc2 import wxCaretPtr + val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs) + if val: val = wxCaretPtr(val) + return val + class wxWindow(wxWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxWindow,_args,_kwargs) @@ -580,9 +597,16 @@ class wxScrolledWindowPtr(wxPanelPtr): def EnableScrolling(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_EnableScrolling,(self,) + _args, _kwargs) return val + def GetScrollPageSize(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetScrollPageSize,(self,) + _args, _kwargs) + return val def GetScrollPixelsPerUnit(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetScrollPixelsPerUnit,(self,) + _args, _kwargs) return val + def GetTargetWindow(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_GetTargetWindow,(self,) + _args, _kwargs) + if val: val = wxWindowPtr(val) + return val def GetVirtualSize(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_GetVirtualSize,(self,) + _args, _kwargs) return val @@ -598,6 +622,9 @@ class wxScrolledWindowPtr(wxPanelPtr): def SetScrollbars(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_SetScrollbars,(self,) + _args, _kwargs) return val + def SetScrollPageSize(self, *_args, **_kwargs): + val = apply(windowsc.wxScrolledWindow_SetScrollPageSize,(self,) + _args, _kwargs) + return val def SetTargetWindow(self, *_args, **_kwargs): val = apply(windowsc.wxScrolledWindow_SetTargetWindow,(self,) + _args, _kwargs) return val @@ -913,6 +940,12 @@ wxValidator_IsSilent = windowsc.wxValidator_IsSilent wxValidator_SetBellOnError = windowsc.wxValidator_SetBellOnError +wxWindow_NewControlId = windowsc.wxWindow_NewControlId + +wxWindow_NextControlId = windowsc.wxWindow_NextControlId + +wxWindow_PrevControlId = windowsc.wxWindow_PrevControlId + #-------------- VARIABLE WRAPPERS ------------------ diff --git a/utils/wxPython/src/gtk/windows2.cpp b/utils/wxPython/src/gtk/windows2.cpp index db77914cfd..ba40683750 100644 --- a/utils/wxPython/src/gtk/windows2.cpp +++ b/utils/wxPython/src/gtk/windows2.cpp @@ -719,13 +719,12 @@ static PyObject *_wrap_wxGrid_AppendCols(PyObject *self, PyObject *args, PyObjec bool _result; wxGrid * _arg0; int _arg1 = (int ) 1; - bool _arg2 = (bool ) TRUE; + int _arg2 = (int ) TRUE; PyObject * _argo0 = 0; - int tempbool2 = (int) TRUE; char *_kwnames[] = { "self","n","updateLabels", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:wxGrid_AppendCols",_kwnames,&_argo0,&_arg1,&tempbool2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:wxGrid_AppendCols",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -734,7 +733,6 @@ static PyObject *_wrap_wxGrid_AppendCols(PyObject *self, PyObject *args, PyObjec return NULL; } } - _arg2 = (bool ) tempbool2; { wxPy_BEGIN_ALLOW_THREADS; _result = (bool )wxGrid_AppendCols(_arg0,_arg1,_arg2); @@ -750,13 +748,12 @@ static PyObject *_wrap_wxGrid_AppendRows(PyObject *self, PyObject *args, PyObjec bool _result; wxGrid * _arg0; int _arg1 = (int ) 1; - bool _arg2 = (bool ) TRUE; + int _arg2 = (int ) TRUE; PyObject * _argo0 = 0; - int tempbool2 = (int) TRUE; char *_kwnames[] = { "self","n","updateLabels", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:wxGrid_AppendRows",_kwnames,&_argo0,&_arg1,&tempbool2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|ii:wxGrid_AppendRows",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -765,7 +762,6 @@ static PyObject *_wrap_wxGrid_AppendRows(PyObject *self, PyObject *args, PyObjec return NULL; } } - _arg2 = (bool ) tempbool2; { wxPy_BEGIN_ALLOW_THREADS; _result = (bool )wxGrid_AppendRows(_arg0,_arg1,_arg2); diff --git a/utils/wxPython/src/gtk/wx.py b/utils/wxPython/src/gtk/wx.py index f18c18ed12..a41a3adfaf 100644 --- a/utils/wxPython/src/gtk/wx.py +++ b/utils/wxPython/src/gtk/wx.py @@ -1549,15 +1549,18 @@ class wxPyOnDemandOutputWindow: self.frame = None self.title = title + def SetParent(self, parent): self.parent = parent + def OnCloseWindow(self, event): if self.frame != None: self.frame.Destroy() self.frame = None self.text = None + # this provides the file-like behaviour def write(self, str): if not self.frame: @@ -1569,7 +1572,10 @@ class wxPyOnDemandOutputWindow: EVT_CLOSE(self.frame, self.OnCloseWindow) self.text.AppendText(str) + def close(self): + if self.frame != None: + self.frame.Destroy() self.frame = None self.text = None @@ -1605,19 +1611,22 @@ class wxApp(wxPyApp): def SetTopWindow(self, frame): if self.stdioWin: self.stdioWin.SetParent(frame) - sys.stdout = self.stdioWin #sys.stderr = + sys.stderr = sys.stdout = self.stdioWin wxPyApp.SetTopWindow(self, frame) + def MainLoop(self): wxPyApp.MainLoop(self) self.RestoreStdio() + def RedirectStdio(self, filename): if filename: sys.stdout = sys.stderr = open(filename, 'a') else: self.stdioWin = self.outputWindowClass() # wxPyOnDemandOutputWindow + def RestoreStdio(self): sys.stdout, sys.stderr = self.saveStdio if self.stdioWin != None: diff --git a/utils/wxPython/src/misc2.i b/utils/wxPython/src/misc2.i index cffc30fd28..efc53182e8 100644 --- a/utils/wxPython/src/misc2.i +++ b/utils/wxPython/src/misc2.i @@ -274,8 +274,10 @@ public: wxWindow *GetWindow(); %name(MoveXY)void Move(int x, int y); void Move(const wxPoint& pt); +#ifdef POST_2_1_12 %name(SetSizeWH) void SetSize(int width, int height); void SetSize(const wxSize& size); +#endif void Show(int show = TRUE); void Hide(); void OnSetFocus(); diff --git a/utils/wxPython/src/stattool.i b/utils/wxPython/src/stattool.i index c8987504ba..6f201f6a0f 100644 --- a/utils/wxPython/src/stattool.i +++ b/utils/wxPython/src/stattool.i @@ -272,7 +272,7 @@ public: const wxPoint& pos = wxPyDefaultPosition, const wxSize& size = wxPyDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr); + const char* name = wxToolBarNameStr); %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" @@ -289,7 +289,7 @@ public: const wxPoint& pos = wxPyDefaultPosition, const wxSize& size = wxPyDefaultSize, long style = wxNO_BORDER | wxTB_HORIZONTAL, - const wxString& name = wxToolBarNameStr); + const char* name = wxToolBarNameStr); %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" -- 2.45.2