From 60df0f96859fb0131ddfa8b477612a15f4a43790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 17 Feb 2002 14:53:31 +0000 Subject: [PATCH] synthetize 'button up' event before doubleclick, too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mgl/window.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 720c058d8f..d2f4633140 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -197,7 +197,18 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e) // 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. + // clicks, so we have to synthetize the second one. First + // generate wxEVT_?_DOWN: + event.SetEventType(type); + win->GetEventHandler()->ProcessEvent(event); + + // ...followed by wxEVT_?_UP: + if ( e->message & EVT_LEFTBMASK ) + type = wxEVT_LEFT_UP; + else if ( e->message & EVT_MIDDLEBMASK ) + type = wxEVT_MIDDLE_UP; + else if ( e->message & EVT_RIGHTBMASK ) + type = wxEVT_RIGHT_UP; event.SetEventType(type); win->GetEventHandler()->ProcessEvent(event);