Handle all consecutive clicks on generic calendar month buttons

Without handling the double click event, some (or all, on OS X) of the
following clicks in a rapid series of clicks are ignored. This makes changing
the month unnecessarily slow.
This commit is contained in:
Lauri Nurmi 2015-12-03 22:30:44 +02:00 committed by Vadim Zeitlin
parent c239160d33
commit 773690203e

View File

@ -1325,13 +1325,21 @@ bool wxGenericCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *
void wxGenericCalendarCtrl::OnDClick(wxMouseEvent& event)
{
if ( HitTest(event.GetPosition()) != wxCAL_HITTEST_DAY )
switch ( HitTest(event.GetPosition()) )
{
event.Skip();
}
else
{
GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED);
case wxCAL_HITTEST_DAY:
GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED);
break;
case wxCAL_HITTEST_DECMONTH:
case wxCAL_HITTEST_INCMONTH:
// allow quickly clicking the inc/dec button any number of
// times in a row by handling also the double-click event.
OnClick(event);
break;
default:
event.Skip();
break;
}
}