X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fceac6bbfe23180d460ef62dac83c591d9e0f941..cb6b81bc94108bcb0a702ac5fdaf4944fa7706a0:/src/osx/cocoa/datetimectrl.mm diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm index 4e8a44e894..575a8a2b48 100644 --- a/src/osx/cocoa/datetimectrl.mm +++ b/src/osx/cocoa/datetimectrl.mm @@ -3,7 +3,6 @@ // Purpose: Implementation of wxDateTimePickerCtrl for Cocoa. // Author: Vadim Zeitlin // Created: 2011-12-18 -// Version: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -78,7 +77,12 @@ public: virtual void SetDateTime(const wxDateTime& dt) { - [View() setDateValue: NSDateFromWX(dt)]; + wxDateTime dtFrom, dtTo; + + if ( GetDateRange(&dtFrom,&dtTo) == false || + ( (!dtFrom.IsValid() || dtFrom <= dt) && + (!dtTo.IsValid() || dt <= dtTo ) ) ) + [View() setDateValue: NSDateFromWX(dt)]; } virtual wxDateTime GetDateTime() const @@ -172,7 +176,9 @@ wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer, } wxDateTimeWidgetImpl* c = new wxDateTimeWidgetCocoaImpl(wxpeer, v); +#if !wxOSX_USE_NATIVE_FLIPPED c->SetFlipped(false); +#endif return c; }