SWIGged updates for wxGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-01-29 03:25:35 +00:00
parent e05d0c18a6
commit 095038b75b
5 changed files with 126 additions and 15 deletions

View File

@@ -282,3 +282,4 @@ wxEVT_CALENDAR_WEEKDAY_CLICKED = calendarc.wxEVT_CALENDAR_WEEKDAY_CLICKED
# Stuff these names into the wx namespace so wxPyConstructObject can find them # Stuff these names into the wx namespace so wxPyConstructObject can find them
wx.wxCalendarEventPtr = wxCalendarEventPtr wx.wxCalendarEventPtr = wxCalendarEventPtr
wx.wxCalendarCtrlPtr = wxCalendarCtrlPtr

View File

@@ -260,9 +260,12 @@ class wxColourPtr(wxObjectPtr):
def __repr__(self): def __repr__(self):
return "<C wxColour instance at %s>" % (self.this,) return "<C wxColour instance at %s>" % (self.this,)
asTuple = Get asTuple = Get
def __str__(self): return str(self.asTuple()) def __str__(self): return str(self.asTuple())
def __repr__(self): return 'wxColour: ' + str(self.asTuple()) def __repr__(self): return 'wxColour: ' + str(self.asTuple())
def __nonzero__(self): return self.Ok() def __nonzero__(self): return self.Ok()
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
class wxColour(wxColourPtr): class wxColour(wxColourPtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):

View File

