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
CancelButtonPartName
public const string CancelButtonPartName = "PART_CancelButton"
Field Value
TitlePresenterPartName
public const string TitlePresenterPartName = "PART_TitlePresenter"
Field Value
Properties
AccessibilityRole
public override AccessibilityRole AccessibilityRole { get; }
Property Value
ButtonHeight
public float ButtonHeight { get; set; }
Property Value
CancelButtonBounds
protected virtual Rectangle CancelButtonBounds { get; }
Property Value
- Rectangle
CancelLabelText
protected virtual string CancelLabelText { get; }
Property Value
CloseOnEscape
public bool CloseOnEscape { get; set; }
Property Value
DefaultOkText
The fallback OK button text shown while no custom OkText override is set.
protected string DefaultOkText { get; set; }
Property Value
DialogText
public string DialogText { get; set; }
Property Value
Font
public SpriteFont Font { get; set; }
Property Value
- SpriteFont
HasCancelButton
protected virtual bool HasCancelButton { get; }
Property Value
HideOnOk
Matches Godot's dialog_hide_on_ok option. Confirmation still emits when disabled.
public bool HideOnOk { get; set; }
Property Value
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
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
Title
public string Title { get; set; }
Property Value
UIFont
public UIFont UIFont { get; set; }
Property Value
Methods
AddButton(string, bool, string)
public Button AddButton(string text, bool right = false, string action = "")
Parameters
Returns
AddCancelButton(string)
public Button AddCancelButton(string text = "")
Parameters
textstring
Returns
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
lineEditLineEdit
RemoveButton(Button)
public void RemoveButton(Button button)
Parameters
buttonButton
Events
Canceled
public event EventHandler Canceled
Event Type
Confirmed
public event EventHandler Confirmed
Event Type
CustomAction
public event Action<AcceptDialog, string> CustomAction