From 1dea0a08fe252ed54c725afa6d09f230470416b1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 12 Jun 2000 20:19:03 +0000 Subject: [PATCH] SWIGged code update git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/controls.cpp | 113 ++++++++++++++++++++++++++++++++- wxPython/src/gtk/controls.py | 14 ++++ wxPython/src/gtk/controls2.cpp | 2 + wxPython/src/gtk/controls2.py | 15 +++-- wxPython/src/gtk/windows.cpp | 58 +++++++++++++++++ wxPython/src/gtk/windows.py | 6 ++ wxPython/src/gtk/windows2.cpp | 7 ++ wxPython/src/gtk/windows2.py | 5 ++ 8 files changed, 214 insertions(+), 6 deletions(-) diff --git a/wxPython/src/gtk/controls.cpp b/wxPython/src/gtk/controls.cpp index 952696bdf2..108d47e6ad 100644 --- a/wxPython/src/gtk/controls.cpp +++ b/wxPython/src/gtk/controls.cpp @@ -56,6 +56,7 @@ extern PyObject *SWIG_newvarlink(void); #include "helpers.h" #include #include +#include #include #include //#include @@ -3262,7 +3263,7 @@ static PyObject * wxListBox_GetSelections(wxListBox *self) { wxArrayInt lst; self->GetSelections(lst); PyObject *tup = PyTuple_New(lst.GetCount()); - for(int i=0; i" % (self.this,) +class wxSpinCtrl(wxSpinCtrlPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(controlsc.new_wxSpinCtrl,_args,_kwargs) + self.thisown = 1 + + + + #-------------- FUNCTION WRAPPERS ------------------ diff --git a/wxPython/src/gtk/controls2.cpp b/wxPython/src/gtk/controls2.cpp index a4a5a5acc5..4389888fa7 100644 --- a/wxPython/src/gtk/controls2.cpp +++ b/wxPython/src/gtk/controls2.cpp @@ -7712,6 +7712,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -7808,6 +7809,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, diff --git a/wxPython/src/gtk/controls2.py b/wxPython/src/gtk/controls2.py index 7aac28d7c2..bf8d4e24bb 100644 --- a/wxPython/src/gtk/controls2.py +++ b/wxPython/src/gtk/controls2.py @@ -769,14 +769,19 @@ class wxTreeCtrlPtr(wxControlPtr): def __repr__(self): return "" % (self.this,) - # Redefine a couple methods that SWIG gets a bit confused on... - def GetFirstChild(self,arg0,arg1): - val1, val2 = controls2c.wxTreeCtrl_GetFirstChild(self.this,arg0.this,arg1) + # Redefine some methods that SWIG gets a bit confused on... + def GetFirstChild(self, *_args, **_kwargs): + val1,val2 = apply(controls2c.wxTreeCtrl_GetFirstChild,(self,) + _args, _kwargs) val1 = wxTreeItemIdPtr(val1) val1.thisown = 1 return (val1,val2) - def GetNextChild(self,arg0,arg1): - val1, val2 = controls2c.wxTreeCtrl_GetNextChild(self.this,arg0.this,arg1) + def GetNextChild(self, *_args, **_kwargs): + val1,val2 = apply(controls2c.wxTreeCtrl_GetNextChild,(self,) + _args, _kwargs) + val1 = wxTreeItemIdPtr(val1) + val1.thisown = 1 + return (val1,val2) + def HitTest(self, *_args, **_kwargs): + val1, val2 = apply(controls2c.wxTreeCtrl_HitTest,(self,) + _args, _kwargs) val1 = wxTreeItemIdPtr(val1) val1.thisown = 1 return (val1,val2) diff --git a/wxPython/src/gtk/windows.cpp b/wxPython/src/gtk/windows.cpp index c11fd288ed..0a8ad644a4 100644 --- a/wxPython/src/gtk/windows.cpp +++ b/wxPython/src/gtk/windows.cpp @@ -2376,6 +2376,62 @@ static PyObject *_wrap_wxWindow_GetWindowStyleFlag(PyObject *self, PyObject *arg return _resultobj; } +#define wxWindow_SetWindowStyleFlag(_swigobj,_swigarg0) (_swigobj->SetWindowStyleFlag(_swigarg0)) +static PyObject *_wrap_wxWindow_SetWindowStyleFlag(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","style", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxWindow_SetWindowStyleFlag",_kwnames,&_argo0,&_arg1)) + 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_SetWindowStyleFlag. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_SetWindowStyleFlag(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_SetWindowStyle(_swigobj,_swigarg0) (_swigobj->SetWindowStyle(_swigarg0)) +static PyObject *_wrap_wxWindow_SetWindowStyle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","style", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxWindow_SetWindowStyle",_kwnames,&_argo0,&_arg1)) + 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_SetWindowStyle. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_SetWindowStyle(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_Hide(_swigobj) (_swigobj->Hide()) static PyObject *_wrap_wxWindow_Hide(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -8966,6 +9022,8 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_IsEnabled", (PyCFunction) _wrap_wxWindow_IsEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_InitDialog", (PyCFunction) _wrap_wxWindow_InitDialog, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Hide", (PyCFunction) _wrap_wxWindow_Hide, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetWindowStyle", (PyCFunction) _wrap_wxWindow_SetWindowStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetWindowStyleFlag", (PyCFunction) _wrap_wxWindow_SetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetWindowStyleFlag", (PyCFunction) _wrap_wxWindow_GetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetUpdateRegion", (PyCFunction) _wrap_wxWindow_GetUpdateRegion, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetTitle", (PyCFunction) _wrap_wxWindow_GetTitle, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py index 2734a30a05..a8cb065cdf 100644 --- a/wxPython/src/gtk/windows.py +++ b/wxPython/src/gtk/windows.py @@ -259,6 +259,12 @@ class wxWindowPtr(wxEvtHandlerPtr): def GetWindowStyleFlag(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetWindowStyleFlag,(self,) + _args, _kwargs) return val + def SetWindowStyleFlag(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetWindowStyleFlag,(self,) + _args, _kwargs) + return val + def SetWindowStyle(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetWindowStyle,(self,) + _args, _kwargs) + return val def Hide(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Hide,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/gtk/windows2.cpp b/wxPython/src/gtk/windows2.cpp index d0aac0be81..5e5135d448 100644 --- a/wxPython/src/gtk/windows2.cpp +++ b/wxPython/src/gtk/windows2.cpp @@ -1753,6 +1753,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -1848,6 +1849,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, @@ -2083,6 +2085,11 @@ SWIGEXPORT(void) initwindows2c() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("windows2c", windows2cMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxSPLIT_HORIZONTAL", PyInt_FromLong((long) wxSPLIT_HORIZONTAL)); + PyDict_SetItemString(d,"wxSPLIT_VERTICAL", PyInt_FromLong((long) wxSPLIT_VERTICAL)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_NONE", PyInt_FromLong((long) wxSPLIT_DRAG_NONE)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_DRAGGING", PyInt_FromLong((long) wxSPLIT_DRAG_DRAGGING)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_LEFT_DOWN", PyInt_FromLong((long) wxSPLIT_DRAG_LEFT_DOWN)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/gtk/windows2.py b/wxPython/src/gtk/windows2.py index cb5e92e651..54181fb2c6 100644 --- a/wxPython/src/gtk/windows2.py +++ b/wxPython/src/gtk/windows2.py @@ -214,3 +214,8 @@ class wxSplitterWindow(wxSplitterWindowPtr): #-------------- VARIABLE WRAPPERS ------------------ +wxSPLIT_HORIZONTAL = windows2c.wxSPLIT_HORIZONTAL +wxSPLIT_VERTICAL = windows2c.wxSPLIT_VERTICAL +wxSPLIT_DRAG_NONE = windows2c.wxSPLIT_DRAG_NONE +wxSPLIT_DRAG_DRAGGING = windows2c.wxSPLIT_DRAG_DRAGGING +wxSPLIT_DRAG_LEFT_DOWN = windows2c.wxSPLIT_DRAG_LEFT_DOWN