]>
Commit | Line | Data |
---|---|---|
39df3acd VZ |
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 | class WXDLLIMPEXP_ADV wxCalendarDateAttr; | |
16 | class WXDLLIMPEXP_ADV wxCalendarCtrl; | |
17 | class WXDLLIMPEXP_ADV wxCalendarEvent; | |
85fa9d60 VZ |
18 | class WXDLLIMPEXP_ADV wxComboCtrl; |
19 | class WXDLLIMPEXP_ADV wxCalendarComboPopup; | |
d5ae99f5 | 20 | |
7ae712f5 | 21 | class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase |
39df3acd VZ |
22 | { |
23 | public: | |
4b134bb2 | 24 | // creating the control |
7ae712f5 | 25 | wxDatePickerCtrlGeneric() { Init(); } |
85fa9d60 | 26 | virtual ~wxDatePickerCtrlGeneric(); |
7ae712f5 VZ |
27 | wxDatePickerCtrlGeneric(wxWindow *parent, |
28 | wxWindowID id, | |
29 | const wxDateTime& date = wxDefaultDateTime, | |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, | |
807f5038 | 33 | const wxValidator& validator = wxDefaultValidator, |
7ae712f5 VZ |
34 | const wxString& name = wxDatePickerCtrlNameStr) |
35 | { | |
36 | Init(); | |
37 | ||
807f5038 | 38 | (void)Create(parent, id, date, pos, size, style, validator, name); |
7ae712f5 | 39 | } |
39df3acd VZ |
40 | |
41 | bool Create(wxWindow *parent, | |
2cfbeac8 VZ |
42 | wxWindowID id, |
43 | const wxDateTime& date = wxDefaultDateTime, | |
44 | const wxPoint& pos = wxDefaultPosition, | |
45 | const wxSize& size = wxDefaultSize, | |
46 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, | |
807f5038 | 47 | const wxValidator& validator = wxDefaultValidator, |
2cfbeac8 | 48 | const wxString& name = wxDatePickerCtrlNameStr); |
39df3acd | 49 | |
4b134bb2 | 50 | // wxDatePickerCtrl methods |
39df3acd VZ |
51 | void SetValue(const wxDateTime& date); |
52 | wxDateTime GetValue() const; | |
4b134bb2 | 53 | |
39df3acd VZ |
54 | bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; |
55 | void SetRange(const wxDateTime &dt1, const wxDateTime &dt2); | |
56 | ||
4b134bb2 VZ |
57 | bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, |
58 | const wxDateTime& upperdate = wxDefaultDateTime); | |
59 | ||
60 | // extra methods available only in this (generic) implementation | |
61 | bool SetFormat(const wxChar *fmt); | |
62 | wxCalendarCtrl *GetCalendar() const { return m_cal; } | |
39df3acd | 63 | |
39df3acd | 64 | |
4b134bb2 VZ |
65 | // implementation only from now on |
66 | // ------------------------------- | |
39df3acd | 67 | |
4b134bb2 VZ |
68 | // overridden base class methods |
69 | virtual bool Destroy(); | |
39df3acd | 70 | |
4b134bb2 | 71 | protected: |
39df3acd | 72 | virtual wxSize DoGetBestSize() const; |
39df3acd VZ |
73 | |
74 | private: | |
39df3acd | 75 | void Init(); |
39df3acd | 76 | |
1721a8c0 | 77 | void OnText(wxCommandEvent &event); |
18fefee7 | 78 | void OnSize(wxSizeEvent& event); |
4427c0a3 | 79 | void OnFocus(wxFocusEvent& event); |
39df3acd | 80 | |
77670008 | 81 | wxCalendarCtrl *m_cal; |
85fa9d60 VZ |
82 | wxComboCtrl* m_combo; |
83 | wxCalendarComboPopup* m_popup; | |
77670008 VZ |
84 | |
85 | ||
39df3acd | 86 | DECLARE_EVENT_TABLE() |
7ae712f5 | 87 | DECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric) |
39df3acd VZ |
88 | }; |
89 | ||
90 | #endif // _WX_GENERIC_DATECTRL_H_ | |
91 |