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 #include "wx/calctrl.h"
18 class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup
;
20 class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
: public wxDatePickerCtrlBase
23 // creating the control
24 wxDatePickerCtrlGeneric() { Init(); }
25 virtual ~wxDatePickerCtrlGeneric();
26 wxDatePickerCtrlGeneric(wxWindow
*parent
,
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
)
37 (void)Create(parent
, id
, date
, pos
, size
, style
, validator
, name
);
40 bool Create(wxWindow
*parent
,
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
);
49 // wxDatePickerCtrl methods
50 void SetValue(const wxDateTime
& date
);
51 wxDateTime
GetValue() const;
53 bool GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const;
54 void SetRange(const wxDateTime
&dt1
, const wxDateTime
&dt2
);
56 bool SetDateRange(const wxDateTime
& lowerdate
= wxDefaultDateTime
,
57 const wxDateTime
& upperdate
= wxDefaultDateTime
);
59 // extra methods available only in this (generic) implementation
60 wxCalendarCtrl
*GetCalendar() const;
63 // implementation only from now on
64 // -------------------------------
66 // overridden base class methods
67 virtual bool Destroy();
70 virtual wxSize
DoGetBestSize() const;
75 void OnText(wxCommandEvent
&event
);
76 void OnSize(wxSizeEvent
& event
);
77 void OnFocus(wxFocusEvent
& event
);
80 wxCalendarComboPopup
* m_popup
;
83 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric
);
86 #endif // _WX_GENERIC_DATECTRL_H_