Class InlineMessageBoxControl
A message-box style inline control: a block of message text plus a row of buttons. It is the first
consumer of the multi-widget dialog layout — it exposes exactly two top-level widgets, the message
content (InFrameScrollable) and the button group
(InFrame), and routes keys to the (focused) button group.
public sealed class InlineMessageBoxControl : InlineControlBase, ICliRenderable
- Inheritance
-
InlineMessageBoxControl
- Implements
- Inherited Members
Remarks
The button group is the top-level interactive widget; individual buttons are not separate dialog
widgets. Activating a button returns its DialogResultKind via
WithResult(DialogResultKind) so the hosting
InlineDialog completes with that
result. Escape is left unhandled so the dialog's cancel fallback fires
(Cancel), even for button sets that have no explicit Cancel button.Constructors
InlineMessageBoxControl(ICliAppShell, string, MessageBoxButtons, DialogResultKind?, MessageBoxKind)
Creates a message-box control with a message and button row.
public InlineMessageBoxControl(ICliAppShell shell, string message, MessageBoxButtons buttons = MessageBoxButtons.Ok, DialogResultKind? defaultButton = null, MessageBoxKind kind = MessageBoxKind.Normal)
Parameters
shellICliAppShell- The shell that supplies the theme, culture, and viewport.
messagestring- The message to display.
buttonsMessageBoxButtons- The buttons to include.
defaultButtonDialogResultKind?- The button selected initially, or
nullto use the button-set default. kindMessageBoxKind- The semantic kind that selects the control's dialog surface.
Properties
ButtonGroup
The button group is the single focused/interactive top-level widget.
public InlineButtonGroupWidget ButtonGroup { get; }
Property Value
CanConfirm
True when the hosting dialog may complete this control with an Enter/OK action.
public override bool CanConfirm { 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 override ThemeStyle DialogSurfaceStyle { get; }
Property Value
Hint
Optional status/hint text shown by the hosting dialog.
public override string? Hint { get; }
Property Value
Kind
The semantic severity of this message box (selects the dialog surface).
public MessageBoxKind Kind { get; }
Property Value
Payload
Optional value produced by this control when its hosting dialog completes.
public override object? Payload { get; }
Property Value
Methods
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 override 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 override InlineKeyResult HandleKey(KeyEvent key)
Parameters
keyKeyEvent
Returns
ToGrid()
Converts the component into a grid for measurement and rendering.
public override CliGrid ToGrid()