gui2.widget

Base class for all widgets.

abstract class Widget;

Base class for all widgets.

this(ref Node yaml);

Construct a Widget. Contains setup code shared between widget types.

Note:
a constructed Widget is only fully initialized after a call to init().

Parameters:
Node yaml YAML definition of the widget.
Throws:
WidgetInitException on failure.
void addEventHandler(T)(Flag!("DoneSinking") delegate(T) handler);

Register an event handler delegate.

protected final void addChild(Widget child);

Add a child widget. Does not_ update GUI layout. Caller needs to handle that.

protected final void removeChild(Widget child);

Remove a child widget. Does not_ update GUI layout. Caller needs to handle that.

The given widget must be a child of this widget.

protected void render(VideoDriver video);

Render the widget with specified video driver.

protected void postInit();

Called when the widget is fully initialized (at the end of the init() call).

protected void gotFocus();

Called when the widget gets focus.

protected void lostFocus();

Called when the widget loses focus.

protected void clicked(const Vector2u position, const MouseKey key);

Called when the widget is focused and has been clicked.

Parameters:
Vector2u position Mouse position in screen coordinates.
MouseKey key Mouse key clicked.
protected void keyPressed(const Key key, const dchar unicode);

Called when the widget is focused and a keyboard key has been pressed.

package void mouseEntered();

Called when the mouse enters the widget's bounds.

Package for RootWidget access.

package void mouseLeft();

Called when the mouse leaves the widget's bounds.

Package for RootWidget access.