1 /////////////////////////////////////////////////////////////////////////////
2 // Name: generic/datectrl.h
3 // Purpose: generic wxDatePickerCtrl implementation
4 // Author: Andreas Pflug
8 // Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_DATECTRL_H_
13 #define _WX_GENERIC_DATECTRL_H_
15 class WXDLLIMPEXP_ADV wxCalendarDateAttr
;
16 class WXDLLIMPEXP_ADV wxCalendarCtrl
;
17 class WXDLLIMPEXP_ADV wxCalendarEvent
;
19 class WXDLLIMPEXP_ADV wxDatePickerCtrl
: public wxDatePickerCtrlBase
22 // creating the control
23 wxDatePickerCtrl() { Init(); }
24 wxDatePickerCtrl(wxWindow
*parent
,
26 const wxDateTime
& date
= wxDefaultDateTime
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
30 const wxString
& name
= wxDatePickerCtrlNameStr
);
32 bool Create(wxWindow
*parent
,
34 const wxDateTime
& date
,
38 const wxString
& name
=wxDatePickerCtrlNameStr
);
40 // wxDatePickerCtrl methods
41 void SetValue(const wxDateTime
& date
);
42 wxDateTime
GetValue() const;
44 bool GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const;
45 void SetRange(const wxDateTime
&dt1
, const wxDateTime
&dt2
);
47 bool SetDateRange(const wxDateTime
& lowerdate
= wxDefaultDateTime
,
48 const wxDateTime
& upperdate
= wxDefaultDateTime
);
50 // extra methods available only in this (generic) implementation
51 bool SetFormat(const wxChar
*fmt
);
52 wxCalendarCtrl
*GetCalendar() const { return m_cal
; }
55 // implementation only from now on
56 // -------------------------------
58 // overridden base class methods
59 virtual bool Destroy();
61 virtual bool Enable(bool enable
= TRUE
);
62 virtual bool Show(bool show
= TRUE
);
65 virtual wxSize
DoGetBestSize() const;
66 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
71 wxCalendarCtrl
*m_cal
;
75 bool m_dropped
, m_ignoreDrop
;
78 void DropDown(bool down
=true);
80 void OnText(wxCommandEvent
&ev
);
81 void OnEditKey(wxKeyEvent
& event
);
82 void OnCalKey(wxKeyEvent
& event
);
83 void OnClick(wxCommandEvent
&ev
);
84 void OnSelChange(wxCalendarEvent
&ev
);
85 void OnSetFocus(wxFocusEvent
&ev
);
86 void OnKillFocus(wxFocusEvent
&ev
);
87 void OnChildSetFocus(wxChildFocusEvent
&ev
);
89 DECLARE_DYNAMIC_CLASS(wxDatePickerCtrl
)
91 DECLARE_NO_COPY_CLASS(wxDatePickerCtrl
)
94 #endif // _WX_GENERIC_DATECTRL_H_