enum: ashet.WidgetEvent.Type
Items
create = 0The widget was created and attached to a window.
destroy = 1The widget is in the process of being destroyed. After this event, the handle will be invalid.
control = 2The creator of the widget wants to do something widget-specific.
click = 3The 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_downandmouse_button_upwith 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_pressandkey_releasehappen without changing the focused widget, and only when the focus giving key (space, return, ...) was pressed without any other key interrupting.key_press = 4A key was pressed on the keyboard.
key_release = 5A key was released on the keyboard.
mouse_enter = 6The mouse was moved inside the rectangle of the widget.
This event can only happen when
WidgetDescriptor.Flags.hit_test_visiblewas set in the widget creation flags.mouse_leave = 7The mouse was moved outside the rectangle of the widget.
This event can only happen when
WidgetDescriptor.Flags.hit_test_visiblewas set in the widget creation flags.mouse_hover = 8The mouse stopped for some time over the widget.
This event can only happen when
WidgetDescriptor.Flags.hit_test_visiblewas set in the widget creation flags.mouse_motion = 11The mouse was moved over the widget.
This event can only happen when
WidgetDescriptor.Flags.hit_test_visiblewas set in the widget creation flags.scroll = 12A vertical or horizontal scroll wheel was scrolled over the widget.
This event can only happen when
WidgetDescriptor.Flags.hit_test_visiblewas set in the widget creation flags.drag_enter = 13The user dragged a payload into the rectangle of this widget.
This event can only happen when
WidgetDescriptor.Flags.allow_dropwas set in the widget creation flags.drag_leave = 14The user dragged a payload out of the rectangle of this widget.
This event can only happen when
WidgetDescriptor.Flags.allow_dropwas set in the widget type creation flags.drag_over = 15The user dragged a payload over the rectangle of this widget.
This event can only happen when
WidgetDescriptor.Flags.allow_dropwas set in the widget type creation flags.drag_drop = 16The user dropped a payload into this widget.
This event can only happen when
WidgetDescriptor.Flags.allow_dropwas set in the widget type creation flags.clipboard_copy = 17The user requested a clipboard copy operation, usually by pressing 'Ctrl-C'.
This event can only happen when
WidgetDescriptor.Flags.clipboard_sensitivewas set in the widget type creation flags.clipboard_paste = 18The user requested a clipboard paste operation, usually by pressing 'Ctrl-V'.
This event can only happen when
WidgetDescriptor.Flags.clipboard_sensitivewas set in the widget type creation flags.clipboard_cut = 19The user requested a clipboard cut operation, usually by pressing 'Ctrl-X'.
This event can only happen when
WidgetDescriptor.Flags.clipboard_sensitivewas set in the widget type creation flags.resize_requested = 20The 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_boundswill 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 = 21The widget was resized with a call to
place_widget.This event will not fire if the widget was only moved.
paint = 22The widget should draw itself.
focus_enter = 24The widget received focus via mouse or keyboard.
focus_leave = 25The widget lost focus after receiving it.
...This enumeration is non-exhaustive and may assume all values a u16 can represent.