123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- :github_url: hide
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the AcceptDialog.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_AcceptDialog:
- AcceptDialog
- ============
- **Inherits:** :ref:`WindowDialog<class_WindowDialog>` **<** :ref:`Popup<class_Popup>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`ConfirmationDialog<class_ConfirmationDialog>`
- **Category:** Core
- Brief Description
- -----------------
- Base dialog for user notification.
- Properties
- ----------
- +-----------------------------+-------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`dialog_hide_on_ok<class_AcceptDialog_property_dialog_hide_on_ok>` |
- +-----------------------------+-------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`dialog_text<class_AcceptDialog_property_dialog_text>` |
- +-----------------------------+-------------------------------------------------------------------------+
- Methods
- -------
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Button<class_Button>` | :ref:`add_button<class_AcceptDialog_method_add_button>` **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)** |
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Button<class_Button>` | :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` **(** :ref:`String<class_String>` name **)** |
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Button<class_Button>` | :ref:`get_ok<class_AcceptDialog_method_get_ok>` **(** **)** |
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Node<class_Node>` line_edit **)** |
- +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Signals
- -------
- .. _class_AcceptDialog_signal_confirmed:
- - **confirmed** **(** **)**
- Emitted when the dialog is accepted, i.e. the OK button is pressed.
- ----
- .. _class_AcceptDialog_signal_custom_action:
- - **custom_action** **(** :ref:`String<class_String>` action **)**
- Emitted when a custom button is pressed. See :ref:`add_button<class_AcceptDialog_method_add_button>`.
- Description
- -----------
- This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result.
- Property Descriptions
- ---------------------
- .. _class_AcceptDialog_property_dialog_hide_on_ok:
- - :ref:`bool<class_bool>` **dialog_hide_on_ok**
- +----------+-----------------------+
- | *Setter* | set_hide_on_ok(value) |
- +----------+-----------------------+
- | *Getter* | get_hide_on_ok() |
- +----------+-----------------------+
- If ``true``, the dialog is hidden when the OK button is pressed. You can set it to ``false`` if you want to do e.g. input validation when receiving the :ref:`confirmed<class_AcceptDialog_signal_confirmed>` signal, and handle hiding the dialog in your own logic. Default value: ``true``.
- Note: Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example :ref:`FileDialog<class_FileDialog>` defaults to ``false``, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such this property can't be used in :ref:`FileDialog<class_FileDialog>` to disable hiding the dialog when pressing OK.
- ----
- .. _class_AcceptDialog_property_dialog_text:
- - :ref:`String<class_String>` **dialog_text**
- +----------+-----------------+
- | *Setter* | set_text(value) |
- +----------+-----------------+
- | *Getter* | get_text() |
- +----------+-----------------+
- The text displayed by this dialog.
- Method Descriptions
- -------------------
- .. _class_AcceptDialog_method_add_button:
- - :ref:`Button<class_Button>` **add_button** **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)**
- Adds a button with label *text* and a custom *action* to the dialog and returns the created button. *action* will be passed to the :ref:`custom_action<class_AcceptDialog_signal_custom_action>` signal when pressed.
- If ``true``, *right* will place the button to the right of any sibling buttons. Default value: ``false``.
- ----
- .. _class_AcceptDialog_method_add_cancel:
- - :ref:`Button<class_Button>` **add_cancel** **(** :ref:`String<class_String>` name **)**
- Adds a button with label *name* and a cancel action to the dialog and returns the created button.
- ----
- .. _class_AcceptDialog_method_get_label:
- - :ref:`Label<class_Label>` **get_label** **(** **)**
- Returns the label used for built-in text.
- ----
- .. _class_AcceptDialog_method_get_ok:
- - :ref:`Button<class_Button>` **get_ok** **(** **)**
- Returns the OK Button.
- ----
- .. _class_AcceptDialog_method_register_text_enter:
- - void **register_text_enter** **(** :ref:`Node<class_Node>` line_edit **)**
- Registers a :ref:`LineEdit<class_LineEdit>` in the dialog. When the enter key is pressed, the dialog will be accepted.
|