]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/calctrl.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / gtk / calctrl.h
CommitLineData
628e155d
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/gtk/calctrl.h
3// Purpose: wxGtkCalendarCtrl control
4// Author: Marcin Wojdyr
628e155d
VZ
5// Copyright: (C) 2008 Marcin Wojdyr
6// Licence: wxWindows licence
7/////////////////////////////////////////////////////////////////////////////
8
9#ifndef GTK_CALCTRL_H__
10#define GTK_CALCTRL_H__
11
12class WXDLLIMPEXP_ADV wxGtkCalendarCtrl : public wxCalendarCtrlBase
13{
14public:
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
106f0d98
VZ
40 virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
41 const wxDateTime& upperdate = wxDefaultDateTime);
42 virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
43
628e155d
VZ
44 virtual bool EnableMonthChange(bool enable = true);
45
46 virtual void Mark(size_t day, bool mark);
47
7b0ccb8a
RR
48 // implementation
49 // --------------
106f0d98
VZ
50
51 void GTKGenerateEvent(wxEventType type);
7b0ccb8a 52
628e155d 53private:
106f0d98
VZ
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
628e155d 65 DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl)
c0c133e1 66 wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl);
628e155d
VZ
67};
68
69#endif // GTK_CALCTRL_H__