]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/calctrl.h | |
3 | // Purpose: wxGtkCalendarCtrl control | |
4 | // Author: Marcin Wojdyr | |
5 | // Copyright: (C) 2008 Marcin Wojdyr | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef GTK_CALCTRL_H__ | |
10 | #define GTK_CALCTRL_H__ | |
11 | ||
12 | class WXDLLIMPEXP_ADV wxGtkCalendarCtrl : public wxCalendarCtrlBase | |
13 | { | |
14 | public: | |
15 | wxGtkCalendarCtrl() {} | |
16 | wxGtkCalendarCtrl(wxWindow *parent, | |
17 | wxWindowID id, | |
18 | const wxDateTime& date = wxDefaultDateTime, | |
19 | const wxPoint& pos = wxDefaultPosition, | |
20 | const wxSize& size = wxDefaultSize, | |
21 | long style = wxCAL_SHOW_HOLIDAYS, | |
22 | const wxString& name = wxCalendarNameStr) | |
23 | { | |
24 | Create(parent, id, date, pos, size, style, name); | |
25 | } | |
26 | ||
27 | bool Create(wxWindow *parent, | |
28 | wxWindowID id, | |
29 | const wxDateTime& date = wxDefaultDateTime, | |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = wxCAL_SHOW_HOLIDAYS, | |
33 | const wxString& name = wxCalendarNameStr); | |
34 | ||
35 | virtual ~wxGtkCalendarCtrl() {} | |
36 | ||
37 | virtual bool SetDate(const wxDateTime& date); | |
38 | virtual wxDateTime GetDate() const; | |
39 | ||
40 | virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, | |
41 | const wxDateTime& upperdate = wxDefaultDateTime); | |
42 | virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const; | |
43 | ||
44 | virtual bool EnableMonthChange(bool enable = true); | |
45 | ||
46 | virtual void Mark(size_t day, bool mark); | |
47 | ||
48 | // implementation | |
49 | // -------------- | |
50 | ||
51 | void GTKGenerateEvent(wxEventType type); | |
52 | ||
53 | private: | |
54 | bool IsInValidRange(const wxDateTime& dt) const; | |
55 | ||
56 | // Range of the dates that can be selected by user, either or both may be | |
57 | // invalid to indicate that no corresponding restriction is set. | |
58 | wxDateTime m_validStart, | |
59 | m_validEnd; | |
60 | ||
61 | // Last known selected date, may be different from the real selection in | |
62 | // the control while a handler for day-selected is running. | |
63 | wxDateTime m_selectedDate; | |
64 | ||
65 | DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl) | |
66 | wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl); | |
67 | }; | |
68 | ||
69 | #endif // GTK_CALCTRL_H__ |