+#endif
+
+ wxCoord y = 0;
+ wxCoord x0 = wxMax( (GetSize().x - m_widthCol*7) /2 , 0 );
+
+ if ( HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) )
+ {
+ // draw the sequential month-selector
+
+ dc.SetBackgroundMode(wxTRANSPARENT);
+ dc.SetTextForeground(*wxBLACK);
+ dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID));
+ dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID));
+ dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
+
+ // Get extent of month-name + year
+ wxCoord monthw, monthh;
+ wxString headertext = m_date.Format(wxT("%B %Y"));
+ dc.GetTextExtent(headertext, &monthw, &monthh);
+
+ // draw month-name centered above weekdays
+ wxCoord monthx = ((m_widthCol * 7) - monthw) / 2 + x0;
+ wxCoord monthy = ((m_heightRow - monthh) / 2) + y;
+ dc.DrawText(headertext, monthx, monthy);
+
+ // calculate the "month-arrows"
+ wxPoint leftarrow[3];
+ wxPoint rightarrow[3];
+
+ int arrowheight = monthh / 2;
+
+ leftarrow[0] = wxPoint(0, arrowheight / 2);
+ leftarrow[1] = wxPoint(arrowheight / 2, 0);
+ leftarrow[2] = wxPoint(arrowheight / 2, arrowheight - 1);
+
+ rightarrow[0] = wxPoint(0,0);
+ rightarrow[1] = wxPoint(arrowheight / 2, arrowheight / 2);
+ rightarrow[2] = wxPoint(0, arrowheight - 1);
+
+ // draw the "month-arrows"
+
+ wxCoord arrowy = (m_heightRow - arrowheight) / 2;
+ wxCoord larrowx = (m_widthCol - (arrowheight / 2)) / 2 + x0;
+ wxCoord rarrowx = ((m_widthCol - (arrowheight / 2)) / 2) + m_widthCol*6 + x0;
+ m_leftArrowRect = m_rightArrowRect = wxRect(0,0,0,0);
+
+ if ( AllowMonthChange() )
+ {
+ wxDateTime ldpm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) - wxDateSpan::Day(); // last day prev month
+ // Check if range permits change
+ if ( IsDateInRange(ldpm) && ( ( ldpm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) )
+ {
+ m_leftArrowRect = wxRect(larrowx - 3, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
+ dc.SetBrush(*wxBLACK_BRUSH);
+ dc.SetPen(*wxBLACK_PEN);
+ dc.DrawPolygon(3, leftarrow, larrowx , arrowy, wxWINDING_RULE);
+ dc.SetBrush(*wxTRANSPARENT_BRUSH);
+ dc.DrawRectangle(m_leftArrowRect);
+ }
+ wxDateTime fdnm = wxDateTime(1,m_date.GetMonth(), m_date.GetYear()) + wxDateSpan::Month(); // first day next month
+ if ( IsDateInRange(fdnm) && ( ( fdnm.GetYear() == m_date.GetYear() ) ? true : AllowYearChange() ) )
+ {
+ m_rightArrowRect = wxRect(rarrowx - 4, arrowy - 3, (arrowheight / 2) + 8, (arrowheight + 6));
+ dc.SetBrush(*wxBLACK_BRUSH);
+ dc.SetPen(*wxBLACK_PEN);
+ dc.DrawPolygon(3, rightarrow, rarrowx , arrowy, wxWINDING_RULE);
+ dc.SetBrush(*wxTRANSPARENT_BRUSH);
+ dc.DrawRectangle(m_rightArrowRect);
+ }
+ }
+
+ y += m_heightRow;
+ }