]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/calctrl.h
Forward events to active child at MSW, not wx, level in wxMDIParentFrame.
[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
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
13class WXDLLIMPEXP_ADV wxGtkCalendarCtrl : public wxCalendarCtrlBase
14{
15public:
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
106f0d98
VZ
41 virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
42 const wxDateTime& upperdate = wxDefaultDateTime);
43 virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
44
628e155d
VZ
45 virtual bool EnableMonthChange(bool enable = true);
46
47 virtual void Mark(size_t day, bool mark);
48
7b0ccb8a
RR
49 // implementation
50 // --------------
106f0d98
VZ
51
52 void GTKGenerateEvent(wxEventType type);
7b0ccb8a 53
628e155d 54private:
106f0d98
VZ
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
628e155d 66 DECLARE_DYNAMIC_CLASS(wxGtkCalendarCtrl)
c0c133e1 67 wxDECLARE_NO_COPY_CLASS(wxGtkCalendarCtrl);
628e155d
VZ
68};
69
70#endif // GTK_CALCTRL_H__