Refresh(true, &rect);
}
-void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate, const wxDateTime& todate, wxPen* pPen, wxBrush* pBrush)
+void wxCalendarCtrl::HighlightRange(wxPaintDC* pDC, const wxDateTime& fromdate, const wxDateTime& todate, const wxPen* pPen, const wxBrush* pBrush)
{
// Highlights the given range using pen and brush
// Does nothing if todate < fromdate
wxDateTime::WeekDay *wd)
{
RecalcGeometry();
+ // use the correct x-pos
+ wxCoord x0 = wxMax((GetSize().x - m_widthCol*7) /2, 0);
+ wxPoint pos_corr = pos;
+ pos_corr.x -= x0;
- wxCoord y = pos.y;
+ wxCoord y = pos_corr.y;
///////////////////////////////////////////////////////////////////////////////////////////////////////
if ( (GetWindowStyle() & wxCAL_SEQUENTIAL_MONTH_SELECTION) )
// we need to find out if the hit is on left arrow, on month or on right arrow
// left arrow?
- if ( wxRegion(m_leftArrowRect).Contains(pos) == wxInRegion )
+ if ( wxRegion(m_leftArrowRect).Contains(pos_corr) == wxInRegion )
{
if ( date )
{
return wxCAL_HITTEST_DECMONTH;
}
- if ( wxRegion(m_rightArrowRect).Contains(pos) == wxInRegion )
+ if ( wxRegion(m_rightArrowRect).Contains(pos_corr) == wxInRegion )
{
if ( date )
{
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Header: Days
- wxCoord x0 = wxMax( (GetSize().x - m_widthCol*7) /2 , 0 );
-
- int wday = ( pos.x - x0 ) / m_widthCol;
+ int wday = pos_corr.x / m_widthCol;
// if ( y < m_heightRow )
if ( y < (m_heightRow + m_rowOffset) )
{
}
break;
- case WXK_PRIOR:
+ case WXK_PAGEUP:
target = m_date - wxDateSpan::Month();
ChangeMonth(&target);
SetDateAndNotify(target); // always
break;
- case WXK_NEXT:
+ case WXK_PAGEDOWN:
target = m_date + wxDateSpan::Month();
ChangeMonth(&target);
SetDateAndNotify(target); // always