1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/timectrl.h
3 // Purpose: Generic implementation of wxTimePickerCtrl.
4 // Author: Paul Breen, Vadim Zeitlin
6 // RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_TIMECTRL_H_
12 #define _WX_GENERIC_TIMECTRL_H_
14 #include "wx/containr.h"
15 #include "wx/compositewin.h"
17 class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
18 : public wxCompositeWindow
< wxNavigationEnabled
<wxTimePickerCtrlBase
> >
21 typedef wxCompositeWindow
< wxNavigationEnabled
<wxTimePickerCtrlBase
> > Base
;
23 // Creating the control.
24 wxTimePickerCtrlGeneric() { Init(); }
25 virtual ~wxTimePickerCtrlGeneric();
26 wxTimePickerCtrlGeneric(wxWindow
*parent
,
28 const wxDateTime
& date
= wxDefaultDateTime
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxTP_DEFAULT
,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxTimePickerCtrlNameStr
)
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
= wxTP_DEFAULT
,
46 const wxValidator
& validator
= wxDefaultValidator
,
47 const wxString
& name
= wxTimePickerCtrlNameStr
);
49 // Implement pure virtual wxTimePickerCtrlBase methods.
50 virtual void SetValue(const wxDateTime
& date
);
51 virtual wxDateTime
GetValue() const;
54 virtual wxSize
DoGetBestSize() const;
56 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
58 // This is a really ugly hack but to compile this class in wxMSW we must
59 // define these functions even though they are never called because they're
60 // only used by the native implementation.
62 virtual wxLocaleInfo
MSWGetFormat() const
64 wxFAIL_MSG( "Unreachable" );
65 return wxLOCALE_TIME_FMT
;
68 virtual bool MSWAllowsNone() const
70 wxFAIL_MSG( "Unreachable" );
74 virtual bool MSWOnDateTimeChange(const tagNMDATETIMECHANGE
& WXUNUSED(dtch
))
76 wxFAIL_MSG( "Unreachable" );
84 // Return the list of the windows composing this one.
85 virtual wxWindowList
GetCompositeWindowParts() const;
87 // Implementation data.
88 class wxTimePickerGenericImpl
* m_impl
;
90 wxDECLARE_NO_COPY_CLASS(wxTimePickerCtrlGeneric
);
93 #endif // _WX_GENERIC_TIMECTRL_H_