abstract class vaseGui::Widget
sys::Obj vaseGui::Widget : vaseGui::Bindable
Widget is the base class for all UI widgets.
- alpha
-
current alpha as animation target range in [0,1]
- bufferedHeight
-
Int bufferedHeight()
- bufferedPrefSize
-
protected Size bufferedPrefSize(Int parentContentWidth := -1, Int parentContentHeight := -1)
preferred size with margin
- bufferedWidth
-
Int bufferedWidth()
- clicked
-
protected virtual Void clicked()
- clip
-
Bool clip := true
current render effect
- contains
-
relative coordinate
- contentHeight
-
Int contentHeight()
- contentWidth
-
Int contentWidth()
- detach
-
virtual Void detach(Bool doRelayout := true)
Detach from parent
- doPaint
- dpToPixel
- enabled
-
Bool enabled := true
Enabled is used to control whether this widget can accept user input. Disabled controls are "grayed out".
- findAt
- findById
-
virtual Widget? findById(Str id)
Find widget by id in descendant
- fireStateChange
-
protected Void fireStateChange(Obj? oldValue, Obj? newValue, Field? field)
Position and size of this widget relative to its parent. If this a window, this is the position on the screen.
- focus
-
virtual Bool focus(Bool check := true)
Attempt for this widget to take the keyboard focus.
- focusable
-
Bool focusable := false
- focused
-
virtual Bool focused()
Return if this widget is the focused widget which is currently receiving all keyboard input.
- gestureEvent
-
protected virtual Void gestureEvent(GestureEvent e)
process gesture event
- gestureFocusable
-
Bool gestureFocusable := false
- getRoot
-
Widget? getRoot()
- getRootView
-
Frame? getRootView()
Get this widget's parent View or null if not mounted under a View widget.
- getStyle
-
protected Style getStyle()
- height
- id
-
Str id := ""
The unique identifies of widget.
- inlineStyle
-
Style? inlineStyle
- keyEvent
-
protected virtual Void keyEvent(KeyEvent e)
Post key event
- layout
-
Layout layout := Layout.<ctor>()
Layout params
- layoutChildren
-
protected virtual Void layoutChildren(Bool force)
layout the children
- layoutDirty
- mapToRelative
-
Translates absolute coordinates into coordinates in the coordinate space of this component.
- mapToWidget
-
Translates absolute coordinates into relative this widget
- margin
-
Insets margin := Insets.defVal
out side bounder
- motionEvent
-
protected virtual Void motionEvent(MotionEvent e)
process motion event
- mouseEnter
-
protected virtual Void mouseEnter()
Callback when mouse enters this widget's bounds.
- mouseExit
-
protected virtual Void mouseExit()
Callback when mouse exits this widget's bounds.
- onClick
- onClickCallback
-
@Transient
protected Func<Void,Widget>? onClickCallback := null - onFocusChanged
-
EventListeners onFocusChanged()
callback when lost focus or gains focus.
- onLayout
- onLongPress
- onLongPressCallback
-
@Transient
protected Func<Void,Widget>? onLongPressCallback := null - onMounted
-
protected virtual Void onMounted()
Callback this widget mounted.
- onStateChanged
-
virtual override EventListeners onStateChanged()
Callback function when Widget state changed
- padding
-
Insets padding := Insets.defVal
- paddingLeft
-
Int paddingLeft()
- paddingTop
-
Int paddingTop()
- paint
-
Paints this component.
- parent
-
@Transient
WidgetGroup? parent { private set }Get this widget's parent or null if not mounted.
- pixelToDp
- posOnWindow
-
Bool posOnWindow(Coord result)
Get the position of this widget relative to the window. If not on mounted on the screen then return null.
- prefContentSize
-
protected virtual Size prefContentSize(Int hintsWidth := -1, Int hintsHeight := -1)
preferred size of content without padding
- prefSize
-
virtual Size prefSize(Int parentContentWidth := -1, Int parentContentHeight := -1)
preferred size without margin
- relayout
-
virtual Void relayout()
Requset relayout this widget
- renderCacheDirty
-
@Transient
protected Bool renderCacheDirty := trueinvalidate the renderCache bitmap image
- repaint
-
virtual Void repaint(Rect? dirty := null)
Repaints the specified rectangle.
- resetStyle
-
virtual Void resetStyle()
- setLayout
-
Void setLayout(Int x, Int y, Int w, Int h, Bool force)
layout the children
- style
-
Str style := ""
A name for style
- transform
-
@Transient
Transform2D? transformcurrent transform as animation target
- useRenderCache
-
protected Bool useRenderCache := false
flag for using renderCache
- visible
-
Bool visible := true
Controls whether this widget is visible or hidden.
- width
- x
- y