Skip to main content

ToggleModal class

Namespace: Arlecchino.Modals.Setting · Assembly: Arlecchino

A yes-or-no answer, flipped with the arrows or picked by clicking one of the two chips.

public sealed class ToggleModal : Modal

Inherits from Modal

Constructors

MemberSummary
ToggleModal()

Properties

MemberSummary
NoChipWhere the negative chip was drawn last frame.
OnSubmitCalled with the answer that was confirmed.
ValueThe answer as it stands.
YesChipWhere the affirmative chip was drawn last frame, used to turn a click into an answer.

Methods

MemberSummary
Draw(ModalFrame)
Handle(ModalFrame, KeyPress)
HandleMouse(ModalFrame, MouseEvent)

Constructors in detail

ToggleModal()

Obsolete

Constructors of types with required members are not supported in this version of your compiler.

public ToggleModal();

Properties in detail

NoChip

public SurfaceRegion NoChip { get; set; }

Where the negative chip was drawn last frame.

Type SurfaceRegion

OnSubmit

public Action<bool> OnSubmit { get; init; }

Called with the answer that was confirmed.

Type Action<T><bool>

Value

public bool Value { get; set; }

The answer as it stands.

Type bool

YesChip

public SurfaceRegion YesChip { get; set; }

Where the affirmative chip was drawn last frame, used to turn a click into an answer.

Type SurfaceRegion

Methods in detail

Draw(ModalFrame)

public override void Draw(ModalFrame frame);

Parameters

NameTypeDescription
frameModalFrame

Handle(ModalFrame, KeyPress)

public override void Handle(ModalFrame frame, KeyPress key);

Parameters

NameTypeDescription
frameModalFrame
keyKeyPress

HandleMouse(ModalFrame, MouseEvent)

public override void HandleMouse(ModalFrame frame, MouseEvent mouse);

Parameters

NameTypeDescription
frameModalFrame
mouseMouseEvent