1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: Declaration of wxTimePickerCtrl class.
4 // Author: 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_TIMECTRL_H_
12 #define _WX_TIMECTRL_H_
16 #if wxUSE_TIMEPICKCTRL
18 #include "wx/datetimectrl.h"
20 #define wxTimePickerCtrlNameStr wxS("timectrl")
22 // No special styles are currently defined for this control but still define a
23 // symbolic constant for the default style for consistency.
29 // ----------------------------------------------------------------------------
30 // wxTimePickerCtrl: Allow the user to enter the time.
31 // ----------------------------------------------------------------------------
33 class WXDLLIMPEXP_ADV wxTimePickerCtrlBase
: public wxDateTimePickerCtrl
37 The derived classes should implement ctor and Create() method with the
40 bool Create(wxWindow *parent,
42 const wxDateTime& dt = 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);
51 We also inherit Set/GetValue() methods from the base class which define
52 our public API. Notice that the date portion of the date passed as
53 input is ignored and for the result date it's always today, but only
54 the time part of wxDateTime objects is really significant here.
58 #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
59 #include "wx/msw/timectrl.h"
61 #define wxHAS_NATIVE_TIMEPICKERCTRL
63 #include "wx/generic/timectrl.h"
65 class WXDLLIMPEXP_ADV wxTimePickerCtrl
: public wxTimePickerCtrlGeneric
68 wxTimePickerCtrl() { }
69 wxTimePickerCtrl(wxWindow
*parent
,
71 const wxDateTime
& date
= wxDefaultDateTime
,
72 const wxPoint
& pos
= wxDefaultPosition
,
73 const wxSize
& size
= wxDefaultSize
,
74 long style
= wxTP_DEFAULT
,
75 const wxValidator
& validator
= wxDefaultValidator
,
76 const wxString
& name
= wxTimePickerCtrlNameStr
)
77 : wxTimePickerCtrlGeneric(parent
, id
, date
, pos
, size
, style
, validator
, name
)
82 wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl
);
86 #endif // wxUSE_TIMEPICKCTRL
88 #endif // _WX_TIMECTRL_H_