X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f41cb81efc453b1da2e29078ef95c64016532cf3..0a816d95815bc4b77f860e88e8f12bf3e9adab10:/src/generic/calctrl.cpp diff --git a/src/generic/calctrl.cpp b/src/generic/calctrl.cpp index a6a8779994..04facbffb1 100644 --- a/src/generic/calctrl.cpp +++ b/src/generic/calctrl.cpp @@ -36,8 +36,7 @@ #include "wx/stattext.h" #endif //WX_PRECOMP -// Can only use wxSpinEvent if this is enabled -#if wxUSE_SPINBTN +#if wxUSE_CALENDARCTRL #include "wx/calctrl.h" @@ -472,10 +471,9 @@ wxSize wxCalendarCtrl::DoGetBestSize() const wxCoord width = 7*m_widthCol, height = 7*m_heightRow; - wxSize sizeCombo = m_comboMonth->GetBestSize(), - sizeSpin = m_spinYear->GetBestSize(); - - height += VERT_MARGIN + wxMax(sizeCombo.y, sizeSpin.y); + // the combobox doesn't report its height correctly (it returns the + // height including the drop down list) so don't use it + height += VERT_MARGIN + m_spinYear->GetBestSize().y; if ( GetWindowStyle() & (wxRAISED_BORDER | wxSUNKEN_BORDER) ) { @@ -1059,5 +1057,5 @@ wxCalendarEvent::wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type) m_date = cal->GetDate(); } -#endif // wxUSE_SPINBTN +#endif // wxUSE_CALENDARCTRL