Class AcceptDialog

Namespace
Forma
Assembly
Forma.dll

Popup dialog with explicit accepted/cancelled lifecycle events.

[TemplatePart("PART_TitlePresenter", typeof(Label), true)]
[TemplatePart("PART_ContentPresenter", typeof(Label), true)]
[TemplatePart("PART_AcceptButton", typeof(BaseButton), true)]
[TemplatePart("PART_CancelButton", typeof(BaseButton), false)]
public class AcceptDialog : PopupPanel, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
Inheritance
AcceptDialog
Implements
Derived
Inherited Members

Constructors

AcceptDialog()

public AcceptDialog()

Fields

AcceptButtonPartName

public const string AcceptButtonPartName = "PART_AcceptButton"

Field Value

string

CancelButtonPartName

public const string CancelButtonPartName = "PART_CancelButton"

Field Value

string

TitlePresenterPartName

public const string TitlePresenterPartName = "PART_TitlePresenter"

Field Value

string

Properties

AccessibilityRole

public override AccessibilityRole AccessibilityRole { get; }

Property Value

AccessibilityRole

ButtonHeight

public float ButtonHeight { get; set; }

Property Value

float

CancelButtonBounds

protected virtual Rectangle CancelButtonBounds { get; }

Property Value

Rectangle

CancelLabelText

protected virtual string CancelLabelText { get; }

Property Value

string

CloseOnEscape

public bool CloseOnEscape { get; set; }

Property Value

bool

DefaultOkText

The fallback OK button text shown while no custom OkText override is set.

protected string DefaultOkText { get; set; }

Property Value

string

DialogText

public string DialogText { get; set; }

Property Value

string

Font

public SpriteFont Font { get; set; }

Property Value

SpriteFont

HasCancelButton

protected virtual bool HasCancelButton { get; }

Property Value

bool

HideOnOk

Matches Godot's dialog_hide_on_ok option. Confirmation still emits when disabled.

public bool HideOnOk { get; set; }

Property Value

bool

OkButtonBounds

protected virtual Rectangle OkButtonBounds { get; }

Property Value

Rectangle

OkButtonDisabled

Matches Godot's get_ok_button()->is_disabled(): blocks confirming via click, Enter, or a registered LineEdit's text_submitted, without a real button-widget model.

public bool OkButtonDisabled { get; set; }

Property Value

bool

OkText

Matches Godot's ok_text/default_ok_text layering: a custom override always wins over the current default (which FileDialog changes per file-mode via DefaultOkText); clearing back to empty/null reverts to showing the default again.

public string OkText { get; set; }

Property Value

string

Title

public string Title { get; set; }

Property Value

string

UIFont

public UIFont UIFont { get; set; }

Property Value

UIFont

Methods

AddButton(string, bool, string)

public Button AddButton(string text, bool right = false, string action = "")

Parameters

text string
right bool
action string

Returns

Button

AddCancelButton(string)

public Button AddCancelButton(string text = "")

Parameters

text string

Returns

Button

ArrangeChildren()

protected override void ArrangeChildren()

Cancel()

public virtual void Cancel()

Confirm()

public virtual void Confirm()

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2

OnTemplateApplied()

protected override void OnTemplateApplied()

RegisterTextEnter(LineEdit)

Wires a LineEdit's Enter/TextSubmitted to confirm this dialog, matching Godot's register_text_enter - guarded by OkButtonDisabled exactly like Godot's _text_submitted.

public void RegisterTextEnter(LineEdit lineEdit)

Parameters

lineEdit LineEdit

RemoveButton(Button)

public void RemoveButton(Button button)

Parameters

button Button

Events

Canceled

public event EventHandler Canceled

Event Type

EventHandler

Confirmed

public event EventHandler Confirmed

Event Type

EventHandler

CustomAction

public event Action<AcceptDialog, string> CustomAction

Event Type

Action<AcceptDialog, string>