]>
git.saurik.com Git - wxWidgets.git/blob - src/osx/datetimectrl_osx.cpp
952ac3e05dd7ca3633130ea56cb12b85783e1d4b
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/datetimectrl_osx.cpp
3 // Purpose: Implementation of wxDateTimePickerCtrl for OS X.
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
26 #if wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL
31 #include "wx/datectrl.h"
32 #include "wx/datetimectrl.h"
34 #include "wx/osx/core/private/datetimectrl.h"
36 // ============================================================================
37 // wxDateTimePickerCtrl implementation
38 // ============================================================================
40 wxDateTimeWidgetImpl
* wxDateTimePickerCtrl::GetDateTimePeer() const
42 return static_cast<wxDateTimeWidgetImpl
*>(GetPeer());
45 void wxDateTimePickerCtrl::SetValue(const wxDateTime
& dt
)
49 GetDateTimePeer()->SetDateTime(dt
);
53 wxASSERT_MSG( HasFlag(wxDP_ALLOWNONE
),
54 wxT("this control must have a valid date") );
56 // TODO setting to an invalid date is not natively supported
57 // so we must implement a UI for that ourselves
58 GetDateTimePeer()->SetDateTime(dt
);
62 wxDateTime
wxDateTimePickerCtrl::GetValue() const
64 return GetDateTimePeer()->GetDateTime();
68 #endif // wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL