X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f02a879ed7efc5fcf6328ff47a1352ec82812b7..cbc9145c04bd3ea0a228906c8363fa8f47e3acf9:/src/generic/datectlg.cpp diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index abcbacf408..ab5d7448d7 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: generic/datectlg.cpp +// Name: src/generic/datectlg.cpp // Purpose: generic wxDatePickerCtrlGeneric implementation // Author: Andreas Pflug // Modified by: @@ -569,14 +569,18 @@ void wxDatePickerCtrlGeneric::DoMoveWindow(int x, int y, int w, int h) wxControl::DoMoveWindow(x, y, w, h); if (m_dropped) - DropDown(true); + DropDown(false); } wxSize wxDatePickerCtrlGeneric::DoGetBestSize() const { - int bh=m_btn->GetBestSize().y; - int eh=m_txt->GetBestSize().y; - return wxSize(DEFAULT_ITEM_WIDTH, bh > eh ? bh : eh); + if (m_btn && m_txt) + { + int bh=m_btn->GetBestSize().y; + int eh=m_txt->GetBestSize().y; + return wxSize(DEFAULT_ITEM_WIDTH, bh > eh ? bh : eh); + } + return wxControl::DoGetBestSize(); } @@ -736,7 +740,7 @@ bool wxDatePickerCtrlGeneric::GetRange(wxDateTime *dt1, wxDateTime *dt2) const { if (dt1) *dt1 = m_cal->GetLowerDateLimit(); - if (dt1) + if (dt2) *dt2 = m_cal->GetUpperDateLimit(); return true; } @@ -953,4 +957,3 @@ void wxDatePickerCtrlGeneric::OnCalKey(wxKeyEvent & ev) #endif // wxUSE_DATEPICKCTRL_GENERIC #endif // wxUSE_DATEPICKCTRL -