New properties are added to EventData for Supervisor events:
* Widget: a reference to the widget which is receiving the event.
* Clicked (bool): for MouseMove events records if the primary button is pressed.
* func RelativePoint(): returns a version of EventData.Point adjusted to be
relative to the Widget (0,0 at the Widget's absolute position on screen).
Other changes:
* Destroy() method for the Widget interface: widgets that need to free up resources
on teardown should define this, the BaseWidget provides a no-op implementation.
* Window.Resize() will properly resize a Window.
* Window.Center(w, h int) to easily center a window on screen.
* Added the TabFrame widget with an example program and screenshot
* Button: FixedColor=true to set a consistent background color and not
worry about it with mouseover/down events.
* New and completed widgets: Menu, MenuButton and MenuBar.
* MenuButton is a kind of Button that opens a popup Menu when clicked.
* MenuBar is a container of buttons designed to be attached to the top
of an application window ("File, Edit, View, Help")
* Supervisor manages the popup menus with its new concept of a Modal
Widget. Modal widgets take exclusive event priority for all mouse and
key events. The pop-up menu is a modal window, which means you must
click an option inside the menu OR clicking outside the menu will
close it and eat your click event (widgets outside the modal don't
receive events, but the modal itself gets an event that you've done
this).
* Fix Supervisor event issues wrt. the window manager feature: if a
focused window exists and Supervisor is running events for the "other"
widgets not in managed windows, and the mouse cursor is over the
rectangle of THE focused window, no widget under the cursor receives
active (hover, click) events. Prevents being able to click "through"
the window and interact with widgets and other windows below.
* Adds Close, Maximize and Minimize buttons to windows. Maximize is
still buggy and Minimize is implementation-defined behavior with no
default event handler configured.
* eg/windows has an example of the Window Manager for SDL2 and
WebAssembly targets.
* Adds Window Manager support to the Supervisor, so that Window widgets
can be dragged by their title bar, clicked to focus, etc.
* Create a ui.Window as normal, but instead of Packing or Placing it
into a parent container as before, you call .Supervise() and give it
your Supervisor. The window registers itself to be managed and drawn
by the Supervisor itself.
* Supervisor manages the focused window order using a doubly linked
list. When a window takes focus it moves to the top of the list.
Widgets in the active window take event priority.
* Extended DragDrop API to support holding a widget pointer in the drag
operation.
* Changed widget event Handle functions to return an error: so that they
could return ErrStopPropagation to prevent events going to more
widgets once handled (for important events).
Some bugs remain around overlapping windows and event propagation.
* Tooltip can be added to any target widget (e.g. Button) and pop up on
mouse over.
* Refactor the event system. Instead of passing a render.Point to all
event handlers, pass an EventData struct which can hold the Point or
the render.Engine.
* Add event types Computed and Present, so a widget can set a handler on
whenever its Computed or Present method is called.
* MainWindow is ideal for apps that just want a UI and
don't manage their own SDL windows.
* The example app will grow into a series of demos that
test the UI toolkit to help fix bugs and grow features.