Commit Graph

13 Commits (b87b4825af184dea29e121472a107c4de931fdcc)

Author SHA1 Message Date
Noah 6df7bade48 Add SelectBox Widget 2021-06-06 13:44:05 -07:00
Noah Petherbridge ff76b831ad Update example apps and documentation 2021-06-03 12:27:48 -07:00
Noah e675ead0ed WIP Themes Support 2020-06-17 18:04:18 -07:00
Noah 07cefb6499 Menus and Menu Bars
* 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).
2020-06-04 00:50:23 -07:00
Noah 36db160533 Window Manager Buttons and Bugfixes
* 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.
2020-04-08 17:29:04 -07:00
Noah 7d9ba79cd2 Window Manager Basics, Work in Progress
* 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.
2020-04-06 22:57:28 -07:00
Noah 911585ea4d Update README 2020-03-09 17:32:28 -07:00
Noah f9b305679a Tooltip Widget and Event Refactor
* 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.
2020-03-09 17:13:33 -07:00
Noah 0846fe22fc Place Strategy for Frame Widget 2020-03-08 22:07:46 -07:00
Noah 9d6b172878 Rename Anchor to Side in Frame.Pack() config 2019-12-28 21:47:46 -08:00
Noah 2f5b498ca1 Add README, LICENSE and Examples 2019-12-27 16:06:24 -08:00
Noah e391e703bf Cut lib/render into its own package, change all imports 2019-12-22 18:21:58 -08:00
Noah aceb7e7a7e UI: Add MainWindow Widget and start an example app
* 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.
2019-06-08 17:03:59 -07:00