]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/datectrl.h
Add wxUSE_RIBBON to wx/setup_inc.h and wx/chkconf.h.
[wxWidgets.git] / include / wx / generic / datectrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: generic/datectrl.h
3 // Purpose: generic wxDatePickerCtrl implementation
4 // Author: Andreas Pflug
5 // Modified by:
6 // Created: 2005-01-19
7 // RCS-ID: $Id$
8 // Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_GENERIC_DATECTRL_H_
13 #define _WX_GENERIC_DATECTRL_H_
14
15 #include "wx/calctrl.h"
16 #include "wx/combo.h"
17
18 class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup;
19
20 class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase
21 {
22 public:
23 // creating the control
24 wxDatePickerCtrlGeneric() { Init(); }
25 virtual ~wxDatePickerCtrlGeneric();
26 wxDatePickerCtrlGeneric(wxWindow *parent,
27 wxWindowID id,
28 const wxDateTime& date = wxDefaultDateTime,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
32 const wxValidator& validator = wxDefaultValidator,
33 const wxString& name = wxDatePickerCtrlNameStr)
34 {
35 Init();
36
37 (void)Create(parent, id, date, pos, size, style, validator, name);
38 }
39
40 bool Create(wxWindow *parent,
41 wxWindowID id,
42 const wxDateTime& date = wxDefaultDateTime,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
46 const wxValidator& validator = wxDefaultValidator,
47 const wxString& name = wxDatePickerCtrlNameStr);
48
49 // wxDatePickerCtrl methods
50 void SetValue(const wxDateTime& date);
51 wxDateTime GetValue() const;
52
53 bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
54 void SetRange(const wxDateTime &dt1, const wxDateTime &dt2);
55
56 bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
57 const wxDateTime& upperdate = wxDefaultDateTime);
58
59 // extra methods available only in this (generic) implementation
60 wxCalendarCtrl *GetCalendar() const;
61
62
63 // implementation only from now on
64 // -------------------------------
65
66 // overridden base class methods
67 virtual bool Destroy();
68
69 protected:
70 virtual wxSize DoGetBestSize() const;
71
72 private:
73 void Init();
74
75 void OnText(wxCommandEvent &event);
76 void OnSize(wxSizeEvent& event);
77 void OnFocus(wxFocusEvent& event);
78
79 wxComboCtrl* m_combo;
80 wxCalendarComboPopup* m_popup;
81
82 DECLARE_EVENT_TABLE()
83 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
84 };
85
86 #endif // _WX_GENERIC_DATECTRL_H_
87