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/compositewin.h"
17 class WXDLLIMPEXP_FWD_CORE wxComboCtrl
;
19 class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl
;
20 class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup
;
22 class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
23 : public wxCompositeWindow
<wxDatePickerCtrlBase
>
26 // creating the control
27 wxDatePickerCtrlGeneric() { Init(); }
28 virtual ~wxDatePickerCtrlGeneric();
29 wxDatePickerCtrlGeneric(wxWindow
*parent
,
31 const wxDateTime
& date
= wxDefaultDateTime
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxDP_DEFAULT
| wxDP_SHOWCENTURY
,
35 const wxValidator
& validator
= wxDefaultValidator
,
36 const wxString
& name
= wxDatePickerCtrlNameStr
)
40 (void)Create(parent
, id
, date
, pos
, size
, style
, validator
, name
);
43 bool Create(wxWindow
*parent
,
45 const wxDateTime
& date
= wxDefaultDateTime
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxDP_DEFAULT
| wxDP_SHOWCENTURY
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxDatePickerCtrlNameStr
);
52 // wxDatePickerCtrl methods
53 void SetValue(const wxDateTime
& date
);
54 wxDateTime
GetValue() const;
56 bool GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const;
57 void SetRange(const wxDateTime
&dt1
, const wxDateTime
&dt2
);
59 bool SetDateRange(const wxDateTime
& lowerdate
= wxDefaultDateTime
,
60 const wxDateTime
& upperdate
= wxDefaultDateTime
);
62 // extra methods available only in this (generic) implementation
63 wxCalendarCtrl
*GetCalendar() const;
66 // implementation only from now on
67 // -------------------------------
69 // overridden base class methods
70 virtual bool Destroy();
73 virtual wxSize
DoGetBestSize() const;
78 // return the list of the windows composing this one
79 virtual wxWindowList
GetCompositeWindowParts() const;
81 void OnText(wxCommandEvent
&event
);
82 void OnSize(wxSizeEvent
& event
);
83 void OnFocus(wxFocusEvent
& event
);
86 wxCalendarComboPopup
* m_popup
;
89 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric
);
92 #endif // _WX_GENERIC_DATECTRL_H_