abstract class fwt::Widget

sys::Obj
  fwt::Widget

@Js

Source

Widget is the base class for all UI widgets.

See pod doc for details.

add

@Operator
virtual This add(Widget? child)

Source

Add a child widget. If child is null, then do nothing. If child is already parented throw ArgErr. Return this.

addAll

virtual This addAll(Widget?[] children)

Source

Add all widgets in list by calling add on each widget. Return this.

bounds

Rect bounds

Source

Position and size of this widget relative to its parent. If this a window, this is the position on the screen.

children

Widget[] children()

Source

Get the children widgets.

cursor

Cursor? cursor

Source

Mouse cursor to use when the mouse passes over the control. If not specified cursor of the parent control will appear.

each

Void each(|Widget,Int| f)

Source

Iterate the children widgets.

enabled

Bool enabled

Source

Enabled is used to control whether this widget can accept user input. Disabled controls are "grayed out".

focus

Void focus()

Source

Attempt for this widget to take the keyboard focus.

hasFocus

Bool hasFocus()

Source

Return if this widget is the focused widget which is currently receiving all keyboard input.

layout

Obj? layout := null

Source

Meta-data that can be used by Pane for layout.

onBlur

EventListeners onBlur()

Source

Callback for focus lost event on this widget.

Event id fired:

Event fields:

  • none
onFocus

EventListeners onFocus()

Source

Callback for focus gained event on this widget.

Event id fired:

Event fields:

  • none
onKeyDown

EventListeners onKeyDown()

Source

Callback for key pressed event on this widget. To cease propagation and processing of the event, then consume it.

Event id fired:

Event fields:

onKeyUp

EventListeners onKeyUp()

Source

Callback for key released events on this widget. To cease propagation and processing of the event, then consume it.

Event id fired:

Event fields:

onMouseDown

EventListeners onMouseDown()

Source

Callback for mouse button pressed event on this widget.

Event id fired:

Event fields:

onMouseEnter

EventListeners onMouseEnter()

Source

Callback when mouse enters this widget's bounds.

Event id fired:

Event fields:

onMouseExit

EventListeners onMouseExit()

Source

Callback when mouse exits this widget's bounds.

Event id fired:

Event fields:

onMouseHover

EventListeners onMouseHover()

Source

Callback when mouse hovers for a moment over this widget.

Event id fired:

Event fields:

onMouseMove

EventListeners onMouseMove()

Source

Callback when mouse moves over this widget.

Event id fired:

Event fields:

onMouseUp

EventListeners onMouseUp()

Source

Callback for mouse button released event on this widget.

Event id fired:

Event fields:

onMouseWheel

EventListeners onMouseWheel()

Source

Callback when mouse wheel is scrolled and this widget has focus.

Event id fired:

Event fields:

pack

This pack()

Source

Set this widget's size to its preferred size. Return this.

parent

@Transient
Widget? parent { private set }

Source

Get this widget's parent or null if not mounted.

pos

@Transient
Point pos

Source

Position of this widget relative to its parent. If this a window, this is the position on the screen.

posOnDisplay

Point? posOnDisplay()

Source

Get the position of this widget on the screen coordinate's system. If not on mounted on the screen then return null.

posOnWindow

Point? posOnWindow()

Source

Get the position of this widget relative to the window. If not on mounted on the screen then return null.

prefSize

virtual Size prefSize(Hints hints := Hints.defVal)

Source

Compute the preferred size of this widget. The hints indicate constraints the widget should consider in its calculations. If no constraints are known for width, then hints.w will be null. If no constraints are known for height, then hints.h will be null.

relayout

This relayout()

Source

Relayout this widget. This method is called when something has changed and we need to recompute the layout of this widget's children. Return this.

remove

virtual This remove(Widget? child)

Source

Remove a child widget. If child is null, then do nothing. If this widget is not the child's current parent throw ArgErr. Return this.

removeAll

virtual This removeAll()

Source

Remove all child widgets. Return this.

repaint

Void repaint(Rect? dirty := null)

Source

Repaint this widget. If the dirty rectangle is null, then the whole widget is repainted.

size

@Transient
Size size

Source

Size of this widget.

visible

Bool visible

Source

Controls whether this widget is visible or hidden.

window

Window? window()

Source

Get this widget's parent window or null if not mounted under a Window widget.