AWidget
- Module
- Arc
- Header
#include "Arc/Framework/AWidget.h"- Namespace
Arcf
Constructors
| Signature | Name | Description |
|---|---|---|
AWidget() = default | AWidget | |
virtual ~AWidget() = default | ~AWidget | |
AWidget(const AWidget&) = delete | AWidget |
Public functions
| Returns | Name | Description |
|---|---|---|
AWidget& | operator= | |
ArcVec2 | ComputeDesiredSize | |
void | CacheDesiredSize | Recomputes the desired size only when something can have changed: this widget or a descendant was invalidated, the layout scale moved, or a global invalidation epoch fired. |
bool | CanCacheDesiredSize | Opt-in for the desired-size cache. |
bool | DesiredSizeDependsOnChildren | False when ComputeDesiredSize never reads a child size — a scroll box, a list, a tree, a viewport: their measure is a constant and the widgets under them are measured by their own arrange body instead. |
uint32_t | GetLayoutRevision | Bumped every time this widget's own inputs are invalidated. |
uint32_t | GetLayoutEpoch | The global invalidation epoch. |
uint64_t | GetMeasureCount | How many ComputeDesiredSize calls CacheDesiredSize has let through. |
void | ResetMeasureCount | |
ArcVec2 | GetDesiredSize | |
void | ArrangeChildren | |
bool | CanSkipArrange | Opt-in for the arrange skip. |
uint64_t | GetArrangeCount | How many arrange bodies ran, and how many were skipped. |
uint64_t | GetArrangeSkipCount | |
void | ResetArrangeCounts | |
void | SetArrangeSkipEnabled | Kill switch for the arrange skip, so a suspected stale-layout bug can be confirmed or cleared in one process instead of across two builds. |
bool | IsArrangeSkipEnabled | |
int32_t | OnPaint | |
bool | CanRetainPaint | Opt-in for the retained-paint cache. |
void | InvalidatePaint | Drops this widget's retained paint and every ancestor slice that contains it, without touching layout. |
void | InvalidateAllPaint | Drops every retained slice in the process without walking any tree. |
uint32_t | GetPaintEpoch | |
uint64_t | GetInvalidationSerial | Ticks on every invalidation of any kind anywhere — a layout or paint walk, a slice dropped, a global drop. |
uint64_t | GetInPaintInvalidationSerial | |
void | SetPaintPassActive | |
void | SetInvalidationCensus | Counts, by widget type, the invalidations raised outside a paint pass while on: the answer to "what keeps this window from skipping". |
void | TakeInvalidationCensus | |
void | NoteLivePaint | A paint that changes with the clock rather than with any write — a blinking caret, a scroll bar waiting out its hide delay — calls this, so the window it paints in keeps painting while it lasts. |
uint64_t | GetLivePaintCount | |
void | NoteRepaintIn | For a paint that changes with the clock but only at a known moment — a caret's next blink, the end of a scroll bar's hide delay — instead of NoteLivePaint: the window may skip its paints until then, rather than painting every frame of the wait. |
void | ResetRepaintDeadline | |
double | TakeRepaintDeadline | The earliest NoteRepaintIn of the paint since the reset, on the SteadyNowSeconds clock; negative when none asked. |
double | SteadyNowSeconds | |
void | BeginObservedCollect | The observed widgets a window's paint marked on screen, gathered so a frame that skips that paint can keep them on the poll list: otherwise every bound value in the window stops being polled the first frame nothing repaints it, and nothing would wake it again. |
void | EndObservedCollect | |
void | KeepObservedOnScreen | |
uint64_t | GetPaintCount | How many OnPaint bodies ran, and how many were answered from a retained slice instead. |
uint64_t | GetPaintReplayCount | |
void | ResetPaintCounts | |
void | SetRetainedPaintEnabled | Kill switch, so a suspected stale-pixel bug can be confirmed or cleared in one process instead of across two builds. |
bool | IsRetainedPaintEnabled | |
void | CensusRetainedPaint | |
bool | PollAttributes | Re-evaluates every bound attribute this widget paints or measures from and invalidates on the ones that moved. |
bool | AreBoundAttributesObserved | True once this widget is on the poll list. |
uint32_t | PollObservedAttributes | Runs PollAttributes on every observed widget that was on screen last frame and drops the rest off the list. |
uint32_t | GetObservedWidgetCount | |
void | StopObservingTree | Takes root and everything under it out of the next poll, as if it had not painted last frame. |
bool | IsAttributePollDue | Whether the next PollObservedAttributes would run this widget's getters. |
void | ObserveAttributes | Puts this widget on the poll list. |
void | NoteObservedPaint | An observed widget's OnPaint calls this before anything else: it marks the widget on screen for the next poll and, when a slice is being recorded around it, writes it into that slice so the replay can keep marking it. |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonDoubleClick | Fired instead of a second OnMouseButtonDown when the same button lands twice within the double-click window on the same widget (U1). |
bool | OnContextMenu | Context-menu contract (U1): the first widget up the hit path that fills the builder wins; the input processor opens the framework menu at the cursor. |
CReply | OnMouseButtonUp | |
CReply | OnMouseMove | |
CReply | OnMouseWheel | |
CReply | OnKeyDown | Key events start at the focused widget and, while unhandled, are offered to each ancestor in turn until one returns Handled — the same leaf-to-root walk pointer events already take. |
CReply | OnKeyUp | |
CReply | OnKeyChar | |
CReply | OnTextComposition | |
void | OnMouseEnter | |
void | OnMouseLeave | |
bool | OnDragEnter | Drop-target contract. |
bool | OnDragOver | |
void | OnDragLeave | |
bool | OnDrop | |
bool | WantsTextInput | A widget that edits text says so here (and whether it hides it), so a host can raise a platform on-screen keyboard over it. |
void | OnFocusReceived | |
void | OnFocusLost | |
void | OnMouseCaptureLost | |
EArcCursorType | OnCursorQuery | |
EHitTestResult | OnHitTest | |
bool | ClaimsPointerExclusively | |
int32_t | GetNumChildren | |
TSharedPtr<AWidget> | GetChildAt | |
void | SetCachedGeometry | |
const CGeometry& | GetCachedGeometry | |
void | SetVisibility | |
EVisibility | GetVisibility | |
bool | IsVisible | |
void | SetEnabled | Enabled, hovered and focused are painted, not measured: they must drop the paint cache without throwing away a measure and an arrange that are still correct. |
bool | IsEnabled | |
bool | IsHovered | |
void | SetHovered | |
bool | HasKeyboardFocus | |
bool | IsFocusVisible | Focus that arrived from the keyboard (Tab, arrows) rather than a click — the :focus-visible rule. |
void | SetPreviewState | Pins a pointer or keyboard state for display. |
EArcPreviewState | GetPreviewState | |
bool | IsPreviewPressed | |
void | SetCursor | Also applies to system cursor |
EArcCursorType | GetCursor | |
void | SetTag | |
const CName& | GetTag | |
void | SetToolTipText | |
void | SetToolTip | Rich tooltip (U1): an arbitrary widget hosted in the tooltip popup window instead of plain text lines — icons, keycap chips, asset thumbnails. |
const TSharedPtr<AWidget>& | GetToolTip | |
const CText& | GetToolTipText | |
void | SetAccessibleLabel | |
const CText& | GetAccessibleLabel | |
EAccessibleRole | GetAccessibleRole | What a screen reader calls this control. |
std::string | GetAccessibleValue | |
std::string | GetAccessibleName | The accessible label when one was set; otherwise the first text found under the widget (an icon glyph is not text); otherwise the tooltip — which is what names an icon-only toolbar button. |
void | SetParentWidget | Parent tracking (weak reference to avoid cycles) |
TSharedPtr<AWidget> | GetParentWidget | |
void | SetRenderTransform | A transform on how this widget paints and is hit, not on its layout, applied about the pivot (a fraction of its size, the centre by default). |
const CArcRenderTransform& | GetRenderTransform | |
void | SetRenderTransformPivot | |
const ArcVec2& | GetRenderTransformPivot | |
bool | HasRenderTransform | |
ArcMat3 | ComputeRenderTransform | The render transform in absolute space for the given layout geometry: about the pivot point of its rect. |
void | ArrangeChildWidget | Arranges a child into childGeometry with the child's own render transform folded into the geometry it caches, so the transform reaches its hit test and every geometry built below it. |
int32_t | PaintChildWidget | Paints a child from its cached geometry under its render transform. |
void | SetRenderOpacity | The opacity multiplies into every vertex colour the widget emits, so a slice recorded at one value paints the wrong alpha at another. |
float | GetRenderOpacity | |
const char* | GetTypeName | |
bool | IsTextInput | True for widgets that consume plain keystrokes as text while focused (editable text boxes and their kin). |
bool | ConsumesTab | True only for a widget that types Tab as a character (the multi-line box). |
EFocusVisual | GetFocusVisual | How this widget's keyboard focus is drawn by CArcFocusRing. |
bool | PaintsOwnFocus | True for a widget whose own paint shows keyboard focus where the framework's ring would be wrong (the ring round a slider's thumb, a tree's or list's keyboard row): it answers None above and still shows focus, which the keyboard audit has to know. |
bool | OwnsKeyboard | True while a self-drawn overlay (a command palette) holds the keyboard the way a modal does: Tab is its own key there, so the keyboard audit closes it with Escape before tabbing the window. |
float | GetFocusRadius | The corner radius of the control's own outline. |
bool | AllowsKeyBubbling | Whether a key this widget declined may be offered to its ancestors. |
bool | IsFocusable | Focusability predicate for directional (gamepad/keyboard) navigation — the FNavigationConfig seam. |
bool | OnActivate | A gamepad/keyboard accept aimed at this widget. |
void | Invalidate | Marks this widget's desired size dirty, then walks up the parent chain flagging ancestors. |
bool | NeedsLayout | |
void | ClearLayoutFlag | |
bool | NeedsSubtreeLayout | True when this widget or anything below it needs a fresh measure. |
void | InvalidateAllWidgets | Drops every cached desired size in the process, without walking any tree. |
void | SetFocusScopeId | The focus scope this widget roots, None on everything else. |
const CName& | GetFocusScopeId | |
bool | IsFocusScopeRoot |
Function details
AWidget
AWidget() = default~AWidget
virtual ~AWidget() = defaultAWidget
AWidget(const AWidget&) = deleteoperator=
AWidget& operator=(const AWidget&) = deleteComputeDesiredSize
virtual ArcVec2 ComputeDesiredSize(float layoutScaleMultiplier) const = 0CacheDesiredSize
void CacheDesiredSize(float layoutScaleMultiplier)Recomputes the desired size only when something can have changed: this widget or a descendant was invalidated, the layout scale moved, or a global invalidation epoch fired. Also repairs the parent links of every enumerable child so Invalidate() has a chain to walk.
CanCacheDesiredSize
virtual bool CanCacheDesiredSize() constOpt-in for the desired-size cache. A widget may only return true when every input to its ComputeDesiredSize is either constant or routed through Invalidate(): bound attributes, measure-reads-arrange feedback, children generated during arrange, and children that are not reported by GetChildAt all disqualify it. Default is false, so a widget nobody audited keeps the previous always-recompute behaviour.
DesiredSizeDependsOnChildren
virtual bool DesiredSizeDependsOnChildren() constFalse when ComputeDesiredSize never reads a child size — a scroll box, a list, a tree, a viewport: their measure is a constant and the widgets under them are measured by their own arrange body instead. The measure pass then stops here, where before it walked the whole panel below to hash sizes that could not move this widget.
GetLayoutRevision
uint32_t GetLayoutRevision() constBumped every time this widget's own inputs are invalidated. Anything that memoizes a per-widget derived result (a text block's shaped layout) keys on it instead of re-deriving the key from the inputs.
GetLayoutEpoch
static uint32_t GetLayoutEpoch()The global invalidation epoch. A memo built from process-wide state (the active style set, the font manager) is only valid while this still matches, because InvalidateAllWidgets is what a style or font swap announces itself with.
GetMeasureCount
static uint64_t GetMeasureCount()How many ComputeDesiredSize calls CacheDesiredSize has let through. The layout tests assert that a second pass over an unchanged tree computes nothing at all; without a counter the only available evidence would be a wall-clock delta, which proves nothing on a loaded machine.
ResetMeasureCount
static void ResetMeasureCount()GetDesiredSize
ArcVec2 GetDesiredSize() constArrangeChildren
virtual void ArrangeChildren(const CGeometry& allottedGeometry)CanSkipArrange
virtual bool CanSkipArrange() constOpt-in for the arrange skip. A widget may only return true when ArrangeChildren is a pure function of the allotted geometry, its own attributes and its children's cached desired sizes — and every input that can move announces itself through Invalidate(). A body that clamps a scroll offset, recycles rows, re-elides text against the width it just handed out, or reads a clock disqualifies the widget: skipping it would freeze the very thing the body exists to update. The default answer is "yes" for a widget that reports no children, because the base ArrangeChildren is empty and there is nothing to freeze. Every widget that OVERRIDES ArrangeChildren therefore has to state its own answer; one that stays silent reports children and is refused by this default.
GetArrangeCount
static uint64_t GetArrangeCount()How many arrange bodies ran, and how many were skipped. The layout tests pin that a second pass over an unchanged tree arranges nothing; a wall-clock delta would prove nothing on a loaded machine.
GetArrangeSkipCount
static uint64_t GetArrangeSkipCount()ResetArrangeCounts
static void ResetArrangeCounts()SetArrangeSkipEnabled
static void SetArrangeSkipEnabled(bool enabled)Kill switch for the arrange skip, so a suspected stale-layout bug can be confirmed or cleared in one process instead of across two builds.
IsArrangeSkipEnabled
static bool IsArrangeSkipEnabled()OnPaint
virtual int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& allottedGeometry, CArcUIRenderer& renderer, int32_t layerId) const = 0CanRetainPaint
virtual bool CanRetainPaint() constOpt-in for the retained-paint cache. A widget may only return true when its OnPaint output is a pure function of the arranged geometry, its own attributes and its children — and every input that can move announces itself through InvalidatePaint() (or Invalidate(), which implies it). A bound attribute the body paints from, a running animation, a blinking caret, a selection highlight, rows a view recycles per frame, or a surface re-rendered every frame all disqualify it: replaying would freeze exactly what the body exists to update. The default is false, so a widget nobody audited keeps painting.
InvalidatePaint
void InvalidatePaint()Drops this widget's retained paint and every ancestor slice that contains it, without touching layout. This is the lighter sibling of Invalidate(): hover, press, focus, a swatch colour — anything that changes only what is drawn — belongs here, because invalidating the layout for it would throw away a measure and an arrange that are still correct. The walk runs to the root rather than stopping at the first flagged ancestor: only the OUTERMOST opted-in widget in a nesting run owns a slice, so the widgets in between hold nothing to stop at and the stale slice above them would survive.
InvalidateAllPaint
static void InvalidateAllPaint()Drops every retained slice in the process without walking any tree. The hammer for changes no widget can observe locally: a style set swap, reloaded fonts, a font atlas rebuilt under already-baked glyph UVs, a device pixel density change.
GetPaintEpoch
static uint32_t GetPaintEpoch()GetInvalidationSerial
static uint64_t GetInvalidationSerial()Ticks on every invalidation of any kind anywhere — a layout or paint walk, a slice dropped, a global drop. The window manager skips a window's paint only while this has not moved since the window last painted. Invalidations raised while a paint pass runs count apart: a widget re-flagging itself mid-paint is judged by what it then draws, and counting it here would let one window's paint keep every other window from ever skipping.
GetInPaintInvalidationSerial
static uint64_t GetInPaintInvalidationSerial()SetPaintPassActive
static void SetPaintPassActive(bool active)SetInvalidationCensus
static void SetInvalidationCensus(bool enabled)Counts, by widget type, the invalidations raised outside a paint pass while on: the answer to "what keeps this window from skipping".
TakeInvalidationCensus
static void TakeInvalidationCensus(std::vector<std::pair<std::string, uint64_t>>& outSortedDesc)NoteLivePaint
static void NoteLivePaint()A paint that changes with the clock rather than with any write — a blinking caret, a scroll bar waiting out its hide delay — calls this, so the window it paints in keeps painting while it lasts.
GetLivePaintCount
static uint64_t GetLivePaintCount()NoteRepaintIn
static void NoteRepaintIn(double seconds)For a paint that changes with the clock but only at a known moment — a caret's next blink, the end of a scroll bar's hide delay — instead of NoteLivePaint: the window may skip its paints until then, rather than painting every frame of the wait. The window keeps the earliest request its paint made.
ResetRepaintDeadline
static void ResetRepaintDeadline()TakeRepaintDeadline
static double TakeRepaintDeadline()The earliest NoteRepaintIn of the paint since the reset, on the SteadyNowSeconds clock; negative when none asked.
SteadyNowSeconds
static double SteadyNowSeconds()BeginObservedCollect
static void BeginObservedCollect(std::vector<std::weak_ptr<const AWidget>>* collector)The observed widgets a window's paint marked on screen, gathered so a frame that skips that paint can keep them on the poll list: otherwise every bound value in the window stops being polled the first frame nothing repaints it, and nothing would wake it again.
EndObservedCollect
static void EndObservedCollect()KeepObservedOnScreen
static void KeepObservedOnScreen(const std::vector<std::weak_ptr<const AWidget>>& widgets)GetPaintCount
static uint64_t GetPaintCount()How many OnPaint bodies ran, and how many were answered from a retained slice instead. The tests assert that a second pass over an unchanged tree replays rather than repaints; a wall-clock delta would prove nothing on a loaded machine.
GetPaintReplayCount
static uint64_t GetPaintReplayCount()ResetPaintCounts
static void ResetPaintCounts()SetRetainedPaintEnabled
static void SetRetainedPaintEnabled(bool enabled)Kill switch, so a suspected stale-pixel bug can be confirmed or cleared in one process instead of across two builds.
IsRetainedPaintEnabled
static bool IsRetainedPaintEnabled()CensusRetainedPaint
static void CensusRetainedPaint(const TSharedPtr<AWidget>& root, std::vector<std::pair<std::string, FRetainedPaintCensus>>& outByType)PollAttributes
virtual bool PollAttributes()Re-evaluates every bound attribute this widget paints or measures from and invalidates on the ones that moved. Returns whether any is still bound — false takes the widget off the poll list. A widget that overrides this may treat its bound attributes as plain values in CanCacheDesiredSize / CanSkipArrange / CanRetainPaint while AreBoundAttributesObserved() holds.
AreBoundAttributesObserved
bool AreBoundAttributesObserved() constTrue once this widget is on the poll list. Registration needs a shared owner, so a widget built on the stack never observes and keeps the conservative answers.
PollObservedAttributes
static uint32_t PollObservedAttributes()Runs PollAttributes on every observed widget that was on screen last frame and drops the rest off the list. Once a frame, before layout, from the window manager. Returns how many were polled. Only the ones on screen: a getter belongs to the widget's own frame, and the shell keeps whole hidden panels and parked popups alive with their bindings — six hundred of them against no polls at all was the shape this list had before it pruned itself.
GetObservedWidgetCount
static uint32_t GetObservedWidgetCount()StopObservingTree
static void StopObservingTree(const TSharedPtr<AWidget>& root)Takes root and everything under it out of the next poll, as if it had not painted last frame. A window that is closing or loses its root still has holders (the input processor's hovered path, a caller's reference) keeping the tree alive for a frame, and its getters may point into an owner that is already gone — the Project Settings crash was exactly that poll.
IsAttributePollDue
bool IsAttributePollDue() constWhether the next PollObservedAttributes would run this widget's getters.
ObserveAttributes
void ObserveAttributes()Puts this widget on the poll list. Called by TAttribute::SetOwner / Bind through CArcAttributeOwner; a widget that binds its own attributes without an owner can call it directly.
NoteObservedPaint
void NoteObservedPaint(CArcUIRenderer& renderer) constAn observed widget's OnPaint calls this before anything else: it marks the widget on screen for the next poll and, when a slice is being recorded around it, writes it into that slice so the replay can keep marking it. Before every return, or an empty text block would drop off the poll and its slice would never learn it filled.
OnMouseButtonDown
virtual CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event)OnMouseButtonDoubleClick
virtual CReply OnMouseButtonDoubleClick(const CGeometry& geo, const CPointerEvent& event)Fired instead of a second OnMouseButtonDown when the same button lands twice within the double-click window on the same widget (U1). Unhandled falls back to the plain button-down path, so widgets that roll their own timers keep working until migrated.
OnContextMenu
virtual bool OnContextMenu(const CGeometry& geo, const CPointerEvent& event, class CMenuBuilder& builder)Context-menu contract (U1): the first widget up the hit path that fills the builder wins; the input processor opens the framework menu at the cursor. Runs only when no OnMouseButtonUp handler consumed the right-button release, so widgets with bespoke menus keep them.
OnMouseButtonUp
virtual CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event)OnMouseMove
virtual CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event)OnMouseWheel
virtual CReply OnMouseWheel(const CGeometry& geo, const CPointerEvent& event)OnKeyDown
virtual CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event)Key events start at the focused widget and, while unhandled, are offered to each ancestor in turn until one returns Handled — the same leaf-to-root walk pointer events already take. A handler that wants a declined key to die where it is returns CReply::Unhandled().StopBubbling().
OnKeyUp
virtual CReply OnKeyUp(const CGeometry& geo, const CKeyEvent& event)OnKeyChar
virtual CReply OnKeyChar(const CGeometry& geo, const CCharacterEvent& event)OnTextComposition
virtual CReply OnTextComposition(const CGeometry& geo, const CCompositionEvent& event)OnMouseEnter
virtual void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event)OnMouseLeave
virtual void OnMouseLeave(const CPointerEvent& event)OnDragEnter
virtual bool OnDragEnter(const CGeometry& geo, const CDragDropEvent& event)Drop-target contract. While a drag operation is live the drag-drop manager resolves the widget under the cursor on every move — the widget holding mouse capture (the drag source) and its subtree are skipped — and walks that path leaf to root offering the drag. OnDragEnter is the offer: return true to become the target, false to pass it up the path. A widget that declines must leave no state behind, because it never receives OnDragLeave. The target then gets OnDragOver on every move (return false to show the rejected cursor without giving the target up) and exactly one OnDragLeave when the cursor moves off it or the drag ends. OnDrop lands before that final leave; returning true reports the drop as consumed.
OnDragOver
virtual bool OnDragOver(const CGeometry& geo, const CDragDropEvent& event)OnDragLeave
virtual void OnDragLeave(const CDragDropEvent& event)OnDrop
virtual bool OnDrop(const CGeometry& geo, const CDragDropEvent& event)WantsTextInput
virtual bool WantsTextInput(bool& outPassword) constA widget that edits text says so here (and whether it hides it), so a host can raise a platform on-screen keyboard over it. The default follows IsTextInput(), so a custom widget that types (a console line, a palette query) gets the IME without opting in.
OnFocusReceived
virtual void OnFocusReceived(const CFocusEvent& event)OnFocusLost
virtual void OnFocusLost(const CFocusEvent& event)OnMouseCaptureLost
virtual void OnMouseCaptureLost()OnCursorQuery
virtual EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) constOnHitTest
virtual EHitTestResult OnHitTest(const CGeometry& geo, const ArcVec2& absolutePosition) constClaimsPointerExclusively
virtual bool ClaimsPointerExclusively(const CGeometry& geo, const ArcVec2& absolutePosition) constGetNumChildren
virtual int32_t GetNumChildren() constGetChildAt
virtual TSharedPtr<AWidget> GetChildAt(int32_t index) constSetCachedGeometry
void SetCachedGeometry(const CGeometry& geo)GetCachedGeometry
const CGeometry& GetCachedGeometry() constSetVisibility
void SetVisibility(EVisibility vis)GetVisibility
EVisibility GetVisibility() constIsVisible
bool IsVisible() constSetEnabled
void SetEnabled(bool enabled)Enabled, hovered and focused are painted, not measured: they must drop the paint cache without throwing away a measure and an arrange that are still correct.
IsEnabled
bool IsEnabled() constIsHovered
bool IsHovered() constSetHovered
void SetHovered(bool hovered)HasKeyboardFocus
bool HasKeyboardFocus() constIsFocusVisible
bool IsFocusVisible() constFocus that arrived from the keyboard (Tab, arrows) rather than a click — the :focus-visible rule. A ring on every clicked button is noise; no ring on a tabbed-to button leaves a keyboard user lost.
SetPreviewState
void SetPreviewState(EArcPreviewState state)Pins a pointer or keyboard state for display. Hover and Focused set the flags the widget already reads; Pressed is reported by IsPreviewPressed, which the spec-driven widgets OR into their own press. The pin holds until the widget is hovered, focused or left for real, so a gallery shows it on a hit-test-invisible row.
GetPreviewState
EArcPreviewState GetPreviewState() constIsPreviewPressed
bool IsPreviewPressed() constSetCursor
inline void SetCursor(EArcCursorType cursor)Also applies to system cursor
GetCursor
EArcCursorType GetCursor() constSetTag
void SetTag(const CName& tag)GetTag
const CName& GetTag() constSetToolTipText
void SetToolTipText(const CText& text)SetToolTip
void SetToolTip(TSharedPtr<AWidget> widget)Rich tooltip (U1): an arbitrary widget hosted in the tooltip popup window instead of plain text lines — icons, keycap chips, asset thumbnails. Takes precedence over SetToolTipText when set.
GetToolTip
const TSharedPtr<AWidget>& GetToolTip() constGetToolTipText
const CText& GetToolTipText() constSetAccessibleLabel
void SetAccessibleLabel(const CText& label)GetAccessibleLabel
const CText& GetAccessibleLabel() constGetAccessibleRole
virtual EAccessibleRole GetAccessibleRole() constWhat a screen reader calls this control. Widgets override the role and value; deriving them from the type name broke for every subclass and left numeric, radio and multi-line fields unnamed.
GetAccessibleValue
virtual std::string GetAccessibleValue() constGetAccessibleName
virtual std::string GetAccessibleName() constThe accessible label when one was set; otherwise the first text found under the widget (an icon glyph is not text); otherwise the tooltip — which is what names an icon-only toolbar button.
SetParentWidget
void SetParentWidget(TSharedPtr<AWidget> parent)Parent tracking (weak reference to avoid cycles)
GetParentWidget
TSharedPtr<AWidget> GetParentWidget() constSetRenderTransform
void SetRenderTransform(const CArcRenderTransform& transform)A transform on how this widget paints and is hit, not on its layout, applied about the pivot (a fraction of its size, the centre by default). Its parent applies it — containers arrange and paint their children through ArrangeChildWidget / PaintChildWidget — so the whole subtree turns with it and hit testing follows. A layout invalidation, because the transform lives in the arranged geometry the hit test reads.
GetRenderTransform
const CArcRenderTransform& GetRenderTransform() constSetRenderTransformPivot
void SetRenderTransformPivot(const ArcVec2& pivot)GetRenderTransformPivot
const ArcVec2& GetRenderTransformPivot() constHasRenderTransform
bool HasRenderTransform() constComputeRenderTransform
ArcMat3 ComputeRenderTransform(const CGeometry& geo) constThe render transform in absolute space for the given layout geometry: about the pivot point of its rect.
ArrangeChildWidget
static void ArrangeChildWidget(AWidget& child, const CGeometry& childGeometry)Arranges a child into childGeometry with the child's own render transform folded into the geometry it caches, so the transform reaches its hit test and every geometry built below it.
PaintChildWidget
static int32_t PaintChildWidget(const AWidget& child, const CArcPaintArgs& args, CArcUIRenderer& renderer, int32_t layerId)Paints a child from its cached geometry under its render transform.
SetRenderOpacity
void SetRenderOpacity(float opacity)The opacity multiplies into every vertex colour the widget emits, so a slice recorded at one value paints the wrong alpha at another.
GetRenderOpacity
float GetRenderOpacity() constGetTypeName
virtual const char* GetTypeName() constIsTextInput
virtual bool IsTextInput() constTrue for widgets that consume plain keystrokes as text while focused (editable text boxes and their kin). The input processor suppresses modifier-less command chords when such a widget has focus.
ConsumesTab
virtual bool ConsumesTab() constTrue only for a widget that types Tab as a character (the multi-line box). Every other text input lets Tab move focus, which is the only way out of a single-line field from the keyboard.
GetFocusVisual
virtual EFocusVisual GetFocusVisual() constHow this widget's keyboard focus is drawn by CArcFocusRing. Text inputs answer None (their focused border says it); a row-like widget answers InsetBorder.
PaintsOwnFocus
virtual bool PaintsOwnFocus() constTrue for a widget whose own paint shows keyboard focus where the framework's ring would be wrong (the ring round a slider's thumb, a tree's or list's keyboard row): it answers None above and still shows focus, which the keyboard audit has to know.
OwnsKeyboard
virtual bool OwnsKeyboard() constTrue while a self-drawn overlay (a command palette) holds the keyboard the way a modal does: Tab is its own key there, so the keyboard audit closes it with Escape before tabbing the window.
GetFocusRadius
virtual float GetFocusRadius() constThe corner radius of the control's own outline. The focus ring is drawn concentric with it (this plus the gap and stroke), so a pill toggle gets a pill ring and a 2 px checkbox a near-square one; one fixed radius made every ring a 4 px rounded box whatever it circled.
AllowsKeyBubbling
virtual bool AllowsKeyBubbling() constWhether a key this widget declined may be offered to its ancestors. Overriding to false restores the pre-bubbling behaviour for this widget and everything under it — the opt-out for a widget tree (a game HUD arbitrating its own input, say) that must not have its leftover keys reinterpreted by whatever it happens to be parented to. The framework fallbacks still run; only the walk stops.
IsFocusable
virtual bool IsFocusable() constFocusability predicate for directional (gamepad/keyboard) navigation — the FNavigationConfig seam. Interactive widgets override to true; navigation additionally requires the widget to be visible and enabled.
OnActivate
virtual bool OnActivate()A gamepad/keyboard accept aimed at this widget. Widgets translate the activation internally (fire the click delegate, toggle, open) instead of receiving a synthesized mouse click. Returns true when the activation was consumed.
Invalidate
void Invalidate()Marks this widget's desired size dirty, then walks up the parent chain flagging ancestors. The walk stops at the first ancestor already flagged — everything above it was flagged when it was.
NeedsLayout
bool NeedsLayout() constClearLayoutFlag
void ClearLayoutFlag()NeedsSubtreeLayout
bool NeedsSubtreeLayout() constTrue when this widget or anything below it needs a fresh measure.
InvalidateAllWidgets
static void InvalidateAllWidgets()Drops every cached desired size in the process, without walking any tree. This is the hammer for changes no widget can observe locally: active style set swapped, fonts reloaded, application scale changed.
SetFocusScopeId
void SetFocusScopeId(const CName& id)The focus scope this widget roots, None on everything else. The command system walks from the focused widget to the root, collects the scopes named along the way and offers a chord to them innermost first, before the pushed lists and the global keymap. That is what makes a shortcut follow the panel the user is in; the editor used to scope by pointer hover, which retargeted the chord the moment the mouse drifted off the panel mid-edit. Focus itself is unchanged — OnFocusReceived/OnFocusLost and CReply::SetUserFocus still own it, and a scope is only read off the path they produce.
GetFocusScopeId
const CName& GetFocusScopeId() constIsFocusScopeRoot
bool IsFocusScopeRoot() const