reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-09-10 21:42:34 +00:00
parent 0320aeddcd
commit 1fbf26be16
10 changed files with 186 additions and 12 deletions

View File

@ -3138,6 +3138,10 @@ class Listbook(BookCtrl):
"""IsVertical(self) -> bool"""
return _controls_.Listbook_IsVertical(*args, **kwargs)
def GetListView(*args, **kwargs):
"""GetListView(self) -> ListView"""
return _controls_.Listbook_GetListView(*args, **kwargs)
class ListbookPtr(Listbook):
def __init__(self, this):

View File

@ -15768,6 +15768,32 @@ static PyObject *_wrap_Listbook_IsVertical(PyObject *, PyObject *args, PyObject
}
static PyObject *_wrap_Listbook_GetListView(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxListbook *arg1 = (wxListbook *) 0 ;
wxListView *result;
PyObject * obj0 = 0 ;
char *kwnames[] = {
(char *) "self", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Listbook_GetListView",kwnames,&obj0)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxListbook,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxListView *)(arg1)->GetListView();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxListView, 0);
return resultobj;
fail:
return NULL;
}
static PyObject * Listbook_swigregister(PyObject *, PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@ -31711,6 +31737,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"new_PreListbook", (PyCFunction) _wrap_new_PreListbook, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_Create", (PyCFunction) _wrap_Listbook_Create, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_IsVertical", (PyCFunction) _wrap_Listbook_IsVertical, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_GetListView", (PyCFunction) _wrap_Listbook_GetListView, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_swigregister", Listbook_swigregister, METH_VARARGS, NULL },
{ (char *)"new_ListbookEvent", (PyCFunction) _wrap_new_ListbookEvent, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"ListbookEvent_swigregister", ListbookEvent_swigregister, METH_VARARGS, NULL },

View File

@ -2304,7 +2304,7 @@ class Image(Object):
GetImageExtWildcard = staticmethod(GetImageExtWildcard)
def ConvertToBitmap(*args, **kwargs):
"""ConvertToBitmap(self) -> Bitmap"""
"""ConvertToBitmap(self, int depth=-1) -> Bitmap"""
return _core_.Image_ConvertToBitmap(*args, **kwargs)
def ConvertToMonoBitmap(*args, **kwargs):

View File

@ -1367,8 +1367,8 @@ SWIG_Check_unsigned_SS_long(PyObject* obj)
return SWIG_AsVal_unsigned_SS_long(obj, (unsigned long*)0);
}
wxBitmap wxImage_ConvertToBitmap(wxImage *self){
wxBitmap bitmap(*self);
wxBitmap wxImage_ConvertToBitmap(wxImage *self,int depth){
wxBitmap bitmap(*self, depth);
return bitmap;
}
wxBitmap wxImage_ConvertToMonoBitmap(wxImage *self,unsigned char red,unsigned char green,unsigned char blue){
@ -11487,19 +11487,25 @@ static PyObject *_wrap_Image_GetImageExtWildcard(PyObject *, PyObject *args, PyO
static PyObject *_wrap_Image_ConvertToBitmap(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ;
int arg2 = (int) -1 ;
wxBitmap result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char *kwnames[] = {
(char *) "self", NULL
(char *) "self",(char *) "depth", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Image_ConvertToBitmap",kwnames,&obj0)) goto fail;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Image_ConvertToBitmap",kwnames,&obj0,&obj1)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxImage,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
if (obj1) {
arg2 = (int)SWIG_As_int(obj1);
if (PyErr_Occurred()) SWIG_fail;
}
{
if (!wxPyCheckForApp()) SWIG_fail;
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = wxImage_ConvertToBitmap(arg1);
result = wxImage_ConvertToBitmap(arg1,arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;

View File

@ -147,6 +147,14 @@ class CalendarEvent(_core.CommandEvent):
"""GetWeekDay(self) -> int"""
return _calendar.CalendarEvent_GetWeekDay(*args, **kwargs)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetDate(_py2wx(date))
def PyGetDate(self):
"""returns datetime.date object"""
return _wx2py(self.GetDate())
class CalendarEventPtr(CalendarEvent):
def __init__(self, this):
@ -466,6 +474,35 @@ class CalendarCtrl(_core.Control):
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetDate(_py2wx(date))
def PyGetDate(self):
"""returns datetime.date object"""
return _wx2py(self.GetDate())
def PySetLowerDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetLowerDateLimit(_py2wx(date))
def PySetUpperDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetUpperDateLimit(_py2wx(date))
def PySetDateRange(self, lowerdate, upperdate):
"""takes datetime.datetime or datetime.date objects"""
self.PySetLowerDateLimit(lowerdate)
self.PySetUpperDateLimit(upperdate)
def PyGetLowerDateLimit(self):
"""returns datetime.date object"""
return _wx2py(self.GetLowerDateLimit())
def PyGetUpperDateLimit(self):
"""returns datetime.date object"""
return _wx2py(self.GetUpperDateLimit())
class CalendarCtrlPtr(CalendarCtrl):
def __init__(self, this):
@ -503,4 +540,17 @@ def CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs):
"""
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
def _py2wx(date):
import datetime
assert isinstance(date, (datetime.datetime, datetime.date))
tt = date.timetuple()
dmy = (tt[2], tt[1]-1, tt[0])
return wx.DateTimeFromDMY(*dmy)
def _wx2py(date):
import datetime
assert isinstance(date, wx.DateTime)
ymd = map(int, date.FormatISODate().split('-'))
return datetime.date(*ymd)

View File

@ -3150,6 +3150,10 @@ class Listbook(BookCtrl):
"""IsVertical(self) -> bool"""
return _controls_.Listbook_IsVertical(*args, **kwargs)
def GetListView(*args, **kwargs):
"""GetListView(self) -> ListView"""
return _controls_.Listbook_GetListView(*args, **kwargs)
class ListbookPtr(Listbook):
def __init__(self, this):

View File

@ -15863,6 +15863,32 @@ static PyObject *_wrap_Listbook_IsVertical(PyObject *, PyObject *args, PyObject
}
static PyObject *_wrap_Listbook_GetListView(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxListbook *arg1 = (wxListbook *) 0 ;
wxListView *result;
PyObject * obj0 = 0 ;
char *kwnames[] = {
(char *) "self", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Listbook_GetListView",kwnames,&obj0)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxListbook,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxListView *)(arg1)->GetListView();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxListView, 0);
return resultobj;
fail:
return NULL;
}
static PyObject * Listbook_swigregister(PyObject *, PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
@ -31990,6 +32016,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"new_PreListbook", (PyCFunction) _wrap_new_PreListbook, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_Create", (PyCFunction) _wrap_Listbook_Create, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_IsVertical", (PyCFunction) _wrap_Listbook_IsVertical, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_GetListView", (PyCFunction) _wrap_Listbook_GetListView, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"Listbook_swigregister", Listbook_swigregister, METH_VARARGS, NULL },
{ (char *)"new_ListbookEvent", (PyCFunction) _wrap_new_ListbookEvent, METH_VARARGS | METH_KEYWORDS, NULL },
{ (char *)"ListbookEvent_swigregister", ListbookEvent_swigregister, METH_VARARGS, NULL },

View File

@ -2304,7 +2304,7 @@ class Image(Object):
GetImageExtWildcard = staticmethod(GetImageExtWildcard)
def ConvertToBitmap(*args, **kwargs):
"""ConvertToBitmap(self) -> Bitmap"""
"""ConvertToBitmap(self, int depth=-1) -> Bitmap"""
return _core_.Image_ConvertToBitmap(*args, **kwargs)
def ConvertToMonoBitmap(*args, **kwargs):

View File

@ -1367,8 +1367,8 @@ SWIG_Check_unsigned_SS_long(PyObject* obj)
return SWIG_AsVal_unsigned_SS_long(obj, (unsigned long*)0);
}
wxBitmap wxImage_ConvertToBitmap(wxImage *self){
wxBitmap bitmap(*self);
wxBitmap wxImage_ConvertToBitmap(wxImage *self,int depth){
wxBitmap bitmap(*self, depth);
return bitmap;
}
wxBitmap wxImage_ConvertToMonoBitmap(wxImage *self,unsigned char red,unsigned char green,unsigned char blue){
@ -11485,19 +11485,25 @@ static PyObject *_wrap_Image_GetImageExtWildcard(PyObject *, PyObject *args, PyO
static PyObject *_wrap_Image_ConvertToBitmap(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ;
int arg2 = (int) -1 ;
wxBitmap result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
char *kwnames[] = {
(char *) "self", NULL
(char *) "self",(char *) "depth", NULL
};
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Image_ConvertToBitmap",kwnames,&obj0)) goto fail;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Image_ConvertToBitmap",kwnames,&obj0,&obj1)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxImage,
SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
if (obj1) {
arg2 = (int)SWIG_As_int(obj1);
if (PyErr_Occurred()) SWIG_fail;
}
{
if (!wxPyCheckForApp()) SWIG_fail;
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = wxImage_ConvertToBitmap(arg1);
result = wxImage_ConvertToBitmap(arg1,arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;

View File

@ -147,6 +147,14 @@ class CalendarEvent(_core.CommandEvent):
"""GetWeekDay(self) -> int"""
return _calendar.CalendarEvent_GetWeekDay(*args, **kwargs)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetDate(_py2wx(date))
def PyGetDate(self):
"""returns datetime.date object"""
return _wx2py(self.GetDate())
class CalendarEventPtr(CalendarEvent):
def __init__(self, this):
@ -466,6 +474,35 @@ class CalendarCtrl(_core.Control):
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
def PySetDate(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetDate(_py2wx(date))
def PyGetDate(self):
"""returns datetime.date object"""
return _wx2py(self.GetDate())
def PySetLowerDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetLowerDateLimit(_py2wx(date))
def PySetUpperDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetUpperDateLimit(_py2wx(date))
def PySetDateRange(self, lowerdate, upperdate):
"""takes datetime.datetime or datetime.date objects"""
self.PySetLowerDateLimit(lowerdate)
self.PySetUpperDateLimit(upperdate)
def PyGetLowerDateLimit(self):
"""returns datetime.date object"""
return _wx2py(self.GetLowerDateLimit())
def PyGetUpperDateLimit(self):
"""returns datetime.date object"""
return _wx2py(self.GetUpperDateLimit())
class CalendarCtrlPtr(CalendarCtrl):
def __init__(self, this):
@ -503,4 +540,17 @@ def CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs):
"""
return _calendar.CalendarCtrl_GetClassDefaultAttributes(*args, **kwargs)
def _py2wx(date):
import datetime
assert isinstance(date, (datetime.datetime, datetime.date))
tt = date.timetuple()
dmy = (tt[2], tt[1]-1, tt[0])
return wx.DateTimeFromDMY(*dmy)
def _wx2py(date):
import datetime
assert isinstance(date, wx.DateTime)
ymd = map(int, date.FormatISODate().split('-'))
return datetime.date(*ymd)