]> git.saurik.com Git - wxWidgets.git/commitdiff
reSWIGged
authorRobin Dunn <robin@alldunn.com>
Fri, 10 Sep 2004 21:42:34 +0000 (21:42 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 10 Sep 2004 21:42:34 +0000 (21:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/gtk/_controls.py
wxPython/src/gtk/_controls_wrap.cpp
wxPython/src/gtk/_core.py
wxPython/src/gtk/_core_wrap.cpp
wxPython/src/gtk/calendar.py
wxPython/src/msw/_controls.py
wxPython/src/msw/_controls_wrap.cpp
wxPython/src/msw/_core.py
wxPython/src/msw/_core_wrap.cpp
wxPython/src/msw/calendar.py

index 69514ff5ece253747ac6002da5eb25553b912277..961b0d9868eec5aff2d44f9bac8e338d4b885e24 100644 (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):
index 39fe6258d64013ccabc0380df3b31f69a26f747b..6c92f57d8b1ba6e0325a921c6cfc9f9a4ad9974b 100644 (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 },
index 76190484cf8a20e8f002c96de47384b50c60df22..7e40ca8240f13b53a7ef45030a142376402e2cd1 100644 (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):
index b8fef9f30574f9d461a22b9c954f179fab54b381..81d329267c9d22a1a06f3ce96b3374d04ea89820 100644 (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;
index 8680354bb4e433769310f13f729a5c66e0e65a7a..64a43d13f848f060b7feca9b2c180144fedbb564 100644 (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)
+
 
index 2f9bba1b8c93b46b3d20423f24710424169666f3..7aed3d7d7bafa37a1782fe56c98886ae6a9c9f54 100644 (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):
index a06f7a3426ffa4ccc399d4fb6e352690c711cfe1..91b8aa4d9e70ff2cae6709ef0d9873ce518fad89 100644 (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 },
index cb05e66b3c0d907d5a867eb27514502fe19ee5fc..ccf6b4608dcc12e6b37b15f778dfabd9a3bf0abb 100644 (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):
index 45ec873828bd065f2888bd0768018834deb8f085..aa1fa209ce6304a2b86012331a15bce204e8dc7e 100644 (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;
index 8680354bb4e433769310f13f729a5c66e0e65a7a..64a43d13f848f060b7feca9b2c180144fedbb564 100644 (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)
+