AcceptDialog
Message/form window with a confirmation button and explicit action signals.
Add the dialog to the tree, configure DialogText and open with inherited PopupCentered. Initially hidden, with transient/exclusive enabled. Reopening reuses the object; hiding does not free it. Use ConfirmationDialog for an explicit confirm/cancel choice.
Confirmed comes from the OK button or a registered LineEdit. Default DialogHideOnOk = true hides the window before the handler runs. For validation, set false, validate values in Confirmed and call Hide only on success. Setting GetOkButton().Disabled blocks the button and registered Enter submission; the button caption does not itself save anything.
Canceled belongs to the cancellation path: a Cancel button, window close request, or ui_close_dialog when DialogCloseOnEscape is enabled. Direct Hide is not cancellation and does not emit Canceled. Cancellation schedules hiding deferred; do not assume Visible already changed inside the handler. Implement application-data rollback yourself.
AddButton with nonempty action emits CustomAction rather than Confirmed or Canceled. It does not automatically close the window; with empty action connect the returned Button.Pressed yourself. AddCancelButton creates a cancellation-path button. Do not infer roles from button text or position.
GetOkButton/GetLabel and added buttons are owned by the dialog. Do not free them while attached. RemoveButton detaches an extra button without freeing it: reparent it or call Free afterwards. The standard OK cannot be removed; also retain ConfirmationDialog’s standard Cancel because the derived class keeps a reference to it.
RegisterTextEnter once for each LineEdit, normally an owned field inside the dialog. Assigning Text is not TextSubmitted and does not confirm the form. The submission handler does not check Visible: avoid registering an external always-active field without your own state guard.
For forms, put one root Container in dialog content and nest fields inside it. Multiple direct Controls receive the same area and can overlap. Clear DialogText or hide the built-in Label for a custom form. DialogAutowrap affects only that Label rather than arranging other fields.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AcceptDialogConstructor
public AcceptDialog();Creates a hidden window with OK, DialogHideOnOk and DialogCloseOnEscape enabled, empty DialogText and DialogAutowrap disabled.
Properties5
DialogAutowrapProperty
public bool DialogAutowrap { get; set; }Built-in Label wrapping: true sets Word, false sets Off. Getter is true for any non-Off Label mode. Does not affect custom-field layout.
DialogCloseOnEscapeProperty
public bool DialogCloseOnEscape { get; set; }Allows cancellation through ui_close_dialog, usually Escape; default true. false does not block Cancel buttons or window close requests.
DialogHideOnOkProperty
public bool DialogHideOnOk { get; set; }Hide before Confirmed, default true. For form validation set false and call Hide manually after success. Does not control cancellation or CustomAction.
DialogTextProperty
public string DialogText { get; set; }Original built-in Label text. Plain text rather than BBCode or form-field values. Direct GetLabel().Text changes are reflected by the getter.
OkButtonTextProperty
public string OkButtonText { get; set; }Stored custom OK caption, default empty uses the standard caption. Getter returns this raw value, so can be empty while the button shows OK. Use Confirmed for behavior rather than caption text.
Methods18
AddButtonButton
public Button AddButton(string text, bool right = false, string action = "");Adds an extra button and returns its shared reference. Nonempty action connects CustomAction without automatic hiding; empty requires your own Pressed handler. right chooses the logical side of the row relative to OK rather than a button role.
| Name | Type | Default |
|---|---|---|
text | string | — |
right | bool | false |
action | string | "" |
textAdds an extra button and returns its shared reference. Nonempty action connects CustomAction without automatic hiding; empty requires your own Pressed handler. right chooses the logical side of the row relative to OK rather than a button role.
rightLogical row side: false at the beginning, true at the end relative to standard OK.
actionCustomAction identifier; empty adds no automatic action.
ButtonAdded Button owned by the dialog until detached.
AddCancelButtonButton
public Button AddCancelButton(string name);Adds a Canceled-path button. Empty name uses the standard localizable Cancel caption; system policy determines placement. The dialog owns it while attached.
| Name | Type | Default |
|---|---|---|
name | string | — |
nameAdds a Canceled-path button. Empty name uses the standard localizable Cancel caption; system policy determines placement. The dialog owns it while attached.
ButtonAdded cancel Button owned by the dialog.
GetCloseOnEscapebool
public bool GetCloseOnEscape();Allows cancellation through ui_close_dialog, usually Escape; default true. false does not block Cancel buttons or window close requests.
boolCancel-through-ui_close_dialog flag.
GetHideOnOkbool
public bool GetHideOnOk();Hide before Confirmed, default true. For form validation set false and call Hide manually after success. Does not control cancellation or CustomAction.
boolHide-on-confirm flag.
GetLabelLabel
public Label GetLabel();Shared internal message Label. Configure appearance/visibility; do not remove or free it.
LabelShared internal Label.
GetOkButtonButton
public Button GetOkButton();Shared standard confirmation Button owned by the dialog. Configure Disabled/theme; do not remove or free it.
ButtonShared standard OK Button.
GetOkButtonTextstring
public string GetOkButtonText();Stored custom OK caption, default empty uses the standard caption. Getter returns this raw value, so can be empty while the button shows OK. Use Confirmed for behavior rather than caption text.
stringRaw OK caption; empty means default.
GetTextstring
public string GetText();Original built-in Label text. Plain text rather than BBCode or form-field values. Direct GetLabel().Text changes are reflected by the getter.
stringOriginal built-in Label text.
HasAutowrapbool
public bool HasAutowrap();Built-in Label wrapping: true sets Word, false sets Off. Getter is true for any non-Off Label mode. Does not affect custom-field layout.
booltrue when the built-in Label mode is not Off.
RegisterTextEnter2 overloads
public void RegisterTextEnter(Control _UnnamedArg0);Connects a specific LineEdit.TextSubmitted to confirmation once. Checks OK Disabled but not dialog Visible or form validation rules. The Control overload also requires a LineEdit; another Control is not treated as an input field.
| Name | Type | Default |
|---|---|---|
_UnnamedArg0 | Control | — |
_UnnamedArg0Non-null LineEdit. Connect once rather than supplying an arbitrary Control.
public void RegisterTextEnter(LineEdit lineEdit);Connects a specific LineEdit.TextSubmitted to confirmation once. Checks OK Disabled but not dialog Visible or form validation rules. The Control overload also requires a LineEdit; another Control is not treated as an input field.
| Name | Type | Default |
|---|---|---|
lineEdit | LineEdit | — |
lineEditNon-null LineEdit. Connect once rather than supplying an arbitrary Control.
RemoveButton2 overloads
public void RemoveButton(Button button);Detaches an extra button from this dialog and removes its associated spacer. Does not free the button: reparent or call Free. Cannot remove standard OK; the Control overload requires a Button rather than any Control.
| Name | Type | Default |
|---|---|---|
button | Button | — |
buttonExtra Button belonging to this dialog; standard OK is not allowed.
public void RemoveButton(Control quadrantSize);Detaches an extra button from this dialog and removes its associated spacer. Does not free the button: reparent or call Free. Cannot remove standard OK; the Control overload requires a Button rather than any Control.
| Name | Type | Default |
|---|---|---|
quadrantSize | Control | — |
quadrantSizeExtra Button belonging to this dialog; standard OK is not allowed.
SetAutowrapvoid
public void SetAutowrap(bool autowrap);Built-in Label wrapping: true sets Word, false sets Off. Getter is true for any non-Off Label mode. Does not affect custom-field layout.
| Name | Type | Default |
|---|---|---|
autowrap | bool | — |
autowrapBuilt-in Label wrapping: true sets Word, false sets Off. Getter is true for any non-Off Label mode. Does not affect custom-field layout.
SetCloseOnEscapevoid
public void SetCloseOnEscape(bool enabled);Allows cancellation through ui_close_dialog, usually Escape; default true. false does not block Cancel buttons or window close requests.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows cancellation through ui_close_dialog, usually Escape; default true. false does not block Cancel buttons or window close requests.
SetHideOnOkvoid
public void SetHideOnOk(bool enabled);Hide before Confirmed, default true. For form validation set false and call Hide manually after success. Does not control cancellation or CustomAction.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledHide before Confirmed, default true. For form validation set false and call Hide manually after success. Does not control cancellation or CustomAction.
SetOkButtonTextvoid
public void SetOkButtonText(string text);Stored custom OK caption, default empty uses the standard caption. Getter returns this raw value, so can be empty while the button shows OK. Use Confirmed for behavior rather than caption text.
| Name | Type | Default |
|---|---|---|
text | string | — |
textStored custom OK caption, default empty uses the standard caption. Getter returns this raw value, so can be empty while the button shows OK. Use Confirmed for behavior rather than caption text.
SetTextvoid
public void SetText(string text);Original built-in Label text. Plain text rather than BBCode or form-field values. Direct GetLabel().Text changes are reflected by the getter.
| Name | Type | Default |
|---|---|---|
text | string | — |
textOriginal built-in Label text. Plain text rather than BBCode or form-field values. Direct GetLabel().Text changes are reflected by the getter.
Signals and events3
CanceledEvent
public event Action Canceled;Cancellation through standard button/close/Escape paths. Hiding is deferred; direct Hide does not emit this signal. Does not imply automatic data rollback.
ConfirmedEvent
public event Action Confirmed;Confirmation through OK/a registered field. With DialogHideOnOk = true the window is hidden before this signal. Your handler performs saving/application actions.
CustomActionEvent
public event AcceptDialog.CustomActionEventHandler CustomAction;An extra button with nonempty action was activated. Supplies the action StringName; does not itself confirm, cancel or hide the dialog.
| Name | Type | Default |
|---|---|---|
action | StringName | — |
actionStringName configured as nonempty AddButton action.
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
buttons_min_heightint | The minimum height of each button in the bottom row (such as OK/Cancel) in pixels. This can be increased to make buttons with short texts easier to click/tap. Default:0 |
buttons_min_widthint | The minimum width of each button in the bottom row (such as OK/Cancel) in pixels. This can be increased to make buttons with short texts easier to click/tap. Default:0 |
buttons_separationint | The size of the vertical space between the dialog's content and the button row. Default:10 |
panelStyleBox | The panel that fills the background of the window. |