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.

Note:

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.

Note:

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.

Note:

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

mouse_leave = 7

The mouse was moved outside the rectangle of the widget.

Note:

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

mouse_hover = 8

The mouse stopped for some time over the widget.

Note:

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

mouse_button_press = 9

A mouse button was pressed over the widget.

Note:

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

mouse_button_release = 10

A mouse button was released over the widget.

Note:

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

mouse_motion = 11

The mouse was moved over the widget.

Note:

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

scroll = 12

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

Note:

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

drag_enter = 13

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

Note:

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

drag_leave = 14

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

Note:

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

drag_over = 15

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

Note:

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

drag_drop = 16

The user dropped a payload into this widget.

Note:

This event can only happen when 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'.

Note:

This event can only happen when 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'.

Note:

This event can only happen when 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'.

Note:

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

resized = 21

The widget was resized with a call to place_widget.

Note:

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

paint = 20

The widget should draw itself.

context_menu_request = 22

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

focus_enter = 23

The widget received focus via mouse or keyboard.

focus_leave = 24

The widget lost focus after receiving it.

...

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