@@ -2245,7 +2245,7 @@ static PyObject *_wrap_new_wxRect(PyObject *self, PyObject *args, PyObject *kwar
int _arg1 = (int ) 0; int _arg1 = (int ) 0;
int _arg2 = (int ) 0; int _arg2 = (int ) 0;
int _arg3 = (int ) 0; int _arg3 = (int ) 0;
char *_kwnames[] = { "x","y","w","h", NULL }; char *_kwnames[] = { "x","y","width","height", NULL };
char _ptemp[128]; char _ptemp[128];
self = self; self = self;
@@ -3140,6 +3140,42 @@ static PyObject *_wrap_wxRect_height_get(PyObject *self, PyObject *args, PyObjec
return _resultobj; return _resultobj;
} }
static void wxRect_Set(wxRect *self,int x,int y,int width,int height) {
self->x = x;
self->y = y;
self->width = width;
self->height = height;
}
static PyObject *_wrap_wxRect_Set(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxRect * _arg0;
int _arg1 = (int ) 0;
int _arg2 = (int ) 0;
int _arg3 = (int ) 0;
int _arg4 = (int ) 0;
wxRect temp;
PyObject * _obj0 = 0;
char *_kwnames[] = { "self","x","y","width","height", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iiii:wxRect_Set",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3,&_arg4))
return NULL;
{
_arg0 = &temp;
if (! wxRect_helper(_obj0, &_arg0))
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxRect_Set(_arg0,_arg1,_arg2,_arg3,_arg4);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static PyObject * wxRect_asTuple(wxRect *self) { static PyObject * wxRect_asTuple(wxRect *self) {
wxPyBeginBlockThreads(); wxPyBeginBlockThreads();
PyObject* tup = PyTuple_New(4); PyObject* tup = PyTuple_New(4);
@@ -3843,6 +3879,38 @@ static PyObject *_wrap_wxPoint2DDouble_GetCrossProduct(PyObject *self, PyObject
return _resultobj; return _resultobj;
} }
static void wxPoint2DDouble_Set(wxPoint2DDouble *self,double x,double y) {
self->m_x = x;
self->m_y = y;
}
static PyObject *_wrap_wxPoint2DDouble_Set(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPoint2DDouble * _arg0;
double _arg1 = (double ) 0;
double _arg2 = (double ) 0;
wxPoint2DDouble temp;
PyObject * _obj0 = 0;
char *_kwnames[] = { "self","x","y", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|dd:wxPoint2DDouble_Set",_kwnames,&_obj0,&_arg1,&_arg2))
return NULL;
{
_arg0 = &temp;
if (! wxPoint2DDouble_helper(_obj0, &_arg0))
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxPoint2DDouble_Set(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static wxPoint2DDouble wxPoint2DDouble___neg__(wxPoint2DDouble *self) { return -(*self); } static wxPoint2DDouble wxPoint2DDouble___neg__(wxPoint2DDouble *self) { return -(*self); }
static PyObject *_wrap_wxPoint2DDouble___neg__(PyObject *self, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_wxPoint2DDouble___neg__(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -5200,6 +5268,7 @@ static PyMethodDef misccMethods[] = {
{ "wxPoint2DDouble___isub__", (PyCFunction) _wrap_wxPoint2DDouble___isub__, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble___isub__", (PyCFunction) _wrap_wxPoint2DDouble___isub__, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble___iadd__", (PyCFunction) _wrap_wxPoint2DDouble___iadd__, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble___iadd__", (PyCFunction) _wrap_wxPoint2DDouble___iadd__, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble___neg__", (PyCFunction) _wrap_wxPoint2DDouble___neg__, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble___neg__", (PyCFunction) _wrap_wxPoint2DDouble___neg__, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble_Set", (PyCFunction) _wrap_wxPoint2DDouble_Set, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble_GetCrossProduct", (PyCFunction) _wrap_wxPoint2DDouble_GetCrossProduct, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble_GetCrossProduct", (PyCFunction) _wrap_wxPoint2DDouble_GetCrossProduct, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble_GetDotProduct", (PyCFunction) _wrap_wxPoint2DDouble_GetDotProduct, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble_GetDotProduct", (PyCFunction) _wrap_wxPoint2DDouble_GetDotProduct, METH_VARARGS | METH_KEYWORDS },
{ "wxPoint2DDouble_GetDistanceSquare", (PyCFunction) _wrap_wxPoint2DDouble_GetDistanceSquare, METH_VARARGS | METH_KEYWORDS }, { "wxPoint2DDouble_GetDistanceSquare", (PyCFunction) _wrap_wxPoint2DDouble_GetDistanceSquare, METH_VARARGS | METH_KEYWORDS },
@@ -5225,6 +5294,7 @@ static PyMethodDef misccMethods[] = {
{ "wxRect___eq__", (PyCFunction) _wrap_wxRect___eq__, METH_VARARGS | METH_KEYWORDS }, { "wxRect___eq__", (PyCFunction) _wrap_wxRect___eq__, METH_VARARGS | METH_KEYWORDS },
{ "wxRect___add__", (PyCFunction) _wrap_wxRect___add__, METH_VARARGS | METH_KEYWORDS }, { "wxRect___add__", (PyCFunction) _wrap_wxRect___add__, METH_VARARGS | METH_KEYWORDS },
{ "wxRect_asTuple", (PyCFunction) _wrap_wxRect_asTuple, METH_VARARGS | METH_KEYWORDS }, { "wxRect_asTuple", (PyCFunction) _wrap_wxRect_asTuple, METH_VARARGS | METH_KEYWORDS },
{ "wxRect_Set", (PyCFunction) _wrap_wxRect_Set, METH_VARARGS | METH_KEYWORDS },
{ "wxRect_height_get", (PyCFunction) _wrap_wxRect_height_get, METH_VARARGS | METH_KEYWORDS }, { "wxRect_height_get", (PyCFunction) _wrap_wxRect_height_get, METH_VARARGS | METH_KEYWORDS },
{ "wxRect_height_set", (PyCFunction) _wrap_wxRect_height_set, METH_VARARGS | METH_KEYWORDS }, { "wxRect_height_set", (PyCFunction) _wrap_wxRect_height_set, METH_VARARGS | METH_KEYWORDS },
{ "wxRect_width_get", (PyCFunction) _wrap_wxRect_width_get, METH_VARARGS | METH_KEYWORDS }, { "wxRect_width_get", (PyCFunction) _wrap_wxRect_width_get, METH_VARARGS | METH_KEYWORDS },

View File

@@ -91,7 +91,10 @@ class wxSizePtr :
if index == 0: self.width = val if index == 0: self.width = val
elif index == 1: self.height = val elif index == 1: self.height = val
else: raise IndexError else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0) def __nonzero__(self): return self.asTuple() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
class wxSize(wxSizePtr): class wxSize(wxSizePtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):
@@ -154,6 +157,9 @@ class wxRealPointPtr :
elif index == 1: self.height = val elif index == 1: self.height = val
else: raise IndexError else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0.0, 0.0) def __nonzero__(self): return self.asTuple() != (0.0, 0.0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
class wxRealPoint(wxRealPointPtr): class wxRealPoint(wxRealPointPtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):
@@ -216,6 +222,9 @@ class wxPointPtr :
elif index == 1: self.y = val elif index == 1: self.y = val
else: raise IndexError else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0) def __nonzero__(self): return self.asTuple() != (0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
class wxPoint(wxPointPtr): class wxPoint(wxPointPtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):
@@ -300,6 +309,9 @@ class wxRectPtr :
def Inside(self, *_args, **_kwargs): def Inside(self, *_args, **_kwargs):
val = apply(miscc.wxRect_Inside,(self,) + _args, _kwargs) val = apply(miscc.wxRect_Inside,(self,) + _args, _kwargs)
return val return val
def Set(self, *_args, **_kwargs):
val = apply(miscc.wxRect_Set,(self,) + _args, _kwargs)
return val
def asTuple(self, *_args, **_kwargs): def asTuple(self, *_args, **_kwargs):
val = apply(miscc.wxRect_asTuple,(self,) + _args, _kwargs) val = apply(miscc.wxRect_asTuple,(self,) + _args, _kwargs)
return val return val
@@ -350,7 +362,10 @@ class wxRectPtr :
elif index == 2: self.width = val elif index == 2: self.width = val
elif index == 3: self.height = val elif index == 3: self.height = val
else: raise IndexError else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0,0,0,0) def __nonzero__(self): return self.asTuple() != (0,0,0,0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
# override the __getattr__ made by SWIG # override the __getattr__ made by SWIG
def __getattr__(self, name): def __getattr__(self, name):
@@ -431,6 +446,9 @@ class wxPoint2DDoublePtr :
def GetCrossProduct(self, *_args, **_kwargs): def GetCrossProduct(self, *_args, **_kwargs):
val = apply(miscc.wxPoint2DDouble_GetCrossProduct,(self,) + _args, _kwargs) val = apply(miscc.wxPoint2DDouble_GetCrossProduct,(self,) + _args, _kwargs)
return val return val
def Set(self, *_args, **_kwargs):
val = apply(miscc.wxPoint2DDouble_Set,(self,) + _args, _kwargs)
return val
def __neg__(self, *_args, **_kwargs): def __neg__(self, *_args, **_kwargs):
val = apply(miscc.wxPoint2DDouble___neg__,(self,) + _args, _kwargs) val = apply(miscc.wxPoint2DDouble___neg__,(self,) + _args, _kwargs)
if val: val = wxPoint2DDoublePtr(val) ; val.thisown = 1 if val: val = wxPoint2DDoublePtr(val) ; val.thisown = 1
@@ -502,7 +520,10 @@ class wxPoint2DDoublePtr :
if index == 0: self.m_x = val if index == 0: self.m_x = val
elif index == 1: self.m_yt = val elif index == 1: self.m_yt = val
else: raise IndexError else: raise IndexError
def __nonzero__(self): return self.asTuple() != (0.0, 0.0) def __nonzero__(self): return self.asTuple() != (0.0, 0.0)
def __getinitargs__(self): return ()
def __getstate__(self): return self.asTuple()
def __setstate__(self, state): self.Set(*state)
class wxPoint2DDouble(wxPoint2DDoublePtr): class wxPoint2DDouble(wxPoint2DDoublePtr):
def __init__(self,*_args,**_kwargs): def __init__(self,*_args,**_kwargs):

View File

@@ -236,32 +236,40 @@ class wxSizerPtr(wxObjectPtr):
apply(self.AddSpacer, args, kw) apply(self.AddSpacer, args, kw)
elif isinstance(args[0], wxSizerPtr): elif isinstance(args[0], wxSizerPtr):
apply(self.AddSizer, args, kw) apply(self.AddSizer, args, kw)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.AddWindow, args, kw) apply(self.AddWindow, args, kw)
else:
raise TypeError, 'Expected int, wxSizer or wxWindow parameter'
def Insert(self, *args, **kw): def Insert(self, *args, **kw):
if type(args[1]) == type(1): if type(args[1]) == type(1):
apply(self.InsertSpacer, args, kw) apply(self.InsertSpacer, args, kw)
elif isinstance(args[0], wxSizerPtr): elif isinstance(args[0], wxSizerPtr):
apply(self.InsertSizer, args, kw) apply(self.InsertSizer, args, kw)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.InsertWindow, args, kw) apply(self.InsertWindow, args, kw)
else:
raise TypeError, 'Expected int, wxSizer or wxWindow parameter'
def Prepend(self, *args, **kw): def Prepend(self, *args, **kw):
if type(args[0]) == type(1): if type(args[0]) == type(1):
apply(self.PrependSpacer, args, kw) apply(self.PrependSpacer, args, kw)
elif isinstance(args[0], wxSizerPtr): elif isinstance(args[0], wxSizerPtr):
apply(self.PrependSizer, args, kw) apply(self.PrependSizer, args, kw)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.PrependWindow, args, kw) apply(self.PrependWindow, args, kw)
else:
raise TypeError, 'Expected int, wxSizer or wxWindow parameter'
def Remove(self, *args, **kw): def Remove(self, *args, **kw):
if type(args[0]) == type(1): if type(args[0]) == type(1):
return apply(self.RemovePos, args, kw) return apply(self.RemovePos, args, kw)
elif isinstance(args[0], wxSizerPtr): elif isinstance(args[0], wxSizerPtr):
return apply(self.RemoveSizer, args, kw) return apply(self.RemoveSizer, args, kw)
else: elif isinstance(args[0], wxWindowPtr):
return apply(self.RemoveWindow, args, kw) return apply(self.RemoveWindow, args, kw)
else:
raise TypeError, 'Expected int, wxSizer or wxWindow parameter'
def AddMany(self, widgets): def AddMany(self, widgets):
for childinfo in widgets: for childinfo in widgets:
@@ -275,8 +283,10 @@ class wxSizerPtr(wxObjectPtr):
apply(self.SetItemMinSizePos, args) apply(self.SetItemMinSizePos, args)
elif isinstance(args[0], wxSizerPtr): elif isinstance(args[0], wxSizerPtr):
apply(self.SetItemMinSizeSizer, args) apply(self.SetItemMinSizeSizer, args)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.SetItemMinSizeWindow, args) apply(self.SetItemMinSizeWindow, args)
else:
raise TypeError, 'Expected int, wxSizer or wxWindow parameter'
def GetSizeTuple(self): def GetSizeTuple(self):
@@ -290,20 +300,26 @@ class wxSizerPtr(wxObjectPtr):
def Show(self, *args): def Show(self, *args):
if isinstance(args[0], wxSizerPtr): if isinstance(args[0], wxSizerPtr):
apply(self.ShowSizer, args) apply(self.ShowSizer, args)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.ShowWindow, args) apply(self.ShowWindow, args)
else:
raise TypeError, 'Expected wxSizer or wxWindow parameter'
def Hide(self, *args): def Hide(self, *args):
if isinstance(args[0], wxSizerPtr): if isinstance(args[0], wxSizerPtr):
apply(self.HideSizer, args) apply(self.HideSizer, args)
else: elif isinstance(args[0], wxWindowPtr):
apply(self.HideWindow, args) apply(self.HideWindow, args)
else:
raise TypeError, 'Expected wxSizer or wxWindow parameter'
def IsShown(self, *args): def IsShown(self, *args):
if isinstance(args[0], wxSizerPtr): if isinstance(args[0], wxSizerPtr):
return apply(self.IsShownSizer, args) return apply(self.IsShownSizer, args)
else: elif isinstance(args[0], wxWindowPtr):
return apply(self.IsShownWindow, args) return apply(self.IsShownWindow, args)
else:
raise TypeError, 'Expected wxSizer or wxWindow parameter'
class wxSizer(wxSizerPtr): class wxSizer(wxSizerPtr):
def __init__(self,this): def __init__(self,this):