]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/calctrlg.cpp
need to AdjustScrollbars() after changing the virtual size in CalcDimensions()
[wxWidgets.git] / src / generic / calctrlg.cpp
index 5a166b81d491dd8734ecf81eb7d4b2a33fb9f309..d59309415be57bb5204dbcd0dc2c59168b8a11a4 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);
@@ -1742,45 +1760,6 @@ void wxGenericCalendarCtrl::OnChar(wxKeyEvent& event)
 // holidays handling
 // ----------------------------------------------------------------------------
 
-void wxGenericCalendarCtrl::EnableHolidayDisplay(bool display)
-{
-    long style = GetWindowStyle();
-    if ( display )
-        style |= wxCAL_SHOW_HOLIDAYS;
-    else
-        style &= ~wxCAL_SHOW_HOLIDAYS;
-
-    SetWindowStyle(style);
-
-    if ( display )
-        SetHolidayAttrs();
-    else
-        ResetHolidayAttrs();
-
-    Refresh();
-}
-
-void wxGenericCalendarCtrl::SetHolidayAttrs()
-{
-    if ( GetWindowStyle() & wxCAL_SHOW_HOLIDAYS )
-    {
-        ResetHolidayAttrs();
-
-        wxDateTime::Tm tm = m_date.GetTm();
-        wxDateTime dtStart(1, tm.mon, tm.year),
-                   dtEnd = dtStart.GetLastMonthDay();
-
-        wxDateTimeArray hol;
-        wxDateTimeHolidayAuthority::GetHolidaysInRange(dtStart, dtEnd, hol);
-
-        size_t count = hol.GetCount();
-        for ( size_t n = 0; n < count; n++ )
-        {
-            SetHoliday(hol[n].GetDay());
-        }
-    }
-}
-
 void wxGenericCalendarCtrl::SetHoliday(size_t day)
 {
     wxCHECK_RET( day > 0 && day < 32, _T("invalid day in SetHoliday") );