From 98e665d3b02207e8e3dcddd210926a51c04305e4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 14 Feb 2004 03:17:53 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/gtk/calendar.py | 213 ++++++++++++++++++----- wxPython/src/gtk/calendar_wrap.cpp | 265 +++++++++-------------------- wxPython/src/gtk/controls.py | 10 +- wxPython/src/gtk/core.py | 6 +- wxPython/src/gtk/misc.py | 5 +- wxPython/src/gtk/misc_wrap.cpp | 15 ++ wxPython/src/mac/calendar.py | 213 ++++++++++++++++++----- wxPython/src/mac/calendar_wrap.cpp | 265 +++++++++-------------------- wxPython/src/mac/controls.py | 10 +- wxPython/src/mac/core.py | 6 +- wxPython/src/mac/misc.py | 5 +- wxPython/src/mac/misc_wrap.cpp | 15 ++ wxPython/src/msw/calendar.py | 213 ++++++++++++++++++----- wxPython/src/msw/calendar_wrap.cpp | 265 +++++++++-------------------- wxPython/src/msw/controls.py | 18 +- wxPython/src/msw/controls_wrap.cpp | 68 -------- wxPython/src/msw/core.py | 6 +- wxPython/src/msw/misc.py | 5 +- wxPython/src/msw/misc_wrap.cpp | 15 ++ wxPython/wxPython/calendar.py | 1 - wxPython/wxPython/misc.py | 1 + 21 files changed, 835 insertions(+), 785 deletions(-) diff --git a/wxPython/src/gtk/calendar.py b/wxPython/src/gtk/calendar.py index 46eef2f4d6..d9b21268e9 100644 --- a/wxPython/src/gtk/calendar.py +++ b/wxPython/src/gtk/calendar.py @@ -23,13 +23,19 @@ CAL_BORDER_NONE = _calendar.CAL_BORDER_NONE CAL_BORDER_SQUARE = _calendar.CAL_BORDER_SQUARE CAL_BORDER_ROUND = _calendar.CAL_BORDER_ROUND class CalendarDateAttr(object): + """ + A set of customization attributes for a calendar date, which can be used to + control the look of the Calendar object. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Colour colText, Colour colBack=wxNullColour, Colour colBorder=wxNullColour, - Font font=wxNullFont, + __init__(Colour colText=wxNullColour, Colour colBack=wxNullColour, + Colour colBorder=wxNullColour, Font font=wxNullFont, int border=CAL_BORDER_NONE) -> CalendarDateAttr + + Create a CalendarDateAttr. """ newobj = _calendar.new_CalendarDateAttr(*args, **kwargs) self.this = newobj.this @@ -111,12 +117,6 @@ class CalendarDateAttrPtr(CalendarDateAttr): self.__class__ = CalendarDateAttr _calendar.CalendarDateAttr_swigregister(CalendarDateAttrPtr) -def CalendarDateAttrBorder(*args, **kwargs): - """CalendarDateAttrBorder(int border, Colour colBorder=wxNullColour) -> CalendarDateAttr""" - val = _calendar.new_CalendarDateAttrBorder(*args, **kwargs) - val.thisown = 1 - return val - class CalendarEvent(core.CommandEvent): def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -164,14 +164,17 @@ EVT_CALENDAR_YEAR = wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1) EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1) class CalendarCtrl(core.Control): + """The calendar control allows the user to pick a date interactively.""" def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, int id, DateTime date=wxDefaultDateTime, + __init__(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> CalendarCtrl + + Create and show a calendar control. """ newobj = _calendar.new_CalendarCtrl(*args, **kwargs) self.this = newobj.this @@ -181,123 +184,235 @@ class CalendarCtrl(core.Control): def Create(*args, **kwargs): """ - Create(Window parent, int id, DateTime date=wxDefaultDateTime, + Create(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool + + Acutally create the GUI portion of the CalendarCtrl for 2-phase creation. """ return _calendar.CalendarCtrl_Create(*args, **kwargs) def SetDate(*args, **kwargs): - """SetDate(DateTime date)""" + """ + SetDate(DateTime date) + + Sets the current date. + """ return _calendar.CalendarCtrl_SetDate(*args, **kwargs) def GetDate(*args, **kwargs): - """GetDate() -> DateTime""" + """ + GetDate() -> DateTime + + Gets the currently selected date. + """ return _calendar.CalendarCtrl_GetDate(*args, **kwargs) def SetLowerDateLimit(*args, **kwargs): - """SetLowerDateLimit(DateTime date=wxDefaultDateTime) -> bool""" - return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) + """ + SetLowerDateLimit(DateTime date=DefaultDateTime) -> bool - def GetLowerDateLimit(*args, **kwargs): - """GetLowerDateLimit() -> DateTime""" - return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + set the range in which selection can occur + """ + return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) def SetUpperDateLimit(*args, **kwargs): - """SetUpperDateLimit(DateTime date=wxDefaultDateTime) -> bool""" + """ + SetUpperDateLimit(DateTime date=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetUpperDateLimit(*args, **kwargs) + def GetLowerDateLimit(*args, **kwargs): + """ + GetLowerDateLimit() -> DateTime + + get the range in which selection can occur + """ + return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + def GetUpperDateLimit(*args, **kwargs): - """GetUpperDateLimit() -> DateTime""" + """ + GetUpperDateLimit() -> DateTime + + get the range in which selection can occur + """ return _calendar.CalendarCtrl_GetUpperDateLimit(*args, **kwargs) def SetDateRange(*args, **kwargs): - """SetDateRange(DateTime lowerdate=wxDefaultDateTime, DateTime upperdate=wxDefaultDateTime) -> bool""" + """ + SetDateRange(DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetDateRange(*args, **kwargs) def EnableYearChange(*args, **kwargs): - """EnableYearChange(bool enable=True)""" + """ + EnableYearChange(bool enable=True) + + This function should be used instead of changing CAL_NO_YEAR_CHANGE + style bit directly. It allows or disallows the user to change the year + interactively. + """ return _calendar.CalendarCtrl_EnableYearChange(*args, **kwargs) def EnableMonthChange(*args, **kwargs): - """EnableMonthChange(bool enable=True)""" + """ + EnableMonthChange(bool enable=True) + + This function should be used instead of changing CAL_NO_MONTH_CHANGE style + bit. It allows or disallows the user to change the month interactively. Note + that if the month can not be changed, the year can not be changed either. + """ return _calendar.CalendarCtrl_EnableMonthChange(*args, **kwargs) def EnableHolidayDisplay(*args, **kwargs): - """EnableHolidayDisplay(bool display=True)""" + """ + EnableHolidayDisplay(bool display=True) + + This function should be used instead of changing CAL_SHOW_HOLIDAYS style + bit directly. It enables or disables the special highlighting of the holidays. + """ return _calendar.CalendarCtrl_EnableHolidayDisplay(*args, **kwargs) def SetHeaderColours(*args, **kwargs): - """SetHeaderColours(Colour colFg, Colour colBg)""" + """ + SetHeaderColours(Colour colFg, Colour colBg) + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_SetHeaderColours(*args, **kwargs) def GetHeaderColourFg(*args, **kwargs): - """GetHeaderColourFg() -> Colour""" + """ + GetHeaderColourFg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourFg(*args, **kwargs) def GetHeaderColourBg(*args, **kwargs): - """GetHeaderColourBg() -> Colour""" + """ + GetHeaderColourBg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourBg(*args, **kwargs) def SetHighlightColours(*args, **kwargs): - """SetHighlightColours(Colour colFg, Colour colBg)""" + """ + SetHighlightColours(Colour colFg, Colour colBg) + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_SetHighlightColours(*args, **kwargs) def GetHighlightColourFg(*args, **kwargs): - """GetHighlightColourFg() -> Colour""" + """ + GetHighlightColourFg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourFg(*args, **kwargs) def GetHighlightColourBg(*args, **kwargs): - """GetHighlightColourBg() -> Colour""" + """ + GetHighlightColourBg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourBg(*args, **kwargs) def SetHolidayColours(*args, **kwargs): - """SetHolidayColours(Colour colFg, Colour colBg)""" + """ + SetHolidayColours(Colour colFg, Colour colBg) + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_SetHolidayColours(*args, **kwargs) def GetHolidayColourFg(*args, **kwargs): - """GetHolidayColourFg() -> Colour""" + """ + GetHolidayColourFg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourFg(*args, **kwargs) def GetHolidayColourBg(*args, **kwargs): - """GetHolidayColourBg() -> Colour""" + """ + GetHolidayColourBg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourBg(*args, **kwargs) def GetAttr(*args, **kwargs): - """GetAttr(size_t day) -> CalendarDateAttr""" + """ + GetAttr(size_t day) -> CalendarDateAttr + + Returns the attribute for the given date (should be in the range 1...31). + The returned value may be None + """ return _calendar.CalendarCtrl_GetAttr(*args, **kwargs) def SetAttr(*args, **kwargs): - """SetAttr(size_t day, CalendarDateAttr attr)""" + """ + SetAttr(size_t day, CalendarDateAttr attr) + + Associates the attribute with the specified date (in the range 1...31). + If the attribute passed is None, the items attribute is cleared. + """ return _calendar.CalendarCtrl_SetAttr(*args, **kwargs) def SetHoliday(*args, **kwargs): - """SetHoliday(size_t day)""" + """ + SetHoliday(size_t day) + + Marks the specified day as being a holiday in the current month. + """ return _calendar.CalendarCtrl_SetHoliday(*args, **kwargs) def ResetAttr(*args, **kwargs): - """ResetAttr(size_t day)""" + """ + ResetAttr(size_t day) + + Clears any attributes associated with the given day (in the range 1...31). + """ return _calendar.CalendarCtrl_ResetAttr(*args, **kwargs) def HitTest(*args, **kwargs): - """HitTest(Point pos, DateTime date=None, int wd=None) -> int""" - return _calendar.CalendarCtrl_HitTest(*args, **kwargs) + """ + HitTest(Point pos) -> (result, date, weekday) + + Returns 3-tuple with information about the given position on the calendar + control. The first value of the tuple is a result code and determines the + validity of the remaining two values. The result codes are: - def Enable(*args, **kwargs): - """Enable(bool enable=True) -> bool""" - return _calendar.CalendarCtrl_Enable(*args, **kwargs) + CAL_HITTEST_NOWHERE: hit outside of anything + CAL_HITTEST_HEADER: hit on the header, weekday is valid + CAL_HITTEST_DAY: hit on a day in the calendar, date is set. - def Show(*args, **kwargs): - """Show(bool show=True) -> bool""" - return _calendar.CalendarCtrl_Show(*args, **kwargs) + """ + return _calendar.CalendarCtrl_HitTest(*args, **kwargs) def GetMonthControl(*args, **kwargs): - """GetMonthControl() -> Control""" + """ + GetMonthControl() -> Control + + get the currently shown control for month + """ return _calendar.CalendarCtrl_GetMonthControl(*args, **kwargs) def GetYearControl(*args, **kwargs): - """GetYearControl() -> Control""" + """ + GetYearControl() -> Control + + get the currently shown control for year + """ return _calendar.CalendarCtrl_GetYearControl(*args, **kwargs) @@ -311,7 +426,11 @@ cvar = _calendar.cvar CalendarNameStr = cvar.CalendarNameStr def PreCalendarCtrl(*args, **kwargs): - """PreCalendarCtrl() -> CalendarCtrl""" + """ + PreCalendarCtrl() -> CalendarCtrl + + Precreate a CalendarCtrl for 2-phase creation. + """ val = _calendar.new_PreCalendarCtrl(*args, **kwargs) val.thisown = 1 return val diff --git a/wxPython/src/gtk/calendar_wrap.cpp b/wxPython/src/gtk/calendar_wrap.cpp index 69e77444a6..df372cf600 100644 --- a/wxPython/src/gtk/calendar_wrap.cpp +++ b/wxPython/src/gtk/calendar_wrap.cpp @@ -230,21 +230,20 @@ SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_co /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_wxDateTime__WeekDay swig_types[0] -#define SWIGTYPE_p_wxColour swig_types[1] -#define SWIGTYPE_p_wxObject swig_types[2] -#define SWIGTYPE_p_wxCalendarEvent swig_types[3] -#define SWIGTYPE_p_wxCalendarDateAttr swig_types[4] -#define SWIGTYPE_p_wxWindow swig_types[5] -#define SWIGTYPE_p_wxCommandEvent swig_types[6] +#define SWIGTYPE_p_wxControl swig_types[0] +#define SWIGTYPE_p_wxDateTime swig_types[1] +#define SWIGTYPE_p_wxWindow swig_types[2] +#define SWIGTYPE_p_wxFont swig_types[3] +#define SWIGTYPE_p_wxEvent swig_types[4] +#define SWIGTYPE_p_wxObject swig_types[5] +#define SWIGTYPE_p_wxEvtHandler swig_types[6] #define SWIGTYPE_p_char swig_types[7] -#define SWIGTYPE_p_wxEvtHandler swig_types[8] -#define SWIGTYPE_p_wxFont swig_types[9] -#define SWIGTYPE_p_wxDateTime swig_types[10] -#define SWIGTYPE_p_wxControl swig_types[11] +#define SWIGTYPE_p_wxCalendarDateAttr swig_types[8] +#define SWIGTYPE_p_wxColour swig_types[9] +#define SWIGTYPE_p_wxCalendarEvent swig_types[10] +#define SWIGTYPE_p_wxCommandEvent swig_types[11] #define SWIGTYPE_p_wxCalendarCtrl swig_types[12] -#define SWIGTYPE_p_wxEvent swig_types[13] -static swig_type_info *swig_types[15]; +static swig_type_info *swig_types[14]; /* -------- TYPES TABLE (END) -------- */ @@ -322,12 +321,25 @@ SWIG_PyObj_AsLong(PyObject * obj) return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); } +PyObject *wxCalendarCtrl_HitTest(wxCalendarCtrl *self,wxPoint const &pos){ + wxDateTime* date = new wxDateTime; + wxDateTime::WeekDay wd; + wxCalendarHitTestResult result = self->HitTest(pos, date, &wd); + wxPyBeginBlockThreads(); + PyObject* tup = PyTuple_New(3); + PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(result)); + PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(date, wxT("wxDateTime"), 1)); + PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(wd)); + wxPyEndBlockThreads(); + return tup; + } #ifdef __cplusplus extern "C" { #endif static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; - wxColour *arg1 = 0 ; + wxColour const &arg1_defvalue = wxNullColour ; + wxColour *arg1 = (wxColour *) &arg1_defvalue ; wxColour const &arg2_defvalue = wxNullColour ; wxColour *arg2 = (wxColour *) &arg2_defvalue ; wxColour const &arg3_defvalue = wxNullColour ; @@ -348,10 +360,12 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb (char *) "colText",(char *) "colBack",(char *) "colBorder",(char *) "font",(char *) "border", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; - { - arg1 = &temp1; - if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; + if (obj0) { + { + arg1 = &temp1; + if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + } } if (obj1) { { @@ -391,44 +405,6 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb } -static PyObject *_wrap_new_CalendarDateAttrBorder(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - int arg1 ; - wxColour const &arg2_defvalue = wxNullColour ; - wxColour *arg2 = (wxColour *) &arg2_defvalue ; - wxCalendarDateAttr *result; - wxColour temp2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "border",(char *) "colBorder", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_CalendarDateAttrBorder",kwnames,&obj0,&obj1)) goto fail; - { - arg1 = (wxCalendarDateBorder) SWIG_PyObj_AsInt(obj0); - if (PyErr_Occurred()) SWIG_fail; - } - if (obj1) { - { - arg2 = &temp2; - if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxCalendarDateAttr *)new wxCalendarDateAttr((wxCalendarDateBorder )arg1,(wxColour const &)*arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxCalendarDateAttr, 1); - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_CalendarDateAttr_SetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarDateAttr *arg1 = (wxCalendarDateAttr *) 0 ; @@ -1373,62 +1349,62 @@ static PyObject *_wrap_CalendarCtrl_SetLowerDateLimit(PyObject *self, PyObject * } -static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime *result; + wxDateTime const &arg2_defvalue = wxDefaultDateTime ; + wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; + bool result; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self", NULL + (char *) "self",(char *) "date", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (obj1) { + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + } + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); - result = (wxDateTime *) &_result_ref; - } + result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); return resultobj; fail: return NULL; } -static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime const &arg2_defvalue = wxDefaultDateTime ; - wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; - bool result; + wxDateTime *result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "date", NULL + (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); + { + wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); + result = (wxDateTime *) &_result_ref; + } wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); return resultobj; fail: return NULL; @@ -2018,104 +1994,28 @@ static PyObject *_wrap_CalendarCtrl_HitTest(PyObject *self, PyObject *args, PyOb PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; wxPoint *arg2 = 0 ; - wxDateTime *arg3 = (wxDateTime *) NULL ; - wxDateTime::WeekDay *arg4 = (wxDateTime::WeekDay *) NULL ; - int result; + PyObject *result; wxPoint temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "pos",(char *) "date",(char *) "wd", NULL + (char *) "self",(char *) "pos", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { arg2 = &temp2; if ( ! wxPoint_helper(obj1, &arg2)) SWIG_fail; } - if (obj2) { - if ((SWIG_ConvertPtr(obj2,(void **) &arg3, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - if (obj3) { - if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxDateTime__WeekDay,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->HitTest((wxPoint const &)*arg2,arg3,arg4); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Enable(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "enable", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Enable",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Enable(arg2); + result = (PyObject *)wxCalendarCtrl_HitTest(arg1,(wxPoint const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Show(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "show", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Show",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Show(arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = result; return resultobj; fail: return NULL; @@ -2185,7 +2085,6 @@ static PyObject * CalendarCtrl_swigregister(PyObject *self, PyObject *args) { } static PyMethodDef SwigMethods[] = { { (char *)"new_CalendarDateAttr", (PyCFunction) _wrap_new_CalendarDateAttr, METH_VARARGS | METH_KEYWORDS }, - { (char *)"new_CalendarDateAttrBorder", (PyCFunction) _wrap_new_CalendarDateAttrBorder, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetTextColour", (PyCFunction) _wrap_CalendarDateAttr_SetTextColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBackgroundColour", (PyCFunction) _wrap_CalendarDateAttr_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBorderColour", (PyCFunction) _wrap_CalendarDateAttr_SetBorderColour, METH_VARARGS | METH_KEYWORDS }, @@ -2216,8 +2115,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetDate", (PyCFunction) _wrap_CalendarCtrl_SetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetDate", (PyCFunction) _wrap_CalendarCtrl_GetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetDateRange", (PyCFunction) _wrap_CalendarCtrl_SetDateRange, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_EnableYearChange", (PyCFunction) _wrap_CalendarCtrl_EnableYearChange, METH_VARARGS | METH_KEYWORDS }, @@ -2237,8 +2136,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetHoliday", (PyCFunction) _wrap_CalendarCtrl_SetHoliday, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_ResetAttr", (PyCFunction) _wrap_CalendarCtrl_ResetAttr, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_HitTest", (PyCFunction) _wrap_CalendarCtrl_HitTest, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Enable", (PyCFunction) _wrap_CalendarCtrl_Enable, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Show", (PyCFunction) _wrap_CalendarCtrl_Show, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetMonthControl", (PyCFunction) _wrap_CalendarCtrl_GetMonthControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetYearControl", (PyCFunction) _wrap_CalendarCtrl_GetYearControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_swigregister", CalendarCtrl_swigregister, METH_VARARGS }, @@ -2698,36 +2595,34 @@ static void *_p_wxKeyEventTo_p_wxEvent(void *x) { static void *_p_wxScrollWinEventTo_p_wxEvent(void *x) { return (void *)((wxEvent *) ((wxScrollWinEvent *) x)); } -static swig_type_info _swigt__p_wxDateTime__WeekDay[] = {{"_p_wxDateTime__WeekDay", 0, "wxDateTime::WeekDay *", 0},{"_p_wxDateTime__WeekDay"},{0}}; -static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; +static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; +static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxObject},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject},{"_p_wxSizer", _p_wxSizerTo_p_wxObject},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject},{"_p_wxFileHistory", _p_wxFileHistoryTo_p_wxObject},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject},{"_p_wxMenu", _p_wxMenuTo_p_wxObject},{"_p_wxEvent", _p_wxEventTo_p_wxObject},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject},{"_p_wxControl", _p_wxControlTo_p_wxObject},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxObject},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxObject},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject},{"_p_wxClipboard", _p_wxClipboardTo_p_wxObject},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject},{"_p_wxToolTip", _p_wxToolTipTo_p_wxObject},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject},{"_p_wxImage", _p_wxImageTo_p_wxObject},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject},{"_p_wxSystemOptions", _p_wxSystemOptionsTo_p_wxObject},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxObject},{"_p_wxObject"},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject},{"_p_wxWindow", _p_wxWindowTo_p_wxObject},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxObject},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject},{"_p_wxBusyInfo", _p_wxBusyInfoTo_p_wxObject},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxObject},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxObject},{0}}; -static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; static swig_type_info _swigt__p_wxCalendarDateAttr[] = {{"_p_wxCalendarDateAttr", 0, "wxCalendarDateAttr *", 0},{"_p_wxCalendarDateAttr"},{0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxCommandEvent},{"_p_wxCommandEvent"},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent},{0}}; -static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; -static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; -static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; -static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; static swig_type_info _swigt__p_wxCalendarCtrl[] = {{"_p_wxCalendarCtrl", 0, "wxCalendarCtrl *", 0},{"_p_wxCalendarCtrl"},{0}}; -static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info *swig_types_initial[] = { -_swigt__p_wxDateTime__WeekDay, -_swigt__p_wxColour, +_swigt__p_wxControl, +_swigt__p_wxDateTime, +_swigt__p_wxWindow, +_swigt__p_wxFont, +_swigt__p_wxEvent, _swigt__p_wxObject, -_swigt__p_wxCalendarEvent, +_swigt__p_wxEvtHandler, +_swigt__p_char, _swigt__p_wxCalendarDateAttr, -_swigt__p_wxWindow, +_swigt__p_wxColour, +_swigt__p_wxCalendarEvent, _swigt__p_wxCommandEvent, -_swigt__p_char, -_swigt__p_wxEvtHandler, -_swigt__p_wxFont, -_swigt__p_wxDateTime, -_swigt__p_wxControl, _swigt__p_wxCalendarCtrl, -_swigt__p_wxEvent, 0 }; diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 10febf38b2..7199f90a23 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -83,7 +83,13 @@ def Button_GetDefaultSize(*args, **kwargs): return _controls.Button_GetDefaultSize(*args, **kwargs) class BitmapButton(Button): - """A Buttont that contains a bitmap.""" + """ + A Button that contains a bitmap. A bitmap button can be supplied with a + single bitmap, and wxWindows will draw all button states using this bitmap. If + the application needs more control, additional bitmaps for the selected state, + unpressed focused state, and greyed-out state may be supplied. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxBitmapButton instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -93,7 +99,7 @@ class BitmapButton(Button): Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton - Create and show a button. + Create and show a button with a bitmap for the label. """ newobj = _controls.new_BitmapButton(*args, **kwargs) self.this = newobj.this diff --git a/wxPython/src/gtk/core.py b/wxPython/src/gtk/core.py index 7a2f487c31..550e12ca34 100644 --- a/wxPython/src/gtk/core.py +++ b/wxPython/src/gtk/core.py @@ -4457,7 +4457,11 @@ class PyApp(EvtHandler): def __repr__(self): return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__() -> PyApp""" + """ + __init__() -> PyApp + + Create a new application object, starting the bootstrap process. + """ newobj = _core.new_PyApp(*args, **kwargs) self.this = newobj.this self.thisown = 1 diff --git a/wxPython/src/gtk/misc.py b/wxPython/src/gtk/misc.py index 3d1eb014d7..d8ef4c470a 100644 --- a/wxPython/src/gtk/misc.py +++ b/wxPython/src/gtk/misc.py @@ -3199,6 +3199,8 @@ class DateTime(object): """IsValid() -> bool""" return _misc.DateTime_IsValid(*args, **kwargs) + Ok = IsValid + def __nonzero__(self): return self.Ok() def GetTicks(*args, **kwargs): """GetTicks() -> time_t""" return _misc.DateTime_GetTicks(*args, **kwargs) @@ -3361,7 +3363,7 @@ class DateTime(object): return _misc.DateTime_ParseRfc822Date(*args, **kwargs) def ParseFormat(*args, **kwargs): - """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=wxDefaultDateTime) -> int""" + """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=DefaultDateTime) -> int""" return _misc.DateTime_ParseFormat(*args, **kwargs) def ParseDateTime(*args, **kwargs): @@ -4041,6 +4043,7 @@ class DataFormatPtr(DataFormat): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = DataFormat _misc.DataFormat_swigregister(DataFormatPtr) +DefaultDateTime = cvar.DefaultDateTime def CustomDataFormat(*args, **kwargs): """CustomDataFormat(String format) -> DataFormat""" diff --git a/wxPython/src/gtk/misc_wrap.cpp b/wxPython/src/gtk/misc_wrap.cpp index bcbf33f03b..5a0677b54b 100644 --- a/wxPython/src/gtk/misc_wrap.cpp +++ b/wxPython/src/gtk/misc_wrap.cpp @@ -23368,6 +23368,20 @@ static PyObject *_wrap_GetLocalTimeMillis(PyObject *self, PyObject *args, PyObje } +static int _wrap_DefaultDateTime_set(PyObject *_val) { + PyErr_SetString(PyExc_TypeError,"Variable DefaultDateTime is read-only."); + return 1; +} + + +static PyObject *_wrap_DefaultDateTime_get() { + PyObject *pyobj; + + pyobj = SWIG_NewPointerObj((void *) &wxDefaultDateTime, SWIGTYPE_p_wxDateTime, 0); + return pyobj; +} + + static PyObject *_wrap_new_DataFormat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 ; @@ -28457,6 +28471,7 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"DateTime_Default_First", SWIG_PyObj_FromInt((int)wxDateTime::Default_First)); PyDict_SetItemString(d,"DateTime_Monday_First", SWIG_PyObj_FromInt((int)wxDateTime::Monday_First)); PyDict_SetItemString(d,"DateTime_Sunday_First", SWIG_PyObj_FromInt((int)wxDateTime::Sunday_First)); + SWIG_addvarlink(SWIG_globals,(char*)"DefaultDateTime",_wrap_DefaultDateTime_get, _wrap_DefaultDateTime_set); PyDict_SetItemString(d,"DF_INVALID", SWIG_PyObj_FromInt((int)wxDF_INVALID)); PyDict_SetItemString(d,"DF_TEXT", SWIG_PyObj_FromInt((int)wxDF_TEXT)); PyDict_SetItemString(d,"DF_BITMAP", SWIG_PyObj_FromInt((int)wxDF_BITMAP)); diff --git a/wxPython/src/mac/calendar.py b/wxPython/src/mac/calendar.py index 46eef2f4d6..d9b21268e9 100644 --- a/wxPython/src/mac/calendar.py +++ b/wxPython/src/mac/calendar.py @@ -23,13 +23,19 @@ CAL_BORDER_NONE = _calendar.CAL_BORDER_NONE CAL_BORDER_SQUARE = _calendar.CAL_BORDER_SQUARE CAL_BORDER_ROUND = _calendar.CAL_BORDER_ROUND class CalendarDateAttr(object): + """ + A set of customization attributes for a calendar date, which can be used to + control the look of the Calendar object. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Colour colText, Colour colBack=wxNullColour, Colour colBorder=wxNullColour, - Font font=wxNullFont, + __init__(Colour colText=wxNullColour, Colour colBack=wxNullColour, + Colour colBorder=wxNullColour, Font font=wxNullFont, int border=CAL_BORDER_NONE) -> CalendarDateAttr + + Create a CalendarDateAttr. """ newobj = _calendar.new_CalendarDateAttr(*args, **kwargs) self.this = newobj.this @@ -111,12 +117,6 @@ class CalendarDateAttrPtr(CalendarDateAttr): self.__class__ = CalendarDateAttr _calendar.CalendarDateAttr_swigregister(CalendarDateAttrPtr) -def CalendarDateAttrBorder(*args, **kwargs): - """CalendarDateAttrBorder(int border, Colour colBorder=wxNullColour) -> CalendarDateAttr""" - val = _calendar.new_CalendarDateAttrBorder(*args, **kwargs) - val.thisown = 1 - return val - class CalendarEvent(core.CommandEvent): def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -164,14 +164,17 @@ EVT_CALENDAR_YEAR = wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1) EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1) class CalendarCtrl(core.Control): + """The calendar control allows the user to pick a date interactively.""" def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, int id, DateTime date=wxDefaultDateTime, + __init__(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> CalendarCtrl + + Create and show a calendar control. """ newobj = _calendar.new_CalendarCtrl(*args, **kwargs) self.this = newobj.this @@ -181,123 +184,235 @@ class CalendarCtrl(core.Control): def Create(*args, **kwargs): """ - Create(Window parent, int id, DateTime date=wxDefaultDateTime, + Create(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool + + Acutally create the GUI portion of the CalendarCtrl for 2-phase creation. """ return _calendar.CalendarCtrl_Create(*args, **kwargs) def SetDate(*args, **kwargs): - """SetDate(DateTime date)""" + """ + SetDate(DateTime date) + + Sets the current date. + """ return _calendar.CalendarCtrl_SetDate(*args, **kwargs) def GetDate(*args, **kwargs): - """GetDate() -> DateTime""" + """ + GetDate() -> DateTime + + Gets the currently selected date. + """ return _calendar.CalendarCtrl_GetDate(*args, **kwargs) def SetLowerDateLimit(*args, **kwargs): - """SetLowerDateLimit(DateTime date=wxDefaultDateTime) -> bool""" - return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) + """ + SetLowerDateLimit(DateTime date=DefaultDateTime) -> bool - def GetLowerDateLimit(*args, **kwargs): - """GetLowerDateLimit() -> DateTime""" - return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + set the range in which selection can occur + """ + return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) def SetUpperDateLimit(*args, **kwargs): - """SetUpperDateLimit(DateTime date=wxDefaultDateTime) -> bool""" + """ + SetUpperDateLimit(DateTime date=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetUpperDateLimit(*args, **kwargs) + def GetLowerDateLimit(*args, **kwargs): + """ + GetLowerDateLimit() -> DateTime + + get the range in which selection can occur + """ + return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + def GetUpperDateLimit(*args, **kwargs): - """GetUpperDateLimit() -> DateTime""" + """ + GetUpperDateLimit() -> DateTime + + get the range in which selection can occur + """ return _calendar.CalendarCtrl_GetUpperDateLimit(*args, **kwargs) def SetDateRange(*args, **kwargs): - """SetDateRange(DateTime lowerdate=wxDefaultDateTime, DateTime upperdate=wxDefaultDateTime) -> bool""" + """ + SetDateRange(DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetDateRange(*args, **kwargs) def EnableYearChange(*args, **kwargs): - """EnableYearChange(bool enable=True)""" + """ + EnableYearChange(bool enable=True) + + This function should be used instead of changing CAL_NO_YEAR_CHANGE + style bit directly. It allows or disallows the user to change the year + interactively. + """ return _calendar.CalendarCtrl_EnableYearChange(*args, **kwargs) def EnableMonthChange(*args, **kwargs): - """EnableMonthChange(bool enable=True)""" + """ + EnableMonthChange(bool enable=True) + + This function should be used instead of changing CAL_NO_MONTH_CHANGE style + bit. It allows or disallows the user to change the month interactively. Note + that if the month can not be changed, the year can not be changed either. + """ return _calendar.CalendarCtrl_EnableMonthChange(*args, **kwargs) def EnableHolidayDisplay(*args, **kwargs): - """EnableHolidayDisplay(bool display=True)""" + """ + EnableHolidayDisplay(bool display=True) + + This function should be used instead of changing CAL_SHOW_HOLIDAYS style + bit directly. It enables or disables the special highlighting of the holidays. + """ return _calendar.CalendarCtrl_EnableHolidayDisplay(*args, **kwargs) def SetHeaderColours(*args, **kwargs): - """SetHeaderColours(Colour colFg, Colour colBg)""" + """ + SetHeaderColours(Colour colFg, Colour colBg) + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_SetHeaderColours(*args, **kwargs) def GetHeaderColourFg(*args, **kwargs): - """GetHeaderColourFg() -> Colour""" + """ + GetHeaderColourFg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourFg(*args, **kwargs) def GetHeaderColourBg(*args, **kwargs): - """GetHeaderColourBg() -> Colour""" + """ + GetHeaderColourBg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourBg(*args, **kwargs) def SetHighlightColours(*args, **kwargs): - """SetHighlightColours(Colour colFg, Colour colBg)""" + """ + SetHighlightColours(Colour colFg, Colour colBg) + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_SetHighlightColours(*args, **kwargs) def GetHighlightColourFg(*args, **kwargs): - """GetHighlightColourFg() -> Colour""" + """ + GetHighlightColourFg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourFg(*args, **kwargs) def GetHighlightColourBg(*args, **kwargs): - """GetHighlightColourBg() -> Colour""" + """ + GetHighlightColourBg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourBg(*args, **kwargs) def SetHolidayColours(*args, **kwargs): - """SetHolidayColours(Colour colFg, Colour colBg)""" + """ + SetHolidayColours(Colour colFg, Colour colBg) + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_SetHolidayColours(*args, **kwargs) def GetHolidayColourFg(*args, **kwargs): - """GetHolidayColourFg() -> Colour""" + """ + GetHolidayColourFg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourFg(*args, **kwargs) def GetHolidayColourBg(*args, **kwargs): - """GetHolidayColourBg() -> Colour""" + """ + GetHolidayColourBg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourBg(*args, **kwargs) def GetAttr(*args, **kwargs): - """GetAttr(size_t day) -> CalendarDateAttr""" + """ + GetAttr(size_t day) -> CalendarDateAttr + + Returns the attribute for the given date (should be in the range 1...31). + The returned value may be None + """ return _calendar.CalendarCtrl_GetAttr(*args, **kwargs) def SetAttr(*args, **kwargs): - """SetAttr(size_t day, CalendarDateAttr attr)""" + """ + SetAttr(size_t day, CalendarDateAttr attr) + + Associates the attribute with the specified date (in the range 1...31). + If the attribute passed is None, the items attribute is cleared. + """ return _calendar.CalendarCtrl_SetAttr(*args, **kwargs) def SetHoliday(*args, **kwargs): - """SetHoliday(size_t day)""" + """ + SetHoliday(size_t day) + + Marks the specified day as being a holiday in the current month. + """ return _calendar.CalendarCtrl_SetHoliday(*args, **kwargs) def ResetAttr(*args, **kwargs): - """ResetAttr(size_t day)""" + """ + ResetAttr(size_t day) + + Clears any attributes associated with the given day (in the range 1...31). + """ return _calendar.CalendarCtrl_ResetAttr(*args, **kwargs) def HitTest(*args, **kwargs): - """HitTest(Point pos, DateTime date=None, int wd=None) -> int""" - return _calendar.CalendarCtrl_HitTest(*args, **kwargs) + """ + HitTest(Point pos) -> (result, date, weekday) + + Returns 3-tuple with information about the given position on the calendar + control. The first value of the tuple is a result code and determines the + validity of the remaining two values. The result codes are: - def Enable(*args, **kwargs): - """Enable(bool enable=True) -> bool""" - return _calendar.CalendarCtrl_Enable(*args, **kwargs) + CAL_HITTEST_NOWHERE: hit outside of anything + CAL_HITTEST_HEADER: hit on the header, weekday is valid + CAL_HITTEST_DAY: hit on a day in the calendar, date is set. - def Show(*args, **kwargs): - """Show(bool show=True) -> bool""" - return _calendar.CalendarCtrl_Show(*args, **kwargs) + """ + return _calendar.CalendarCtrl_HitTest(*args, **kwargs) def GetMonthControl(*args, **kwargs): - """GetMonthControl() -> Control""" + """ + GetMonthControl() -> Control + + get the currently shown control for month + """ return _calendar.CalendarCtrl_GetMonthControl(*args, **kwargs) def GetYearControl(*args, **kwargs): - """GetYearControl() -> Control""" + """ + GetYearControl() -> Control + + get the currently shown control for year + """ return _calendar.CalendarCtrl_GetYearControl(*args, **kwargs) @@ -311,7 +426,11 @@ cvar = _calendar.cvar CalendarNameStr = cvar.CalendarNameStr def PreCalendarCtrl(*args, **kwargs): - """PreCalendarCtrl() -> CalendarCtrl""" + """ + PreCalendarCtrl() -> CalendarCtrl + + Precreate a CalendarCtrl for 2-phase creation. + """ val = _calendar.new_PreCalendarCtrl(*args, **kwargs) val.thisown = 1 return val diff --git a/wxPython/src/mac/calendar_wrap.cpp b/wxPython/src/mac/calendar_wrap.cpp index d8cd150941..57510da603 100644 --- a/wxPython/src/mac/calendar_wrap.cpp +++ b/wxPython/src/mac/calendar_wrap.cpp @@ -230,21 +230,20 @@ SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_co /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_wxDateTime__WeekDay swig_types[0] -#define SWIGTYPE_p_wxColour swig_types[1] -#define SWIGTYPE_p_wxObject swig_types[2] -#define SWIGTYPE_p_wxCalendarEvent swig_types[3] -#define SWIGTYPE_p_wxCalendarDateAttr swig_types[4] -#define SWIGTYPE_p_wxWindow swig_types[5] -#define SWIGTYPE_p_wxCommandEvent swig_types[6] +#define SWIGTYPE_p_wxControl swig_types[0] +#define SWIGTYPE_p_wxDateTime swig_types[1] +#define SWIGTYPE_p_wxWindow swig_types[2] +#define SWIGTYPE_p_wxFont swig_types[3] +#define SWIGTYPE_p_wxEvent swig_types[4] +#define SWIGTYPE_p_wxObject swig_types[5] +#define SWIGTYPE_p_wxEvtHandler swig_types[6] #define SWIGTYPE_p_char swig_types[7] -#define SWIGTYPE_p_wxEvtHandler swig_types[8] -#define SWIGTYPE_p_wxFont swig_types[9] -#define SWIGTYPE_p_wxDateTime swig_types[10] -#define SWIGTYPE_p_wxControl swig_types[11] +#define SWIGTYPE_p_wxCalendarDateAttr swig_types[8] +#define SWIGTYPE_p_wxColour swig_types[9] +#define SWIGTYPE_p_wxCalendarEvent swig_types[10] +#define SWIGTYPE_p_wxCommandEvent swig_types[11] #define SWIGTYPE_p_wxCalendarCtrl swig_types[12] -#define SWIGTYPE_p_wxEvent swig_types[13] -static swig_type_info *swig_types[15]; +static swig_type_info *swig_types[14]; /* -------- TYPES TABLE (END) -------- */ @@ -322,12 +321,25 @@ SWIG_PyObj_AsLong(PyObject * obj) return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); } +PyObject *wxCalendarCtrl_HitTest(wxCalendarCtrl *self,wxPoint const &pos){ + wxDateTime* date = new wxDateTime; + wxDateTime::WeekDay wd; + wxCalendarHitTestResult result = self->HitTest(pos, date, &wd); + wxPyBeginBlockThreads(); + PyObject* tup = PyTuple_New(3); + PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(result)); + PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(date, wxT("wxDateTime"), 1)); + PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(wd)); + wxPyEndBlockThreads(); + return tup; + } #ifdef __cplusplus extern "C" { #endif static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; - wxColour *arg1 = 0 ; + wxColour const &arg1_defvalue = wxNullColour ; + wxColour *arg1 = (wxColour *) &arg1_defvalue ; wxColour const &arg2_defvalue = wxNullColour ; wxColour *arg2 = (wxColour *) &arg2_defvalue ; wxColour const &arg3_defvalue = wxNullColour ; @@ -348,10 +360,12 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb (char *) "colText",(char *) "colBack",(char *) "colBorder",(char *) "font",(char *) "border", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; - { - arg1 = &temp1; - if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; + if (obj0) { + { + arg1 = &temp1; + if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + } } if (obj1) { { @@ -391,44 +405,6 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb } -static PyObject *_wrap_new_CalendarDateAttrBorder(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - int arg1 ; - wxColour const &arg2_defvalue = wxNullColour ; - wxColour *arg2 = (wxColour *) &arg2_defvalue ; - wxCalendarDateAttr *result; - wxColour temp2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "border",(char *) "colBorder", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_CalendarDateAttrBorder",kwnames,&obj0,&obj1)) goto fail; - { - arg1 = (wxCalendarDateBorder) SWIG_PyObj_AsInt(obj0); - if (PyErr_Occurred()) SWIG_fail; - } - if (obj1) { - { - arg2 = &temp2; - if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxCalendarDateAttr *)new wxCalendarDateAttr((wxCalendarDateBorder )arg1,(wxColour const &)*arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxCalendarDateAttr, 1); - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_CalendarDateAttr_SetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarDateAttr *arg1 = (wxCalendarDateAttr *) 0 ; @@ -1373,62 +1349,62 @@ static PyObject *_wrap_CalendarCtrl_SetLowerDateLimit(PyObject *self, PyObject * } -static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime *result; + wxDateTime const &arg2_defvalue = wxDefaultDateTime ; + wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; + bool result; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self", NULL + (char *) "self",(char *) "date", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (obj1) { + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + } + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); - result = (wxDateTime *) &_result_ref; - } + result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); return resultobj; fail: return NULL; } -static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime const &arg2_defvalue = wxDefaultDateTime ; - wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; - bool result; + wxDateTime *result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "date", NULL + (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); + { + wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); + result = (wxDateTime *) &_result_ref; + } wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); return resultobj; fail: return NULL; @@ -2018,104 +1994,28 @@ static PyObject *_wrap_CalendarCtrl_HitTest(PyObject *self, PyObject *args, PyOb PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; wxPoint *arg2 = 0 ; - wxDateTime *arg3 = (wxDateTime *) NULL ; - wxDateTime::WeekDay *arg4 = (wxDateTime::WeekDay *) NULL ; - int result; + PyObject *result; wxPoint temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "pos",(char *) "date",(char *) "wd", NULL + (char *) "self",(char *) "pos", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { arg2 = &temp2; if ( ! wxPoint_helper(obj1, &arg2)) SWIG_fail; } - if (obj2) { - if ((SWIG_ConvertPtr(obj2,(void **) &arg3, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - if (obj3) { - if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxDateTime__WeekDay,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->HitTest((wxPoint const &)*arg2,arg3,arg4); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Enable(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "enable", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Enable",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Enable(arg2); + result = (PyObject *)wxCalendarCtrl_HitTest(arg1,(wxPoint const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Show(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "show", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Show",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Show(arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = result; return resultobj; fail: return NULL; @@ -2185,7 +2085,6 @@ static PyObject * CalendarCtrl_swigregister(PyObject *self, PyObject *args) { } static PyMethodDef SwigMethods[] = { { (char *)"new_CalendarDateAttr", (PyCFunction) _wrap_new_CalendarDateAttr, METH_VARARGS | METH_KEYWORDS }, - { (char *)"new_CalendarDateAttrBorder", (PyCFunction) _wrap_new_CalendarDateAttrBorder, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetTextColour", (PyCFunction) _wrap_CalendarDateAttr_SetTextColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBackgroundColour", (PyCFunction) _wrap_CalendarDateAttr_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBorderColour", (PyCFunction) _wrap_CalendarDateAttr_SetBorderColour, METH_VARARGS | METH_KEYWORDS }, @@ -2216,8 +2115,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetDate", (PyCFunction) _wrap_CalendarCtrl_SetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetDate", (PyCFunction) _wrap_CalendarCtrl_GetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetDateRange", (PyCFunction) _wrap_CalendarCtrl_SetDateRange, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_EnableYearChange", (PyCFunction) _wrap_CalendarCtrl_EnableYearChange, METH_VARARGS | METH_KEYWORDS }, @@ -2237,8 +2136,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetHoliday", (PyCFunction) _wrap_CalendarCtrl_SetHoliday, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_ResetAttr", (PyCFunction) _wrap_CalendarCtrl_ResetAttr, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_HitTest", (PyCFunction) _wrap_CalendarCtrl_HitTest, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Enable", (PyCFunction) _wrap_CalendarCtrl_Enable, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Show", (PyCFunction) _wrap_CalendarCtrl_Show, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetMonthControl", (PyCFunction) _wrap_CalendarCtrl_GetMonthControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetYearControl", (PyCFunction) _wrap_CalendarCtrl_GetYearControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_swigregister", CalendarCtrl_swigregister, METH_VARARGS }, @@ -2698,36 +2595,34 @@ static void *_p_wxKeyEventTo_p_wxEvent(void *x) { static void *_p_wxScrollWinEventTo_p_wxEvent(void *x) { return (void *)((wxEvent *) ((wxScrollWinEvent *) x)); } -static swig_type_info _swigt__p_wxDateTime__WeekDay[] = {{"_p_wxDateTime__WeekDay", 0, "wxDateTime::WeekDay *", 0},{"_p_wxDateTime__WeekDay"},{0}}; -static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; +static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; +static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxObject},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject},{"_p_wxSizer", _p_wxSizerTo_p_wxObject},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject},{"_p_wxFileHistory", _p_wxFileHistoryTo_p_wxObject},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject},{"_p_wxMenu", _p_wxMenuTo_p_wxObject},{"_p_wxEvent", _p_wxEventTo_p_wxObject},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject},{"_p_wxControl", _p_wxControlTo_p_wxObject},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxObject},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxObject},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject},{"_p_wxClipboard", _p_wxClipboardTo_p_wxObject},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject},{"_p_wxToolTip", _p_wxToolTipTo_p_wxObject},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject},{"_p_wxImage", _p_wxImageTo_p_wxObject},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject},{"_p_wxSystemOptions", _p_wxSystemOptionsTo_p_wxObject},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxObject},{"_p_wxObject"},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject},{"_p_wxWindow", _p_wxWindowTo_p_wxObject},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxObject},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject},{"_p_wxBusyInfo", _p_wxBusyInfoTo_p_wxObject},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxObject},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxObject},{0}}; -static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; static swig_type_info _swigt__p_wxCalendarDateAttr[] = {{"_p_wxCalendarDateAttr", 0, "wxCalendarDateAttr *", 0},{"_p_wxCalendarDateAttr"},{0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxCommandEvent},{"_p_wxCommandEvent"},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent},{0}}; -static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; -static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; -static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; -static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; static swig_type_info _swigt__p_wxCalendarCtrl[] = {{"_p_wxCalendarCtrl", 0, "wxCalendarCtrl *", 0},{"_p_wxCalendarCtrl"},{0}}; -static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info *swig_types_initial[] = { -_swigt__p_wxDateTime__WeekDay, -_swigt__p_wxColour, +_swigt__p_wxControl, +_swigt__p_wxDateTime, +_swigt__p_wxWindow, +_swigt__p_wxFont, +_swigt__p_wxEvent, _swigt__p_wxObject, -_swigt__p_wxCalendarEvent, +_swigt__p_wxEvtHandler, +_swigt__p_char, _swigt__p_wxCalendarDateAttr, -_swigt__p_wxWindow, +_swigt__p_wxColour, +_swigt__p_wxCalendarEvent, _swigt__p_wxCommandEvent, -_swigt__p_char, -_swigt__p_wxEvtHandler, -_swigt__p_wxFont, -_swigt__p_wxDateTime, -_swigt__p_wxControl, _swigt__p_wxCalendarCtrl, -_swigt__p_wxEvent, 0 }; diff --git a/wxPython/src/mac/controls.py b/wxPython/src/mac/controls.py index e1da86eaaa..06fef976a2 100644 --- a/wxPython/src/mac/controls.py +++ b/wxPython/src/mac/controls.py @@ -83,7 +83,13 @@ def Button_GetDefaultSize(*args, **kwargs): return _controls.Button_GetDefaultSize(*args, **kwargs) class BitmapButton(Button): - """A Buttont that contains a bitmap.""" + """ + A Button that contains a bitmap. A bitmap button can be supplied with a + single bitmap, and wxWindows will draw all button states using this bitmap. If + the application needs more control, additional bitmaps for the selected state, + unpressed focused state, and greyed-out state may be supplied. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxBitmapButton instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -93,7 +99,7 @@ class BitmapButton(Button): Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton - Create and show a button. + Create and show a button with a bitmap for the label. """ newobj = _controls.new_BitmapButton(*args, **kwargs) self.this = newobj.this diff --git a/wxPython/src/mac/core.py b/wxPython/src/mac/core.py index 7a2f487c31..550e12ca34 100644 --- a/wxPython/src/mac/core.py +++ b/wxPython/src/mac/core.py @@ -4457,7 +4457,11 @@ class PyApp(EvtHandler): def __repr__(self): return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__() -> PyApp""" + """ + __init__() -> PyApp + + Create a new application object, starting the bootstrap process. + """ newobj = _core.new_PyApp(*args, **kwargs) self.this = newobj.this self.thisown = 1 diff --git a/wxPython/src/mac/misc.py b/wxPython/src/mac/misc.py index 56bec85b75..648441cf53 100644 --- a/wxPython/src/mac/misc.py +++ b/wxPython/src/mac/misc.py @@ -3199,6 +3199,8 @@ class DateTime(object): """IsValid() -> bool""" return _misc.DateTime_IsValid(*args, **kwargs) + Ok = IsValid + def __nonzero__(self): return self.Ok() def GetTicks(*args, **kwargs): """GetTicks() -> time_t""" return _misc.DateTime_GetTicks(*args, **kwargs) @@ -3361,7 +3363,7 @@ class DateTime(object): return _misc.DateTime_ParseRfc822Date(*args, **kwargs) def ParseFormat(*args, **kwargs): - """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=wxDefaultDateTime) -> int""" + """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=DefaultDateTime) -> int""" return _misc.DateTime_ParseFormat(*args, **kwargs) def ParseDateTime(*args, **kwargs): @@ -4041,6 +4043,7 @@ class DataFormatPtr(DataFormat): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = DataFormat _misc.DataFormat_swigregister(DataFormatPtr) +DefaultDateTime = cvar.DefaultDateTime def CustomDataFormat(*args, **kwargs): """CustomDataFormat(String format) -> DataFormat""" diff --git a/wxPython/src/mac/misc_wrap.cpp b/wxPython/src/mac/misc_wrap.cpp index fef531c692..74bc443eb3 100644 --- a/wxPython/src/mac/misc_wrap.cpp +++ b/wxPython/src/mac/misc_wrap.cpp @@ -23361,6 +23361,20 @@ static PyObject *_wrap_GetLocalTimeMillis(PyObject *self, PyObject *args, PyObje } +static int _wrap_DefaultDateTime_set(PyObject *) { + PyErr_SetString(PyExc_TypeError,"Variable DefaultDateTime is read-only."); + return 1; +} + + +static PyObject *_wrap_DefaultDateTime_get() { + PyObject *pyobj; + + pyobj = SWIG_NewPointerObj((void *) &wxDefaultDateTime, SWIGTYPE_p_wxDateTime, 0); + return pyobj; +} + + static PyObject *_wrap_new_DataFormat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 ; @@ -28513,6 +28527,7 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"DateTime_Default_First", SWIG_PyObj_FromInt((int)wxDateTime::Default_First)); PyDict_SetItemString(d,"DateTime_Monday_First", SWIG_PyObj_FromInt((int)wxDateTime::Monday_First)); PyDict_SetItemString(d,"DateTime_Sunday_First", SWIG_PyObj_FromInt((int)wxDateTime::Sunday_First)); + SWIG_addvarlink(SWIG_globals,(char*)"DefaultDateTime",_wrap_DefaultDateTime_get, _wrap_DefaultDateTime_set); PyDict_SetItemString(d,"DF_INVALID", SWIG_PyObj_FromInt((int)wxDF_INVALID)); PyDict_SetItemString(d,"DF_TEXT", SWIG_PyObj_FromInt((int)wxDF_TEXT)); PyDict_SetItemString(d,"DF_BITMAP", SWIG_PyObj_FromInt((int)wxDF_BITMAP)); diff --git a/wxPython/src/msw/calendar.py b/wxPython/src/msw/calendar.py index 46eef2f4d6..d9b21268e9 100644 --- a/wxPython/src/msw/calendar.py +++ b/wxPython/src/msw/calendar.py @@ -23,13 +23,19 @@ CAL_BORDER_NONE = _calendar.CAL_BORDER_NONE CAL_BORDER_SQUARE = _calendar.CAL_BORDER_SQUARE CAL_BORDER_ROUND = _calendar.CAL_BORDER_ROUND class CalendarDateAttr(object): + """ + A set of customization attributes for a calendar date, which can be used to + control the look of the Calendar object. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarDateAttr instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Colour colText, Colour colBack=wxNullColour, Colour colBorder=wxNullColour, - Font font=wxNullFont, + __init__(Colour colText=wxNullColour, Colour colBack=wxNullColour, + Colour colBorder=wxNullColour, Font font=wxNullFont, int border=CAL_BORDER_NONE) -> CalendarDateAttr + + Create a CalendarDateAttr. """ newobj = _calendar.new_CalendarDateAttr(*args, **kwargs) self.this = newobj.this @@ -111,12 +117,6 @@ class CalendarDateAttrPtr(CalendarDateAttr): self.__class__ = CalendarDateAttr _calendar.CalendarDateAttr_swigregister(CalendarDateAttrPtr) -def CalendarDateAttrBorder(*args, **kwargs): - """CalendarDateAttrBorder(int border, Colour colBorder=wxNullColour) -> CalendarDateAttr""" - val = _calendar.new_CalendarDateAttrBorder(*args, **kwargs) - val.thisown = 1 - return val - class CalendarEvent(core.CommandEvent): def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -164,14 +164,17 @@ EVT_CALENDAR_YEAR = wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1) EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1) class CalendarCtrl(core.Control): + """The calendar control allows the user to pick a date interactively.""" def __repr__(self): return "<%s.%s; proxy of C++ wxCalendarCtrl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, int id, DateTime date=wxDefaultDateTime, + __init__(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> CalendarCtrl + + Create and show a calendar control. """ newobj = _calendar.new_CalendarCtrl(*args, **kwargs) self.this = newobj.this @@ -181,123 +184,235 @@ class CalendarCtrl(core.Control): def Create(*args, **kwargs): """ - Create(Window parent, int id, DateTime date=wxDefaultDateTime, + Create(Window parent, int id, DateTime date=DefaultDateTime, Point pos=DefaultPosition, Size size=DefaultSize, long style=wxCAL_SHOW_HOLIDAYS|wxWANTS_CHARS, String name=CalendarNameStr) -> bool + + Acutally create the GUI portion of the CalendarCtrl for 2-phase creation. """ return _calendar.CalendarCtrl_Create(*args, **kwargs) def SetDate(*args, **kwargs): - """SetDate(DateTime date)""" + """ + SetDate(DateTime date) + + Sets the current date. + """ return _calendar.CalendarCtrl_SetDate(*args, **kwargs) def GetDate(*args, **kwargs): - """GetDate() -> DateTime""" + """ + GetDate() -> DateTime + + Gets the currently selected date. + """ return _calendar.CalendarCtrl_GetDate(*args, **kwargs) def SetLowerDateLimit(*args, **kwargs): - """SetLowerDateLimit(DateTime date=wxDefaultDateTime) -> bool""" - return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) + """ + SetLowerDateLimit(DateTime date=DefaultDateTime) -> bool - def GetLowerDateLimit(*args, **kwargs): - """GetLowerDateLimit() -> DateTime""" - return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + set the range in which selection can occur + """ + return _calendar.CalendarCtrl_SetLowerDateLimit(*args, **kwargs) def SetUpperDateLimit(*args, **kwargs): - """SetUpperDateLimit(DateTime date=wxDefaultDateTime) -> bool""" + """ + SetUpperDateLimit(DateTime date=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetUpperDateLimit(*args, **kwargs) + def GetLowerDateLimit(*args, **kwargs): + """ + GetLowerDateLimit() -> DateTime + + get the range in which selection can occur + """ + return _calendar.CalendarCtrl_GetLowerDateLimit(*args, **kwargs) + def GetUpperDateLimit(*args, **kwargs): - """GetUpperDateLimit() -> DateTime""" + """ + GetUpperDateLimit() -> DateTime + + get the range in which selection can occur + """ return _calendar.CalendarCtrl_GetUpperDateLimit(*args, **kwargs) def SetDateRange(*args, **kwargs): - """SetDateRange(DateTime lowerdate=wxDefaultDateTime, DateTime upperdate=wxDefaultDateTime) -> bool""" + """ + SetDateRange(DateTime lowerdate=DefaultDateTime, DateTime upperdate=DefaultDateTime) -> bool + + set the range in which selection can occur + """ return _calendar.CalendarCtrl_SetDateRange(*args, **kwargs) def EnableYearChange(*args, **kwargs): - """EnableYearChange(bool enable=True)""" + """ + EnableYearChange(bool enable=True) + + This function should be used instead of changing CAL_NO_YEAR_CHANGE + style bit directly. It allows or disallows the user to change the year + interactively. + """ return _calendar.CalendarCtrl_EnableYearChange(*args, **kwargs) def EnableMonthChange(*args, **kwargs): - """EnableMonthChange(bool enable=True)""" + """ + EnableMonthChange(bool enable=True) + + This function should be used instead of changing CAL_NO_MONTH_CHANGE style + bit. It allows or disallows the user to change the month interactively. Note + that if the month can not be changed, the year can not be changed either. + """ return _calendar.CalendarCtrl_EnableMonthChange(*args, **kwargs) def EnableHolidayDisplay(*args, **kwargs): - """EnableHolidayDisplay(bool display=True)""" + """ + EnableHolidayDisplay(bool display=True) + + This function should be used instead of changing CAL_SHOW_HOLIDAYS style + bit directly. It enables or disables the special highlighting of the holidays. + """ return _calendar.CalendarCtrl_EnableHolidayDisplay(*args, **kwargs) def SetHeaderColours(*args, **kwargs): - """SetHeaderColours(Colour colFg, Colour colBg)""" + """ + SetHeaderColours(Colour colFg, Colour colBg) + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_SetHeaderColours(*args, **kwargs) def GetHeaderColourFg(*args, **kwargs): - """GetHeaderColourFg() -> Colour""" + """ + GetHeaderColourFg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourFg(*args, **kwargs) def GetHeaderColourBg(*args, **kwargs): - """GetHeaderColourBg() -> Colour""" + """ + GetHeaderColourBg() -> Colour + + header colours are used for painting the weekdays at the top + """ return _calendar.CalendarCtrl_GetHeaderColourBg(*args, **kwargs) def SetHighlightColours(*args, **kwargs): - """SetHighlightColours(Colour colFg, Colour colBg)""" + """ + SetHighlightColours(Colour colFg, Colour colBg) + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_SetHighlightColours(*args, **kwargs) def GetHighlightColourFg(*args, **kwargs): - """GetHighlightColourFg() -> Colour""" + """ + GetHighlightColourFg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourFg(*args, **kwargs) def GetHighlightColourBg(*args, **kwargs): - """GetHighlightColourBg() -> Colour""" + """ + GetHighlightColourBg() -> Colour + + highlight colour is used for the currently selected date + """ return _calendar.CalendarCtrl_GetHighlightColourBg(*args, **kwargs) def SetHolidayColours(*args, **kwargs): - """SetHolidayColours(Colour colFg, Colour colBg)""" + """ + SetHolidayColours(Colour colFg, Colour colBg) + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_SetHolidayColours(*args, **kwargs) def GetHolidayColourFg(*args, **kwargs): - """GetHolidayColourFg() -> Colour""" + """ + GetHolidayColourFg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourFg(*args, **kwargs) def GetHolidayColourBg(*args, **kwargs): - """GetHolidayColourBg() -> Colour""" + """ + GetHolidayColourBg() -> Colour + + holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used) + """ return _calendar.CalendarCtrl_GetHolidayColourBg(*args, **kwargs) def GetAttr(*args, **kwargs): - """GetAttr(size_t day) -> CalendarDateAttr""" + """ + GetAttr(size_t day) -> CalendarDateAttr + + Returns the attribute for the given date (should be in the range 1...31). + The returned value may be None + """ return _calendar.CalendarCtrl_GetAttr(*args, **kwargs) def SetAttr(*args, **kwargs): - """SetAttr(size_t day, CalendarDateAttr attr)""" + """ + SetAttr(size_t day, CalendarDateAttr attr) + + Associates the attribute with the specified date (in the range 1...31). + If the attribute passed is None, the items attribute is cleared. + """ return _calendar.CalendarCtrl_SetAttr(*args, **kwargs) def SetHoliday(*args, **kwargs): - """SetHoliday(size_t day)""" + """ + SetHoliday(size_t day) + + Marks the specified day as being a holiday in the current month. + """ return _calendar.CalendarCtrl_SetHoliday(*args, **kwargs) def ResetAttr(*args, **kwargs): - """ResetAttr(size_t day)""" + """ + ResetAttr(size_t day) + + Clears any attributes associated with the given day (in the range 1...31). + """ return _calendar.CalendarCtrl_ResetAttr(*args, **kwargs) def HitTest(*args, **kwargs): - """HitTest(Point pos, DateTime date=None, int wd=None) -> int""" - return _calendar.CalendarCtrl_HitTest(*args, **kwargs) + """ + HitTest(Point pos) -> (result, date, weekday) + + Returns 3-tuple with information about the given position on the calendar + control. The first value of the tuple is a result code and determines the + validity of the remaining two values. The result codes are: - def Enable(*args, **kwargs): - """Enable(bool enable=True) -> bool""" - return _calendar.CalendarCtrl_Enable(*args, **kwargs) + CAL_HITTEST_NOWHERE: hit outside of anything + CAL_HITTEST_HEADER: hit on the header, weekday is valid + CAL_HITTEST_DAY: hit on a day in the calendar, date is set. - def Show(*args, **kwargs): - """Show(bool show=True) -> bool""" - return _calendar.CalendarCtrl_Show(*args, **kwargs) + """ + return _calendar.CalendarCtrl_HitTest(*args, **kwargs) def GetMonthControl(*args, **kwargs): - """GetMonthControl() -> Control""" + """ + GetMonthControl() -> Control + + get the currently shown control for month + """ return _calendar.CalendarCtrl_GetMonthControl(*args, **kwargs) def GetYearControl(*args, **kwargs): - """GetYearControl() -> Control""" + """ + GetYearControl() -> Control + + get the currently shown control for year + """ return _calendar.CalendarCtrl_GetYearControl(*args, **kwargs) @@ -311,7 +426,11 @@ cvar = _calendar.cvar CalendarNameStr = cvar.CalendarNameStr def PreCalendarCtrl(*args, **kwargs): - """PreCalendarCtrl() -> CalendarCtrl""" + """ + PreCalendarCtrl() -> CalendarCtrl + + Precreate a CalendarCtrl for 2-phase creation. + """ val = _calendar.new_PreCalendarCtrl(*args, **kwargs) val.thisown = 1 return val diff --git a/wxPython/src/msw/calendar_wrap.cpp b/wxPython/src/msw/calendar_wrap.cpp index d8cd150941..57510da603 100644 --- a/wxPython/src/msw/calendar_wrap.cpp +++ b/wxPython/src/msw/calendar_wrap.cpp @@ -230,21 +230,20 @@ SWIGIMPORT(float) SWIG_PyObj_AsFloatConv(PyObject *obj, py_objasdbl_co /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_wxDateTime__WeekDay swig_types[0] -#define SWIGTYPE_p_wxColour swig_types[1] -#define SWIGTYPE_p_wxObject swig_types[2] -#define SWIGTYPE_p_wxCalendarEvent swig_types[3] -#define SWIGTYPE_p_wxCalendarDateAttr swig_types[4] -#define SWIGTYPE_p_wxWindow swig_types[5] -#define SWIGTYPE_p_wxCommandEvent swig_types[6] +#define SWIGTYPE_p_wxControl swig_types[0] +#define SWIGTYPE_p_wxDateTime swig_types[1] +#define SWIGTYPE_p_wxWindow swig_types[2] +#define SWIGTYPE_p_wxFont swig_types[3] +#define SWIGTYPE_p_wxEvent swig_types[4] +#define SWIGTYPE_p_wxObject swig_types[5] +#define SWIGTYPE_p_wxEvtHandler swig_types[6] #define SWIGTYPE_p_char swig_types[7] -#define SWIGTYPE_p_wxEvtHandler swig_types[8] -#define SWIGTYPE_p_wxFont swig_types[9] -#define SWIGTYPE_p_wxDateTime swig_types[10] -#define SWIGTYPE_p_wxControl swig_types[11] +#define SWIGTYPE_p_wxCalendarDateAttr swig_types[8] +#define SWIGTYPE_p_wxColour swig_types[9] +#define SWIGTYPE_p_wxCalendarEvent swig_types[10] +#define SWIGTYPE_p_wxCommandEvent swig_types[11] #define SWIGTYPE_p_wxCalendarCtrl swig_types[12] -#define SWIGTYPE_p_wxEvent swig_types[13] -static swig_type_info *swig_types[15]; +static swig_type_info *swig_types[14]; /* -------- TYPES TABLE (END) -------- */ @@ -322,12 +321,25 @@ SWIG_PyObj_AsLong(PyObject * obj) return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); } +PyObject *wxCalendarCtrl_HitTest(wxCalendarCtrl *self,wxPoint const &pos){ + wxDateTime* date = new wxDateTime; + wxDateTime::WeekDay wd; + wxCalendarHitTestResult result = self->HitTest(pos, date, &wd); + wxPyBeginBlockThreads(); + PyObject* tup = PyTuple_New(3); + PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(result)); + PyTuple_SET_ITEM(tup, 1, wxPyConstructObject(date, wxT("wxDateTime"), 1)); + PyTuple_SET_ITEM(tup, 2, PyInt_FromLong(wd)); + wxPyEndBlockThreads(); + return tup; + } #ifdef __cplusplus extern "C" { #endif static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; - wxColour *arg1 = 0 ; + wxColour const &arg1_defvalue = wxNullColour ; + wxColour *arg1 = (wxColour *) &arg1_defvalue ; wxColour const &arg2_defvalue = wxNullColour ; wxColour *arg2 = (wxColour *) &arg2_defvalue ; wxColour const &arg3_defvalue = wxNullColour ; @@ -348,10 +360,12 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb (char *) "colText",(char *) "colBack",(char *) "colBorder",(char *) "font",(char *) "border", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; - { - arg1 = &temp1; - if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|OOOOO:new_CalendarDateAttr",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail; + if (obj0) { + { + arg1 = &temp1; + if ( ! wxColour_helper(obj0, &arg1)) SWIG_fail; + } } if (obj1) { { @@ -391,44 +405,6 @@ static PyObject *_wrap_new_CalendarDateAttr(PyObject *self, PyObject *args, PyOb } -static PyObject *_wrap_new_CalendarDateAttrBorder(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - int arg1 ; - wxColour const &arg2_defvalue = wxNullColour ; - wxColour *arg2 = (wxColour *) &arg2_defvalue ; - wxCalendarDateAttr *result; - wxColour temp2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "border",(char *) "colBorder", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_CalendarDateAttrBorder",kwnames,&obj0,&obj1)) goto fail; - { - arg1 = (wxCalendarDateBorder) SWIG_PyObj_AsInt(obj0); - if (PyErr_Occurred()) SWIG_fail; - } - if (obj1) { - { - arg2 = &temp2; - if ( ! wxColour_helper(obj1, &arg2)) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxCalendarDateAttr *)new wxCalendarDateAttr((wxCalendarDateBorder )arg1,(wxColour const &)*arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxCalendarDateAttr, 1); - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_CalendarDateAttr_SetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarDateAttr *arg1 = (wxCalendarDateAttr *) 0 ; @@ -1373,62 +1349,62 @@ static PyObject *_wrap_CalendarCtrl_SetLowerDateLimit(PyObject *self, PyObject * } -static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime *result; + wxDateTime const &arg2_defvalue = wxDefaultDateTime ; + wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; + bool result; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self", NULL + (char *) "self",(char *) "date", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (obj1) { + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + } + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); - result = (wxDateTime *) &_result_ref; - } + result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); return resultobj; fail: return NULL; } -static PyObject *_wrap_CalendarCtrl_SetUpperDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_CalendarCtrl_GetLowerDateLimit(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - wxDateTime const &arg2_defvalue = wxDefaultDateTime ; - wxDateTime *arg2 = (wxDateTime *) &arg2_defvalue ; - bool result; + wxDateTime *result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "date", NULL + (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_SetUpperDateLimit",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CalendarCtrl_GetLowerDateLimit",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->SetUpperDateLimit((wxDateTime const &)*arg2); + { + wxDateTime const &_result_ref = ((wxCalendarCtrl const *)arg1)->GetLowerDateLimit(); + result = (wxDateTime *) &_result_ref; + } wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxDateTime, 0); return resultobj; fail: return NULL; @@ -2018,104 +1994,28 @@ static PyObject *_wrap_CalendarCtrl_HitTest(PyObject *self, PyObject *args, PyOb PyObject *resultobj; wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; wxPoint *arg2 = 0 ; - wxDateTime *arg3 = (wxDateTime *) NULL ; - wxDateTime::WeekDay *arg4 = (wxDateTime::WeekDay *) NULL ; - int result; + PyObject *result; wxPoint temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "pos",(char *) "date",(char *) "wd", NULL + (char *) "self",(char *) "pos", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:CalendarCtrl_HitTest",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { arg2 = &temp2; if ( ! wxPoint_helper(obj1, &arg2)) SWIG_fail; } - if (obj2) { - if ((SWIG_ConvertPtr(obj2,(void **) &arg3, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - if (obj3) { - if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxDateTime__WeekDay,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->HitTest((wxPoint const &)*arg2,arg3,arg4); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Enable(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "enable", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Enable",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Enable(arg2); + result = (PyObject *)wxCalendarCtrl_HitTest(arg1,(wxPoint const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_CalendarCtrl_Show(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxCalendarCtrl *arg1 = (wxCalendarCtrl *) 0 ; - bool arg2 = (bool) True ; - bool result; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "show", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:CalendarCtrl_Show",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxCalendarCtrl,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->Show(arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + resultobj = result; return resultobj; fail: return NULL; @@ -2185,7 +2085,6 @@ static PyObject * CalendarCtrl_swigregister(PyObject *self, PyObject *args) { } static PyMethodDef SwigMethods[] = { { (char *)"new_CalendarDateAttr", (PyCFunction) _wrap_new_CalendarDateAttr, METH_VARARGS | METH_KEYWORDS }, - { (char *)"new_CalendarDateAttrBorder", (PyCFunction) _wrap_new_CalendarDateAttrBorder, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetTextColour", (PyCFunction) _wrap_CalendarDateAttr_SetTextColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBackgroundColour", (PyCFunction) _wrap_CalendarDateAttr_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarDateAttr_SetBorderColour", (PyCFunction) _wrap_CalendarDateAttr_SetBorderColour, METH_VARARGS | METH_KEYWORDS }, @@ -2216,8 +2115,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetDate", (PyCFunction) _wrap_CalendarCtrl_SetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetDate", (PyCFunction) _wrap_CalendarCtrl_GetDate, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_SetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CalendarCtrl_GetLowerDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetLowerDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetUpperDateLimit", (PyCFunction) _wrap_CalendarCtrl_GetUpperDateLimit, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_SetDateRange", (PyCFunction) _wrap_CalendarCtrl_SetDateRange, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_EnableYearChange", (PyCFunction) _wrap_CalendarCtrl_EnableYearChange, METH_VARARGS | METH_KEYWORDS }, @@ -2237,8 +2136,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"CalendarCtrl_SetHoliday", (PyCFunction) _wrap_CalendarCtrl_SetHoliday, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_ResetAttr", (PyCFunction) _wrap_CalendarCtrl_ResetAttr, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_HitTest", (PyCFunction) _wrap_CalendarCtrl_HitTest, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Enable", (PyCFunction) _wrap_CalendarCtrl_Enable, METH_VARARGS | METH_KEYWORDS }, - { (char *)"CalendarCtrl_Show", (PyCFunction) _wrap_CalendarCtrl_Show, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetMonthControl", (PyCFunction) _wrap_CalendarCtrl_GetMonthControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_GetYearControl", (PyCFunction) _wrap_CalendarCtrl_GetYearControl, METH_VARARGS | METH_KEYWORDS }, { (char *)"CalendarCtrl_swigregister", CalendarCtrl_swigregister, METH_VARARGS }, @@ -2698,36 +2595,34 @@ static void *_p_wxKeyEventTo_p_wxEvent(void *x) { static void *_p_wxScrollWinEventTo_p_wxEvent(void *x) { return (void *)((wxEvent *) ((wxScrollWinEvent *) x)); } -static swig_type_info _swigt__p_wxDateTime__WeekDay[] = {{"_p_wxDateTime__WeekDay", 0, "wxDateTime::WeekDay *", 0},{"_p_wxDateTime__WeekDay"},{0}}; -static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; +static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; +static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxObject},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject},{"_p_wxSizer", _p_wxSizerTo_p_wxObject},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject},{"_p_wxFileHistory", _p_wxFileHistoryTo_p_wxObject},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject},{"_p_wxMenu", _p_wxMenuTo_p_wxObject},{"_p_wxEvent", _p_wxEventTo_p_wxObject},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject},{"_p_wxControl", _p_wxControlTo_p_wxObject},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxObject},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxObject},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject},{"_p_wxClipboard", _p_wxClipboardTo_p_wxObject},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject},{"_p_wxToolTip", _p_wxToolTipTo_p_wxObject},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject},{"_p_wxImage", _p_wxImageTo_p_wxObject},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject},{"_p_wxSystemOptions", _p_wxSystemOptionsTo_p_wxObject},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxObject},{"_p_wxObject"},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject},{"_p_wxWindow", _p_wxWindowTo_p_wxObject},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxObject},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject},{"_p_wxBusyInfo", _p_wxBusyInfoTo_p_wxObject},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxObject},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxObject},{0}}; -static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; static swig_type_info _swigt__p_wxCalendarDateAttr[] = {{"_p_wxCalendarDateAttr", 0, "wxCalendarDateAttr *", 0},{"_p_wxCalendarDateAttr"},{0}}; -static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow},{"_p_wxWindow"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxWindow},{0}}; +static swig_type_info _swigt__p_wxColour[] = {{"_p_wxColour", 0, "wxColour *", 0},{"_p_wxColour"},{0}}; +static swig_type_info _swigt__p_wxCalendarEvent[] = {{"_p_wxCalendarEvent", 0, "wxCalendarEvent *", 0},{"_p_wxCalendarEvent"},{0}}; static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxCommandEvent},{"_p_wxCommandEvent"},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent},{0}}; -static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0},{"_p_char"},{0}}; -static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler},{"_p_wxEvtHandler"},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler},{"_p_wxPyTimer", _p_wxPyTimerTo_p_wxEvtHandler},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxEvtHandler},{"_p_wxPyProcess", _p_wxPyProcessTo_p_wxEvtHandler},{0}}; -static swig_type_info _swigt__p_wxFont[] = {{"_p_wxFont", 0, "wxFont *", 0},{"_p_wxFont"},{0}}; -static swig_type_info _swigt__p_wxDateTime[] = {{"_p_wxDateTime", 0, "wxDateTime *", 0},{"_p_wxDateTime"},{0}}; -static swig_type_info _swigt__p_wxControl[] = {{"_p_wxControl", 0, "wxControl *", 0},{"_p_wxControl"},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxControl},{"_p_wxCalendarCtrl", _p_wxCalendarCtrlTo_p_wxControl},{0}}; static swig_type_info _swigt__p_wxCalendarCtrl[] = {{"_p_wxCalendarCtrl", 0, "wxCalendarCtrl *", 0},{"_p_wxCalendarCtrl"},{0}}; -static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent},{"_p_wxTimerEvent", _p_wxTimerEventTo_p_wxEvent},{"_p_wxCalendarEvent", _p_wxCalendarEventTo_p_wxEvent},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent},{"_p_wxJoystickEvent", _p_wxJoystickEventTo_p_wxEvent},{"_p_wxEvent"},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent},{"_p_wxProcessEvent", _p_wxProcessEventTo_p_wxEvent},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent},{0}}; static swig_type_info *swig_types_initial[] = { -_swigt__p_wxDateTime__WeekDay, -_swigt__p_wxColour, +_swigt__p_wxControl, +_swigt__p_wxDateTime, +_swigt__p_wxWindow, +_swigt__p_wxFont, +_swigt__p_wxEvent, _swigt__p_wxObject, -_swigt__p_wxCalendarEvent, +_swigt__p_wxEvtHandler, +_swigt__p_char, _swigt__p_wxCalendarDateAttr, -_swigt__p_wxWindow, +_swigt__p_wxColour, +_swigt__p_wxCalendarEvent, _swigt__p_wxCommandEvent, -_swigt__p_char, -_swigt__p_wxEvtHandler, -_swigt__p_wxFont, -_swigt__p_wxDateTime, -_swigt__p_wxControl, _swigt__p_wxCalendarCtrl, -_swigt__p_wxEvent, 0 }; diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index 1a22d5cfbd..1ee35df066 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -53,14 +53,6 @@ class Button(core.Control): """ return _controls.Button_SetDefault(*args, **kwargs) - def SetImageLabel(*args, **kwargs): - """SetImageLabel(Bitmap bitmap)""" - return _controls.Button_SetImageLabel(*args, **kwargs) - - def SetImageMargins(*args, **kwargs): - """SetImageMargins(int x, int y)""" - return _controls.Button_SetImageMargins(*args, **kwargs) - def GetDefaultSize(*args, **kwargs): """GetDefaultSize() -> Size""" return _controls.Button_GetDefaultSize(*args, **kwargs) @@ -91,7 +83,13 @@ def Button_GetDefaultSize(*args, **kwargs): return _controls.Button_GetDefaultSize(*args, **kwargs) class BitmapButton(Button): - """A Buttont that contains a bitmap.""" + """ + A Button that contains a bitmap. A bitmap button can be supplied with a + single bitmap, and wxWindows will draw all button states using this bitmap. If + the application needs more control, additional bitmaps for the selected state, + unpressed focused state, and greyed-out state may be supplied. + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxBitmapButton instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -101,7 +99,7 @@ class BitmapButton(Button): Validator validator=DefaultValidator, String name=ButtonNameStr) -> BitmapButton - Create and show a button. + Create and show a button with a bitmap for the label. """ newobj = _controls.new_BitmapButton(*args, **kwargs) self.this = newobj.this diff --git a/wxPython/src/msw/controls_wrap.cpp b/wxPython/src/msw/controls_wrap.cpp index fd0b693e04..6df340937c 100644 --- a/wxPython/src/msw/controls_wrap.cpp +++ b/wxPython/src/msw/controls_wrap.cpp @@ -1165,72 +1165,6 @@ static PyObject *_wrap_Button_SetDefault(PyObject *self, PyObject *args, PyObjec } -static PyObject *_wrap_Button_SetImageLabel(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxButton *arg1 = (wxButton *) 0 ; - wxBitmap *arg2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "bitmap", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Button_SetImageLabel",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxButton,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetImageLabel((wxBitmap const &)*arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_Button_SetImageMargins(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxButton *arg1 = (wxButton *) 0 ; - int arg2 ; - int arg3 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - char *kwnames[] = { - (char *) "self",(char *) "x",(char *) "y", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Button_SetImageMargins",kwnames,&obj0,&obj1,&obj2)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxButton,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = (int) SWIG_PyObj_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - { - arg3 = (int) SWIG_PyObj_AsInt(obj2); - if (PyErr_Occurred()) SWIG_fail; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetImageMargins(arg2,arg3); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_Button_GetDefaultSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxSize result; @@ -29636,8 +29570,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"new_PreButton", (PyCFunction) _wrap_new_PreButton, METH_VARARGS | METH_KEYWORDS }, { (char *)"Button_Create", (PyCFunction) _wrap_Button_Create, METH_VARARGS | METH_KEYWORDS }, { (char *)"Button_SetDefault", (PyCFunction) _wrap_Button_SetDefault, METH_VARARGS | METH_KEYWORDS }, - { (char *)"Button_SetImageLabel", (PyCFunction) _wrap_Button_SetImageLabel, METH_VARARGS | METH_KEYWORDS }, - { (char *)"Button_SetImageMargins", (PyCFunction) _wrap_Button_SetImageMargins, METH_VARARGS | METH_KEYWORDS }, { (char *)"Button_GetDefaultSize", (PyCFunction) _wrap_Button_GetDefaultSize, METH_VARARGS | METH_KEYWORDS }, { (char *)"Button_swigregister", Button_swigregister, METH_VARARGS }, { (char *)"new_BitmapButton", (PyCFunction) _wrap_new_BitmapButton, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/core.py b/wxPython/src/msw/core.py index 3cb44c5789..10b7b26732 100644 --- a/wxPython/src/msw/core.py +++ b/wxPython/src/msw/core.py @@ -4457,7 +4457,11 @@ class PyApp(EvtHandler): def __repr__(self): return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__() -> PyApp""" + """ + __init__() -> PyApp + + Create a new application object, starting the bootstrap process. + """ newobj = _core.new_PyApp(*args, **kwargs) self.this = newobj.this self.thisown = 1 diff --git a/wxPython/src/msw/misc.py b/wxPython/src/msw/misc.py index dca3778efd..68a56218c9 100644 --- a/wxPython/src/msw/misc.py +++ b/wxPython/src/msw/misc.py @@ -3199,6 +3199,8 @@ class DateTime(object): """IsValid() -> bool""" return _misc.DateTime_IsValid(*args, **kwargs) + Ok = IsValid + def __nonzero__(self): return self.Ok() def GetTicks(*args, **kwargs): """GetTicks() -> time_t""" return _misc.DateTime_GetTicks(*args, **kwargs) @@ -3361,7 +3363,7 @@ class DateTime(object): return _misc.DateTime_ParseRfc822Date(*args, **kwargs) def ParseFormat(*args, **kwargs): - """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=wxDefaultDateTime) -> int""" + """ParseFormat(String date, String format=DateFormatStr, DateTime dateDef=DefaultDateTime) -> int""" return _misc.DateTime_ParseFormat(*args, **kwargs) def ParseDateTime(*args, **kwargs): @@ -4041,6 +4043,7 @@ class DataFormatPtr(DataFormat): if not hasattr(self,"thisown"): self.thisown = 0 self.__class__ = DataFormat _misc.DataFormat_swigregister(DataFormatPtr) +DefaultDateTime = cvar.DefaultDateTime def CustomDataFormat(*args, **kwargs): """CustomDataFormat(String format) -> DataFormat""" diff --git a/wxPython/src/msw/misc_wrap.cpp b/wxPython/src/msw/misc_wrap.cpp index 1ef46beab2..9b88fec904 100644 --- a/wxPython/src/msw/misc_wrap.cpp +++ b/wxPython/src/msw/misc_wrap.cpp @@ -23354,6 +23354,20 @@ static PyObject *_wrap_GetLocalTimeMillis(PyObject *self, PyObject *args, PyObje } +static int _wrap_DefaultDateTime_set(PyObject *) { + PyErr_SetString(PyExc_TypeError,"Variable DefaultDateTime is read-only."); + return 1; +} + + +static PyObject *_wrap_DefaultDateTime_get() { + PyObject *pyobj; + + pyobj = SWIG_NewPointerObj((void *) &wxDefaultDateTime, SWIGTYPE_p_wxDateTime, 0); + return pyobj; +} + + static PyObject *_wrap_new_DataFormat(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; int arg1 ; @@ -28547,6 +28561,7 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"DateTime_Default_First", SWIG_PyObj_FromInt((int)wxDateTime::Default_First)); PyDict_SetItemString(d,"DateTime_Monday_First", SWIG_PyObj_FromInt((int)wxDateTime::Monday_First)); PyDict_SetItemString(d,"DateTime_Sunday_First", SWIG_PyObj_FromInt((int)wxDateTime::Sunday_First)); + SWIG_addvarlink(SWIG_globals,(char*)"DefaultDateTime",_wrap_DefaultDateTime_get, _wrap_DefaultDateTime_set); PyDict_SetItemString(d,"DF_INVALID", SWIG_PyObj_FromInt((int)wxDF_INVALID)); PyDict_SetItemString(d,"DF_TEXT", SWIG_PyObj_FromInt((int)wxDF_TEXT)); PyDict_SetItemString(d,"DF_BITMAP", SWIG_PyObj_FromInt((int)wxDF_BITMAP)); diff --git a/wxPython/wxPython/calendar.py b/wxPython/wxPython/calendar.py index a9d3af2401..39f0e91df4 100644 --- a/wxPython/wxPython/calendar.py +++ b/wxPython/wxPython/calendar.py @@ -37,7 +37,6 @@ wxCAL_BORDER_SQUARE = wx.calendar.CAL_BORDER_SQUARE wxCAL_BORDER_ROUND = wx.calendar.CAL_BORDER_ROUND wxCalendarDateAttr = wx.calendar.CalendarDateAttr wxCalendarDateAttrPtr = wx.calendar.CalendarDateAttrPtr -wxCalendarDateAttrBorder = wx.calendar.CalendarDateAttrBorder wxCalendarEvent = wx.calendar.CalendarEvent wxCalendarEventPtr = wx.calendar.CalendarEventPtr wxEVT_CALENDAR_DOUBLECLICKED = wx.calendar.wxEVT_CALENDAR_DOUBLECLICKED diff --git a/wxPython/wxPython/misc.py b/wxPython/wxPython/misc.py index 9276110bfb..b9faf4bb83 100644 --- a/wxPython/wxPython/misc.py +++ b/wxPython/wxPython/misc.py @@ -493,6 +493,7 @@ wxGetLocalTime = wx.misc.GetLocalTime wxGetUTCTime = wx.misc.GetUTCTime wxGetCurrentTime = wx.misc.GetCurrentTime wxGetLocalTimeMillis = wx.misc.GetLocalTimeMillis +wxDefaultDateTime = wx.misc.DefaultDateTime wxDF_INVALID = wx.misc.DF_INVALID wxDF_TEXT = wx.misc.DF_TEXT wxDF_BITMAP = wx.misc.DF_BITMAP -- 2.45.2