X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e508a2b616e077bf6c9b668b9f8034e1fbd59c4f..922ba68045d84789ab1dfceb4d1aa1b6e2c5e810:/wxPython/src/calendar.i diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index ee24ecbe02..0acbdd652d 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -41,6 +41,8 @@ enum { wxCAL_SHOW_HOLIDAYS, wxCAL_NO_YEAR_CHANGE, wxCAL_NO_MONTH_CHANGE, + wxCAL_SEQUENTIAL_MONTH_SELECTION, + wxCAL_SHOW_SURROUNDING_WEEKS, }; @@ -48,7 +50,10 @@ enum wxCalendarHitTestResult { wxCAL_HITTEST_NOWHERE, // outside of anything wxCAL_HITTEST_HEADER, // on the header (weekdays) - wxCAL_HITTEST_DAY // on a day in the calendar + wxCAL_HITTEST_DAY, // on a day in the calendar + wxCAL_HITTEST_INCMONTH, + wxCAL_HITTEST_DECMONTH, + wxCAL_HITTEST_SURROUNDING_WEEK }; // border types for a date @@ -93,10 +98,10 @@ public: bool IsHoliday() const; - const wxColour& GetTextColour() const; - const wxColour& GetBackgroundColour() const; - const wxColour& GetBorderColour() const; - const wxFont& GetFont() const; + wxColour GetTextColour() const; + wxColour GetBackgroundColour() const; + wxColour GetBorderColour() const; + wxFont GetFont() const; wxCalendarDateBorder GetBorder() const; }; @@ -155,8 +160,20 @@ public: const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCAL_SHOW_HOLIDAYS, + long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, const char* name = "calendar"); + %name(wxPreCalendarCtrl)wxCalendarCtrl(); + + bool Create(wxWindow *parent, + wxWindowID id, + const wxDateTime& date = wxDefaultDateTime, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxCAL_SHOW_HOLIDAYS | wxWANTS_CHARS, + const char* name = "calendar"); + + %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreCalendarCtrl:val._setOORInfo(val)" // set/get the current date // ------------------------ @@ -164,6 +181,18 @@ public: void SetDate(const wxDateTime& date); const wxDateTime& GetDate() const; + // set/get the range in which selection can occur + // --------------------------------------------- + + bool SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime); + const wxDateTime& GetLowerDateLimit() const; + bool SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime); + const wxDateTime& GetUpperDateLimit() const; + + bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, + const wxDateTime& upperdate = wxDefaultDateTime); + + // calendar mode // ------------- @@ -185,18 +214,18 @@ public: // header colours are used for painting the weekdays at the top void SetHeaderColours(const wxColour& colFg, const wxColour& colBg); - const wxColour& GetHeaderColourFg() const; - const wxColour& GetHeaderColourBg() const; + wxColour GetHeaderColourFg() const; + wxColour GetHeaderColourBg() const; // highlight colour is used for the currently selected date void SetHighlightColours(const wxColour& colFg, const wxColour& colBg); - const wxColour& GetHighlightColourFg() const; - const wxColour& GetHighlightColourBg() const; + wxColour GetHighlightColourFg() const; + wxColour GetHighlightColourBg() const; // holiday colour is used for the holidays (if style & wxCAL_SHOW_HOLIDAYS) void SetHolidayColours(const wxColour& colFg, const wxColour& colBg); - const wxColour& GetHolidayColourFg() const; - const wxColour& GetHolidayColourBg() const; + wxColour GetHolidayColourFg() const; + wxColour GetHolidayColourBg() const; // an item without custom attributes is drawn with the default colours and // font and without border, setting custom attributes allows to modify this @@ -219,6 +248,10 @@ public: wxDateTime *date = NULL, wxDateTime::WeekDay *wd = NULL); + + bool Enable(bool enable = TRUE); + bool Show(bool show = TRUE); + };