]>
Commit | Line | Data |
---|---|---|
39df3acd | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/generic/datectrl.h |
39df3acd VZ |
3 | // Purpose: generic wxDatePickerCtrl implementation |
4 | // Author: Andreas Pflug | |
5 | // Modified by: | |
6 | // Created: 2005-01-19 | |
39df3acd VZ |
7 | // Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de> |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_GENERIC_DATECTRL_H_ | |
12 | #define _WX_GENERIC_DATECTRL_H_ | |
13 | ||
a9e41db7 VZ |
14 | #include "wx/compositewin.h" |
15 | ||
4a40cd9b | 16 | class WXDLLIMPEXP_FWD_CORE wxComboCtrl; |
c245a012 | 17 | |
4a40cd9b | 18 | class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl; |
b5dbe15d | 19 | class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup; |
d5ae99f5 | 20 | |
a9e41db7 VZ |
21 | class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric |
22 | : public wxCompositeWindow<wxDatePickerCtrlBase> | |
39df3acd VZ |
23 | { |
24 | public: | |
4b134bb2 | 25 | // creating the control |
7ae712f5 | 26 | wxDatePickerCtrlGeneric() { Init(); } |
85fa9d60 | 27 | virtual ~wxDatePickerCtrlGeneric(); |
7ae712f5 VZ |
28 | wxDatePickerCtrlGeneric(wxWindow *parent, |
29 | wxWindowID id, | |
30 | const wxDateTime& date = wxDefaultDateTime, | |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, | |
33 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, | |
807f5038 | 34 | const wxValidator& validator = wxDefaultValidator, |
7ae712f5 VZ |
35 | const wxString& name = wxDatePickerCtrlNameStr) |
36 | { | |
37 | Init(); | |
38 | ||
807f5038 | 39 | (void)Create(parent, id, date, pos, size, style, validator, name); |
7ae712f5 | 40 | } |
39df3acd VZ |
41 | |
42 | bool Create(wxWindow *parent, | |
2cfbeac8 VZ |
43 | wxWindowID id, |
44 | const wxDateTime& date = wxDefaultDateTime, | |
45 | const wxPoint& pos = wxDefaultPosition, | |
46 | const wxSize& size = wxDefaultSize, | |
47 | long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, | |
807f5038 | 48 | const wxValidator& validator = wxDefaultValidator, |
2cfbeac8 | 49 | const wxString& name = wxDatePickerCtrlNameStr); |
39df3acd | 50 | |
4b134bb2 | 51 | // wxDatePickerCtrl methods |
39df3acd VZ |
52 | void SetValue(const wxDateTime& date); |
53 | wxDateTime GetValue() const; | |
4b134bb2 | 54 | |
39df3acd VZ |
55 | bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const; |
56 | void SetRange(const wxDateTime &dt1, const wxDateTime &dt2); | |
57 | ||
4b134bb2 VZ |
58 | bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime, |
59 | const wxDateTime& upperdate = wxDefaultDateTime); | |
60 | ||
61 | // extra methods available only in this (generic) implementation | |
c245a012 | 62 | wxCalendarCtrl *GetCalendar() const; |
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 | |
a9e41db7 VZ |
77 | // return the list of the windows composing this one |
78 | virtual wxWindowList GetCompositeWindowParts() const; | |
79 | ||
1721a8c0 | 80 | void OnText(wxCommandEvent &event); |
18fefee7 | 81 | void OnSize(wxSizeEvent& event); |
4427c0a3 | 82 | void OnFocus(wxFocusEvent& event); |
39df3acd | 83 | |
eb74c22a | 84 | #ifdef __WXOSX_COCOA__ |
4d87e34d | 85 | virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) { } |
eb74c22a RD |
86 | #endif |
87 | ||
85fa9d60 VZ |
88 | wxComboCtrl* m_combo; |
89 | wxCalendarComboPopup* m_popup; | |
77670008 | 90 | |
39df3acd | 91 | DECLARE_EVENT_TABLE() |
c0c133e1 | 92 | wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric); |
39df3acd VZ |
93 | }; |
94 | ||
95 | #endif // _WX_GENERIC_DATECTRL_H_ | |
96 |