gui2.event

Base class for all events.

class Event;

Base class for all events.

Propagated recursively through the widget tree. Widgets can register handler functions to react to events (e.g. rendering, user input, layout resizing, etc.).

enum Status;

Specifies whether the event is moving down (sinking) or up (bubbling) the widget tree.

Sinking

The event is sinking into subwidgets.

Bubbling

The event is bubbling back to parent widgets.

@property Widget sunkFrom();

Return the parent widget the event sunk from when sinking.

const pure nothrow @property Status status();

Is the widget sinking or bubbling?

class MinimizeEvent: gui2.event.Event;

Used when widgets need to be resized. Passed before ExpandEvent.

An example is when a RootWidget is connected to a SlotWidget - all widgets in the RootWidget's subtree need to be resized.

class ExpandEvent: gui2.event.Event;

Used when widgets need to be resized. Passed after MinimizeEvent.

Handled when sinking, passing the parent widget for the children to expand into.

SeeAlso:
MinimizeEvent

class RenderEvent: gui2.event.Event;

Used to draw the widgets.

VideoDriver videoDriver;

VideoDriver to draw with.

class MouseKeyEvent: gui2.event.Event;

Low level mouse key event. Usually not handled by widgets directly.

KeyState state;

Key state (pressed, released).

MouseKey key;

Mouse key affected.

Vector2u position;

Mouse position during the press/release.

class MouseMoveEvent: gui2.event.Event;

Mouse movement event.

Vector2u position;

Mouse position after the movement.

Vector2i relative;

Relative movement of the mouse.

class KeyboardEvent: gui2.event.Event;

Low level keyboard key event. Usually not handled by widgets directly.

KeyState state;

Key state (pressed, released).

Key key;

Key affected.

dchar unicode;

Unicode value of the key.