X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a1f999fafa4312ccd47b7be65c672c2220fea36..2e2a55b22eebde25797bd030660d8c644bc7700b:/src/msw/datectrl.cpp diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 2660838d00..c0d3396ddc 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -100,7 +100,7 @@ wxDatePickerCtrl::Create(wxWindow *parent, // supposed to initialize all common controls, in comctl32.dll 4.72 (and // presumably earlier versions 4.70 and 4.71, date time picker not being // supported in < 4.70 anyhow) it does not do it and we have to initialize - // it explicitely + // it explicitly static bool s_initDone = false; // MT-ok: used from GUI thread only if ( !s_initDone ) { @@ -141,7 +141,7 @@ wxDatePickerCtrl::Create(wxWindow *parent, if ( !MSWCreateControl(DATETIMEPICK_CLASS, wxEmptyString, pos, size) ) return false; - if ( dt.IsValid() ) + if ( dt.IsValid() || (style & wxDP_ALLOWNONE) ) SetValue(dt); return true; @@ -180,7 +180,9 @@ wxSize wxDatePickerCtrl::DoGetBestSize() const { const int y = GetCharHeight(); - return wxSize(DEFAULT_ITEM_WIDTH, EDIT_HEIGHT_FROM_CHAR_HEIGHT(y)); + wxSize best(DEFAULT_ITEM_WIDTH, EDIT_HEIGHT_FROM_CHAR_HEIGHT(y)); + CacheBestSize(best); + return best; } // ----------------------------------------------------------------------------