From d7b20621ef1170ed3c505f65d77227cf18c80499 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 19 Apr 2008 17:22:23 +0000 Subject: [PATCH] Fixed wxDatePickerCtrl under OS X git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/calctrlg.h | 1 + src/generic/calctrlg.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/wx/generic/calctrlg.h b/include/wx/generic/calctrlg.h index e4d3beabff..9d9d296c92 100644 --- a/include/wx/generic/calctrlg.h +++ b/include/wx/generic/calctrlg.h @@ -169,6 +169,7 @@ protected: // override some base class virtuals virtual wxSize DoGetBestSize() const; virtual void DoMoveWindow(int x, int y, int width, int height); + virtual void DoGetSize(int *width, int *height) const; private: // common part of all ctors diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index 5a166b81d4..2370792bd6 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -851,6 +851,24 @@ void wxGenericCalendarCtrl::DoMoveWindow(int x, int y, int width, int height) wxControl::DoMoveWindow(x, y + yDiff, width, height - yDiff); } +void wxGenericCalendarCtrl::DoGetSize(int *width, int *height) const +{ +#ifdef __WXMAC__ + wxControl::DoGetSize( width, height ); + + if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) && m_staticMonth && height ) + { + wxSize sizeCombo = m_comboMonth->GetEffectiveMinSize(); + wxSize sizeSpin = m_spinYear->GetSize(); + + int maxHeight = wxMax(sizeSpin.y, sizeCombo.y); + *height += maxHeight + VERT_MARGIN; + } +#else + wxControl::DoGetSize( width, height ); +#endif +} + void wxGenericCalendarCtrl::RecalcGeometry() { wxClientDC dc(this); -- 2.45.2