Implementations for the ReflectableProperties interface/
Events should generally follow the propagation model, but there's some exceptions to that rule. If so, they should override this to return false. In that case, only bubbling event handlers on the target itself and capturing event handlers on the containing window will be called. (That is, dispatch will call sendDirectly instead of doing the normal capture -> target -> bubble process.)
hints as to whether preventDefault will actually do anything. not entirely reliable.
You can mix this into child class to register some boilerplate. It includes the EventString member, a constructor, and implementations of the dynamic get data interfaces.
This is the widget that emitted the event.
Note: likely to be deprecated at some point.
Prevents the default event handler (if there is one) from being called
Stops the event propagation immediately.
This is an internal implementation detail you should not use. It would be private if the language allowed it and it may be removed without notice.
this sends it only to the target. If you want propagation, use dispatch() instead.
this dispatches the element using the capture -> target -> bubble process
MouseDownEvent is sent when the user presses a mouse button. It is also sent on mouse wheel movement.
MouseUpEvent is sent when the user releases a mouse button.
MouseMoveEvent is sent when the mouse is moved. Please note you may not receive this in some cases unless a button is also pressed; the system is free to withhold them as an optimization. (In practice, arsd.simpledisplay does not request mouse motion event without a held button if it is on a remote X11 link, but does elsewhere at this time.)
ClickEvent is sent when the user clicks on the widget. It may also be sent with keyboard control, though minigui prefers to send a "triggered" event in addition to a mouse click and instead of a simulated mouse click in cases like keyboard activation of a button.
DoubleClickEvent is sent when the user clicks twice on a thing quickly, immediately after the second MouseDownEvent. The sequence is: MouseDownEvent, MouseUpEvent, ClickEvent, MouseDownEvent, DoubleClickEvent, MouseUpEvent. The second ClickEvent is NOT sent. Note that this is differnet than Javascript! They would send down,up,click,down,up,click,dblclick. Minigui does it differently because this is the way the Windows OS reports it.
MouseOverEvent is sent then the mouse first goes over a widget. Please note that this participates in event propagation of children! Use MouseEnterEvent instead if you are only interested in a specific element's whole bounding box instead of the top-most element in any particular location.
MouseOutEvent is sent when the mouse exits a target. Please note that this participates in event propagation of children! Use MouseLeaveEvent instead if you are only interested in a specific element's whole bounding box instead of the top-most element in any particular location.
MouseEnterEvent is sent when the mouse enters the bounding box of a widget.
MouseLeaveEvent is sent when the mouse leaves the bounding box of a widget.
You can construct these yourself, but generally the system will send them to you and there's little need to emit your own.
Rationale:
If you only want to do drag, mousedown/up works just fine being consistently sent.
If you want click, that event does what you expect (if the user mouse downs then moves the mouse off the widget before going up, no click event happens - a click is only down and back up on the same thing).
If you want double click and listen to that specifically, it also just works, and if you only cared about clicks, odds are the double click should do the same thing as a single click anyway - the double was prolly accidental - so only sending the event once is prolly what user intended.
Added May 2, 2021. Previously, it was only seen as the base Event class on event listeners. See the member EventString to see what the associated string is with these elements.
Indicates that the user has worked with the mouse over your widget. For available properties, see MouseEventBase.