X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bab3f3eac44fdc682febe918b3b50250e1991dec..6945b5878c8d46a56f1a59f558837a0943492f3c:/src/msw/datectrl.cpp diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 4b6c8c6e61..ec84f53d88 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 ) { @@ -111,6 +111,7 @@ wxDatePickerCtrl::Create(wxWindow *parent, return false; } +#if wxUSE_DYNLIB_CLASS INITCOMMONCONTROLSEX icex; icex.dwSize = sizeof(icex); icex.dwICC = ICC_DATE_CLASSES; @@ -126,6 +127,7 @@ wxDatePickerCtrl::Create(wxWindow *parent, } s_initDone = true; +#endif } @@ -180,7 +182,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; } // ----------------------------------------------------------------------------