X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fceac6bbfe23180d460ef62dac83c591d9e0f941..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/cocoa/datetimectrl.mm?ds=sidebyside diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm index 4e8a44e894..263a8aa6e8 100644 --- a/src/osx/cocoa/datetimectrl.mm +++ b/src/osx/cocoa/datetimectrl.mm @@ -78,7 +78,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 +177,9 @@ wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer, } wxDateTimeWidgetImpl* c = new wxDateTimeWidgetCocoaImpl(wxpeer, v); +#if !wxOSX_USE_NATIVE_FLIPPED c->SetFlipped(false); +#endif return c; }