Merge improvements to wxGenericCalendarCtrl mouse handling
Closes https://github.com/wxWidgets/wxWidgets/pull/143
This commit is contained in:
@@ -1325,13 +1325,26 @@ bool wxGenericCalendarCtrl::GetDateCoord(const wxDateTime& date, int *day, int *
|
|||||||
|
|
||||||
void wxGenericCalendarCtrl::OnDClick(wxMouseEvent& event)
|
void wxGenericCalendarCtrl::OnDClick(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
if ( HitTest(event.GetPosition()) != wxCAL_HITTEST_DAY )
|
wxDateTime date;
|
||||||
{
|
switch ( HitTest(event.GetPosition(), &date) )
|
||||||
event.Skip();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
case wxCAL_HITTEST_DAY:
|
||||||
GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED);
|
GenerateEvent(wxEVT_CALENDAR_DOUBLECLICKED);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxCAL_HITTEST_DECMONTH:
|
||||||
|
case wxCAL_HITTEST_INCMONTH:
|
||||||
|
// Consecutive simple clicks result in a series of simple and
|
||||||
|
// double click events, so handle them in the same way.
|
||||||
|
SetDateAndNotify(date);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxCAL_HITTEST_WEEK:
|
||||||
|
case wxCAL_HITTEST_HEADER:
|
||||||
|
case wxCAL_HITTEST_SURROUNDING_WEEK:
|
||||||
|
case wxCAL_HITTEST_NOWHERE:
|
||||||
|
event.Skip();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user