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 bool SetFormat(const wxString
& fmt
);
61 wxCalendarCtrl
*GetCalendar() const;
64 // implementation only from now on
65 // -------------------------------
67 // overridden base class methods
68 virtual bool Destroy();
71 virtual wxSize
DoGetBestSize() const;
76 void OnText(wxCommandEvent
&event
);
77 void OnSize(wxSizeEvent
& event
);
78 void OnFocus(wxFocusEvent
& event
);
81 wxCalendarComboPopup
* m_popup
;
84 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric
);
87 #endif // _WX_GENERIC_DATECTRL_H_