class UIComponent
package smidr
extends Sprite
extended by UIAccordion, UIBadge, UIBalloon, UIBreadcrumb, UIButton, UICheckbox, UIChip, UIColorPicker, UIDataGrid, UIDateTimePicker, UIDockGroup, UIDockHost, UIDockPanel, UIDrawer, UIDropdown, UIExpander, UIIcon, UIIconRail, UIKeybind, UILabel, UIList, UIListRow, UIMenuBar, UIModal, UIPanel, UIPieMenu, UIProgressBar, UIRadioGroup, UIRating, UIScrollPane, UISegmentedControl, UISeparator, UISlider, UISpinner, UISplitter, UIStack, UIStatusBar, UIStepper, UISwitch, UITabs, UITextArea, UITextInput, UITile, UITileGrid, UIToolbar, UITreeView, UIWindow
Base class for every widget: a retained openfl.display.Sprite that repaints ONLY when
invalidated (no per-frame update). Subclasses override render() and read UITheme /
UILocale there, so theme and locale swaps re-skin the whole tree via UIRoot.invalidateAll.
Pointer correctness is built in: pressed is only set by a press that starts on this widget,
and click() fires only when the matching release also lands on it (see UIPointer). Drags
use beginCapture() to receive exclusive onDragMove/onDragEnd callbacks.
Construction flavors:
interactive = true— hover/press/click handling (leaf widgets)interactive = false, blocking = true— a passive surface that still swallows pointer hits (panels, backdrops); children stay interactiveinteractive = false, blocking = false— pure layout group, pointer-transparent
Constructor
Variables
hoverCursor:MouseCursor = MouseCursor.BUTTON
Native cursor while hovering (interactive widgets; null keeps the arrow).
longPressable:Bool = false
Opts a subclass that overrides onRightPress (without setting onRightClick) into
long-press-as-right-click on touch. Widgets with onRightClick set are included
automatically.
read onlyw:Float = 0
Layout width in UI units (independent of DisplayObject's content-derived width).
onClick:() ‑> Void = null
Fired on a completed click (press + release on this widget). Requires an interactive widget.
onHover:() ‑> Void = null
Fired when the cursor first enters this widget (hover-driven descriptions/previews). Interactive widgets only.
onRightClick:() ‑> Void = null
Fired on a right mouse press over this widget (context menus). Only interactive widgets
receive pointer events, so this never fires on passive widgets like UILabel/UIPanel —
attach it to a UIButton (or another interactive widget) instead. On touch, a long-press
fires the same path (see UIRoot.longPressMs).
Methods
resize(width:Float, height:Float):Void
Sets the layout size and repaints when it changed.
Parameters:
width | the new layout width in UI units |
|---|---|
height | the new layout height in UI units |