Class InlineControlBase
- Namespace
- ItTiger.TigerCli.Tui.Abstractions
- Assembly
- ItTiger.TigerCli.dll
Base class for dialog-hostable inline controls. Controls render themselves as grids, handle keys
through InlineKeyResult, and can expose dialog metadata such as hints, labels, widgets,
overlays, and completion state.
public abstract class InlineControlBase : CliRenderableComponent, ICliRenderable
- Inheritance
-
InlineControlBase
- Implements
- Derived
- Inherited Members
Constructors
InlineControlBase(ICliAppShell)
Creates a control hosted by
shell.protected InlineControlBase(ICliAppShell shell)
Parameters
shellICliAppShell
Properties
CanConfirm
True when the hosting dialog may complete this control with an Enter/OK action.
public virtual bool CanConfirm { get; }
Property Value
CompletionResult
A result the control wants the modal to complete with without a keypress (e.g. an async
operation finished). The hosting
InlineDialog surfaces this through its own
Result with precedence over key-/confirmation-driven results, and the shell loop breaks on
it after pumping AdvanceState(DateTime). The default is NoResult
(the control never self-completes).public virtual DialogResultKind CompletionResult { get; }
Property Value
ContentLabel
Optional control-driven label shown above the content, refreshed on each render. Used when the
hosting dialog has no constructor-supplied label.
public virtual string? ContentLabel { get; }
Property Value
ContentLabelMode
Formatting mode for ContentLabel.
public virtual CliFormattingMode ContentLabelMode { get; }
Property Value
ContentStyle
Optional content style applied to the control's default widget host cell.
public virtual CliCellStyle? ContentStyle { get; }
Property Value
ControlDecoration
The scroll indicators or scrollbars requested for the control's default widget.
public virtual CliControlDecoration ControlDecoration { get; protected set; }
Property Value
DialogArea
The dialog area this control's single top-level widget is placed into. Controls that expose
multiple widgets override GetWidgets() instead and may ignore this.
public virtual InlineDialogArea DialogArea { get; }
Property Value
DialogSurfaceStyle
The theme surface token the hosting
InlineDialog resolves for this control's dialog
background (frame body + content). The default is DialogSurface;
controls with a semantic severity (e.g. a warning/error message box) override this to return a
semantic surface token, keeping the dialog background theme-driven rather than hard-coded.public virtual ThemeStyle DialogSurfaceStyle { get; }
Property Value
Hint
Optional status/hint text shown by the hosting dialog.
public virtual string? Hint { get; }
Property Value
HintMode
Formatting mode for Hint.
public virtual CliFormattingMode HintMode { get; }
Property Value
HintReservedWidth
A stable width (in cells) the hosting
InlineDialog reserves for the status/hint bar, so
that changing the (focus-aware) Hint text does not change the dialog width. The
default is the current hint's width — correct for controls whose hint never changes. Composite
controls whose hint varies with focus override this to return the widest hint they can surface,
keeping the dialog width focus-stable.public virtual int HintReservedWidth { get; }
Property Value
Payload
Optional value produced by this control when its hosting dialog completes.
public abstract object? Payload { get; }
Property Value
ScrollMode
The scroll modes requested for the control's default widget.
public virtual CliScrollMode ScrollMode { get; protected set; }
Property Value
Shell
The shell hosting this control.
public ICliAppShell Shell { get; }
Property Value
ThumbMode
Controls whether scroll thumbs track offsets or the logical active point.
public virtual CliScrollThumbMode ThumbMode { get; }
Property Value
Methods
AdvanceState(DateTime)
Called once per modal-loop iteration on the render thread (immediately before periodic overlays
are advanced). Lets a control apply state that changed off the loop — for example the result of
an asynchronous operation — and report whether the UI must re-render. The default does nothing.
Implementations must be cheap and must not block the loop.
public virtual bool AdvanceState(DateTime nowUtc)
Parameters
nowUtcDateTime
Returns
GetActivityOverlays()
Time-varying overlays this control exposes to its hosting
InlineDialog (e.g. a loading
spinner or a clock). The dialog adds them once through the normal overlay system and advances
their tickers each modal-loop iteration. The default is none; the returned set must be
structurally stable for the control's lifetime (only the tickers' content/active state changes).public virtual IReadOnlyList<InlineActivityOverlay> GetActivityOverlays()
Returns
GetWidgets()
Exposes the top-level widgets the hosting
InlineDialog should place. The default
wraps the control's own ToGrid() output into one focused
widget, preserving the legacy single-content behavior. Composite controls override this to
expose several widgets across different InlineDialogArea areas.public virtual IReadOnlyList<InlineDialogWidget> GetWidgets()
Returns
HandleKey(KeyEvent)
Handles a key and optionally requests a dialog result. Returning
NotHandled lets the hosting dialog apply fallback keys.
public abstract InlineKeyResult HandleKey(KeyEvent key)
Parameters
keyKeyEvent
Returns
OnModalClosed()
Called by the modal loop as it stops hosting this control (any exit path). Controls should stop
tickers and abandon/ignore pending background results so a closed control is never mutated. The
default does nothing.
public virtual void OnModalClosed()
OnModalOpened(CancellationToken)
Called by the modal loop as it starts hosting this control, supplying a token that is cancelled
when the modal closes for any reason. Controls that start background work should observe it. The
default does nothing.
public virtual void OnModalOpened(CancellationToken modalToken)
Parameters
modalTokenCancellationToken
TryBeginDeferredCompletion(DialogResultKind)
Offered the chance to take over completion when the hosting dialog is about to commit a confirmed
kind (Cancel/Abort) after its confirmation gate. Returning true means the
control has begun a deferred completion (e.g. requested operation cancellation and switched to a
"Cancelling…" view) and the dialog must stay open until the control reports a
CompletionResult; returning false (the default) lets the dialog complete
immediately with kind, preserving existing behavior.public virtual bool TryBeginDeferredCompletion(DialogResultKind kind)
Parameters
kindDialogResultKind