]>
git.saurik.com Git - wxWidgets.git/blob - src/osx/datetimectrl_osx.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/datetimectrl_osx.cpp
3 // Purpose: Implementation of wxDateTimePickerCtrl for OS X.
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 // for compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
25 #if wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL
30 #include "wx/datectrl.h"
31 #include "wx/datetimectrl.h"
33 #include "wx/osx/core/private/datetimectrl.h"
35 // ============================================================================
36 // wxDateTimePickerCtrl implementation
37 // ============================================================================
39 wxDateTimeWidgetImpl
* wxDateTimePickerCtrl::GetDateTimePeer() const
41 return static_cast<wxDateTimeWidgetImpl
*>(GetPeer());
44 void wxDateTimePickerCtrl::SetValue(const wxDateTime
& dt
)
48 GetDateTimePeer()->SetDateTime(dt
);
52 wxASSERT_MSG( HasFlag(wxDP_ALLOWNONE
),
53 wxT("this control must have a valid date") );
55 // TODO setting to an invalid date is not natively supported
56 // so we must implement a UI for that ourselves
57 GetDateTimePeer()->SetDateTime(dt
);
61 wxDateTime
wxDateTimePickerCtrl::GetValue() const
63 return GetDateTimePeer()->GetDateTime();
67 #endif // wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL