1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/datectrl.h
3 // Purpose: generic wxDatePickerCtrl implementation
4 // Author: Andreas Pflug
7 // Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_DATECTRL_H_
12 #define _WX_GENERIC_DATECTRL_H_
14 #include "wx/compositewin.h"
16 class WXDLLIMPEXP_FWD_CORE wxComboCtrl
;
18 class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl
;
19 class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup
;
21 class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
22 : public wxCompositeWindow
<wxDatePickerCtrlBase
>
25 // creating the control
26 wxDatePickerCtrlGeneric() { Init(); }
27 virtual ~wxDatePickerCtrlGeneric();
28 wxDatePickerCtrlGeneric(wxWindow
*parent
,
30 const wxDateTime
& date
= wxDefaultDateTime
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxDP_DEFAULT
| wxDP_SHOWCENTURY
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxDatePickerCtrlNameStr
)
39 (void)Create(parent
, id
, date
, pos
, size
, style
, validator
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxDateTime
& date
= wxDefaultDateTime
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDP_DEFAULT
| wxDP_SHOWCENTURY
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxDatePickerCtrlNameStr
);
51 // wxDatePickerCtrl methods
52 void SetValue(const wxDateTime
& date
);
53 wxDateTime
GetValue() const;
55 bool GetRange(wxDateTime
*dt1
, wxDateTime
*dt2
) const;
56 void SetRange(const wxDateTime
&dt1
, const wxDateTime
&dt2
);
58 bool SetDateRange(const wxDateTime
& lowerdate
= wxDefaultDateTime
,
59 const wxDateTime
& upperdate
= wxDefaultDateTime
);
61 // extra methods available only in this (generic) implementation
62 wxCalendarCtrl
*GetCalendar() const;
65 // implementation only from now on
66 // -------------------------------
68 // overridden base class methods
69 virtual bool Destroy();
72 virtual wxSize
DoGetBestSize() const;
77 // return the list of the windows composing this one
78 virtual wxWindowList
GetCompositeWindowParts() const;
80 void OnText(wxCommandEvent
&event
);
81 void OnSize(wxSizeEvent
& event
);
82 void OnFocus(wxFocusEvent
& event
);
84 #ifdef __WXOSX_COCOA__
85 virtual void OSXGenerateEvent(const wxDateTime
& WXUNUSED(dt
)) { }
89 wxCalendarComboPopup
* m_popup
;
92 wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric
);
95 #endif // _WX_GENERIC_DATECTRL_H_