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