corrected double click events: wxMGL will now synthetize
second single click, so that events sequence is single-single-double as wxWindows expects rather than single-double as MGL generates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -175,19 +175,36 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
|
|||||||
switch (e->what)
|
switch (e->what)
|
||||||
{
|
{
|
||||||
case EVT_MOUSEDOWN:
|
case EVT_MOUSEDOWN:
|
||||||
if ( e->message & EVT_LEFTBMASK )
|
// Change focus if the user clicks outside focused window:
|
||||||
type = (e->message & EVT_DBLCLICK) ?
|
|
||||||
wxEVT_LEFT_DCLICK : wxEVT_LEFT_DOWN;
|
|
||||||
else if ( e->message & EVT_MIDDLEBMASK )
|
|
||||||
type = (e->message & EVT_DBLCLICK) ?
|
|
||||||
wxEVT_MIDDLE_DCLICK : wxEVT_MIDDLE_DOWN;
|
|
||||||
else if ( e->message & EVT_RIGHTBMASK )
|
|
||||||
type = (e->message & EVT_DBLCLICK) ?
|
|
||||||
wxEVT_RIGHT_DCLICK : wxEVT_RIGHT_DOWN;
|
|
||||||
|
|
||||||
if ( win->AcceptsFocus() && wxWindow::FindFocus() != win )
|
if ( win->AcceptsFocus() && wxWindow::FindFocus() != win )
|
||||||
win->SetFocus();
|
win->SetFocus();
|
||||||
|
|
||||||
|
if ( e->message & EVT_LEFTBMASK )
|
||||||
|
type = wxEVT_LEFT_DOWN;
|
||||||
|
else if ( e->message & EVT_MIDDLEBMASK )
|
||||||
|
type = wxEVT_MIDDLE_DOWN;
|
||||||
|
else if ( e->message & EVT_RIGHTBMASK )
|
||||||
|
type = wxEVT_RIGHT_DOWN;
|
||||||
|
|
||||||
|
if ( e->message & EVT_DBLCLICK )
|
||||||
|
{
|
||||||
|
// MGL doesn't generate two subsequent single clicks prior
|
||||||
|
// to a double click, but rather only fires one single click
|
||||||
|
// followed by one double click. wxWindows expects two single
|
||||||
|
// clicks, so we have to emulate the second one.
|
||||||
|
event.SetEventType(type);
|
||||||
|
win->GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
|
// And change event type for the real double click event
|
||||||
|
// that will be generated later in this function:
|
||||||
|
if ( e->message & EVT_LEFTBMASK )
|
||||||
|
type = wxEVT_LEFT_DCLICK;
|
||||||
|
else if ( e->message & EVT_MIDDLEBMASK )
|
||||||
|
type = wxEVT_MIDDLE_DCLICK;
|
||||||
|
else if ( e->message & EVT_RIGHTBMASK )
|
||||||
|
type = wxEVT_RIGHT_DCLICK;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_MOUSEUP:
|
case EVT_MOUSEUP:
|
||||||
|
Reference in New Issue
Block a user