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 /////////////////////////////////////////////////////////////////////////////
9 #ifndef GTK_CALCTRL_H__
10 #define GTK_CALCTRL_H__
12 class WXDLLIMPEXP_ADV wxGtkCalendarCtrl
: public wxCalendarCtrlBase
15 wxGtkCalendarCtrl() {}
16 wxGtkCalendarCtrl(wxWindow
*parent
,
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
)
24 Create(parent
, id
, date
, pos
, size
, style
, name
);
27 bool Create(wxWindow
*parent
,
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
);
35 virtual ~wxGtkCalendarCtrl() {}
37 virtual bool SetDate(const wxDateTime
& date
);
38 virtual wxDateTime
GetDate() const;
40 virtual bool SetDateRange(const wxDateTime
& lowerdate
= wxDefaultDateTime
,
41 const wxDateTime
& upperdate
= wxDefaultDateTime
);
42 virtual bool GetDateRange(wxDateTime
*lowerdate
, wxDateTime
*upperdate
) const;
44 virtual bool EnableMonthChange(bool enable
= true);
46 virtual void Mark(size_t day
, bool mark
);
51 void GTKGenerateEvent(wxEventType type
);
54 bool IsInValidRange(const wxDateTime
& dt
) const;
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
,
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
;
65 DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl
)
66 wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl
);
69 #endif // GTK_CALCTRL_H__