mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fixes Atlas double-click behavior in simulation test, by handling the events in Canvas and recognizing wxWidgets' ButtonDown and ButtonDClick events are mutually exclusive.
This was SVN commit r11035.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2011 Wildfire Games.
|
||||
/* Copyright (C) 2012 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -96,14 +96,17 @@ void Canvas::OnMouse(wxMouseEvent& evt)
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(Canvas, wxGLCanvas)
|
||||
EVT_SIZE (Canvas::OnResize)
|
||||
EVT_LEFT_DOWN (Canvas::OnMouse)
|
||||
EVT_LEFT_UP (Canvas::OnMouse)
|
||||
EVT_RIGHT_DOWN (Canvas::OnMouse)
|
||||
EVT_RIGHT_UP (Canvas::OnMouse)
|
||||
EVT_MIDDLE_DOWN(Canvas::OnMouse)
|
||||
EVT_MIDDLE_UP (Canvas::OnMouse)
|
||||
EVT_MOUSEWHEEL (Canvas::OnMouse)
|
||||
EVT_MOTION (Canvas::OnMouse)
|
||||
EVT_SIZE (Canvas::OnResize)
|
||||
EVT_LEFT_DCLICK (Canvas::OnMouse)
|
||||
EVT_LEFT_DOWN (Canvas::OnMouse)
|
||||
EVT_LEFT_UP (Canvas::OnMouse)
|
||||
EVT_RIGHT_DCLICK (Canvas::OnMouse)
|
||||
EVT_RIGHT_DOWN (Canvas::OnMouse)
|
||||
EVT_RIGHT_UP (Canvas::OnMouse)
|
||||
EVT_MIDDLE_DCLICK (Canvas::OnMouse)
|
||||
EVT_MIDDLE_DOWN (Canvas::OnMouse)
|
||||
EVT_MIDDLE_UP (Canvas::OnMouse)
|
||||
EVT_MOUSEWHEEL (Canvas::OnMouse)
|
||||
EVT_MOTION (Canvas::OnMouse)
|
||||
EVT_MOUSE_CAPTURE_LOST(Canvas::OnMouseCaptureLost)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
@@ -267,7 +267,9 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
if (evt.ButtonDown())
|
||||
// Button down and double click appear to be mutually exclusive events,
|
||||
// meaning a second button down event is not sent before a double click
|
||||
if (evt.ButtonDown() || evt.ButtonDClick())
|
||||
POST_MESSAGE(GuiMouseButtonEvent, (evt.GetButton(), true, evt.GetPosition()));
|
||||
else if (evt.ButtonUp())
|
||||
POST_MESSAGE(GuiMouseButtonEvent, (evt.GetButton(), false, evt.GetPosition()));
|
||||
|
||||
Reference in New Issue
Block a user