]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed wxDatePickerCtrl under OS X
authorRobert Roebling <robert@roebling.de>
Sat, 19 Apr 2008 17:22:23 +0000 (17:22 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 19 Apr 2008 17:22:23 +0000 (17:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/calctrlg.h
src/generic/calctrlg.cpp

index e4d3beabff8c31cb75ed89113ebbbd2415f289c8..9d9d296c92c00532f8659956a492539fd584e52c 100644 (file)
@@ -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
index 5a166b81d491dd8734ecf81eb7d4b2a33fb9f309..2370792bd6742f0667ef8b15b1ae943a808440d2 100644 (file)
@@ -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);