]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/calctrl.h
Make GTK callbacks passed to GTKConnectWidget() extern "C".
[wxWidgets.git] / include / wx / gtk / calctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/calctrl.h
3 // Purpose: wxGtkCalendarCtrl control
4 // Author: Marcin Wojdyr
5 // RCS-ID: $Id$
6 // Copyright: (C) 2008 Marcin Wojdyr
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef GTK_CALCTRL_H__
11 #define GTK_CALCTRL_H__
12
13 class WXDLLIMPEXP_ADV wxGtkCalendarCtrl : public wxCalendarCtrlBase
14 {
15 public:
16 wxGtkCalendarCtrl() {}
17 wxGtkCalendarCtrl(wxWindow *parent,
18 wxWindowID id,
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)
24 {
25 Create(parent, id, date, pos, size, style, name);
26 }
27
28 bool Create(wxWindow *parent,
29 wxWindowID id,
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);
35
36 virtual ~wxGtkCalendarCtrl() {}
37
38 virtual bool SetDate(const wxDateTime& date);
39 virtual wxDateTime GetDate() const;
40
41 virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
42 const wxDateTime& upperdate = wxDefaultDateTime);
43 virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
44
45 virtual bool EnableMonthChange(bool enable = true);
46
47 virtual void Mark(size_t day, bool mark);
48
49 // implementation
50 // --------------
51
52 void GTKGenerateEvent(wxEventType type);
53
54 private:
55 bool IsInValidRange(const wxDateTime& dt) const;
56
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,
60 m_validEnd;
61
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;
65
66 DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl)
67 wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl);
68 };
69
70 #endif // GTK_CALCTRL_H__