Ashet OS

enum: ashet.WidgetEvent.Type

Items

create = 0

The widget was created and attached to a window.

destroy = 1

The widget is in the process of being destroyed. After this event, the handle will be invalid.

control = 2

The creator of the widget wants to do something widget-specific.

click = 3

The user clicked on the widget with the primary mouse button or pressed the return or space bar button on the keyboard.

A click with the mouse is valid when, and only when: mouse_button_down and mouse_button_up with the left mouse button happen on the same widget. The hovered widget may change in between the mouse down and mouse up, but the click will still be recognized.

A click with the keyboard is valid when, and only when: key_press and key_release happen without changing the focused widget, and only when the focus giving key (space, return, ...) was pressed without any other key interrupting.

key_press = 4

A key was pressed on the keyboard.

key_release = 5

A key was released on the keyboard.

mouse_enter = 6

The mouse was moved inside the rectangle of the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

mouse_leave = 7

The mouse was moved outside the rectangle of the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

mouse_hover = 8

The mouse stopped for some time over the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

mouse_button_press = 9

A mouse button was pressed over the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

mouse_button_release = 10

A mouse button was released over the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

mouse_motion = 11

The mouse was moved over the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

scroll = 12

A vertical or horizontal scroll wheel was scrolled over the widget.

This event can only happen when WidgetDescriptor.Flags.hit_test_visible was set in the widget creation flags.

drag_enter = 13

The user dragged a payload into the rectangle of this widget.

This event can only happen when WidgetDescriptor.Flags.allow_drop was set in the widget creation flags.

drag_leave = 14

The user dragged a payload out of the rectangle of this widget.

This event can only happen when WidgetDescriptor.Flags.allow_drop was set in the widget type creation flags.

drag_over = 15

The user dragged a payload over the rectangle of this widget.

This event can only happen when WidgetDescriptor.Flags.allow_drop was set in the widget type creation flags.

drag_drop = 16

The user dropped a payload into this widget.

This event can only happen when WidgetDescriptor.Flags.allow_drop was set in the widget type creation flags.

clipboard_copy = 17

The user requested a clipboard copy operation, usually by pressing 'Ctrl-C'.

This event can only happen when WidgetDescriptor.Flags.clipboard_sensitive was set in the widget type creation flags.

clipboard_paste = 18

The user requested a clipboard paste operation, usually by pressing 'Ctrl-V'.

This event can only happen when WidgetDescriptor.Flags.clipboard_sensitive was set in the widget type creation flags.

clipboard_cut = 19

The user requested a clipboard cut operation, usually by pressing 'Ctrl-X'.

This event can only happen when WidgetDescriptor.Flags.clipboard_sensitive was set in the widget type creation flags.

resize_requested = 20

The widget is about to be resized, and shall now restrict the provided size into the widget constraints.

This event will fire before resizing a widget, and get_widget_bounds will still remove the old value.

This means the widget framebuffer also retains the old size, and will only be resized after this event was handled.

resized = 21

The widget was resized with a call to place_widget.

This event will not fire if the widget was only moved.

paint = 22

The widget should draw itself.

context_menu_request = 23

User pressed the "context menu" button or did a secondary mouse button click on the widget.

focus_enter = 24

The widget received focus via mouse or keyboard.

focus_leave = 25

The widget lost focus after receiving it.

...

This enumeration is non-exhaustive and may assume all values a u16 can represent.