class_acceptdialog.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AcceptDialog.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AcceptDialog:
  5. AcceptDialog
  6. ============
  7. **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>`
  8. **Inherited By:** :ref:`ConfirmationDialog<class_confirmationdialog>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Base dialog for user notification.
  13. Member Functions
  14. ----------------
  15. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Button<class_button>` | :ref:`add_button<class_AcceptDialog_add_button>` **(** :ref:`String<class_string>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_string>` action="" **)** |
  17. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`Button<class_button>` | :ref:`add_cancel<class_AcceptDialog_add_cancel>` **(** :ref:`String<class_string>` name **)** |
  19. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`get_hide_on_ok<class_AcceptDialog_get_hide_on_ok>` **(** **)** const |
  21. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`Label<class_label>` | :ref:`get_label<class_AcceptDialog_get_label>` **(** **)** |
  23. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Button<class_button>` | :ref:`get_ok<class_AcceptDialog_get_ok>` **(** **)** |
  25. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_string>` | :ref:`get_text<class_AcceptDialog_get_text>` **(** **)** const |
  27. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`register_text_enter<class_AcceptDialog_register_text_enter>` **(** :ref:`Node<class_node>` line_edit **)** |
  29. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_hide_on_ok<class_AcceptDialog_set_hide_on_ok>` **(** :ref:`bool<class_bool>` enabled **)** |
  31. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_text<class_AcceptDialog_set_text>` **(** :ref:`String<class_string>` text **)** |
  33. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. Signals
  35. -------
  36. - **confirmed** **(** **)**
  37. Emitted when the dialog is accepted.
  38. - **custom_action** **(** :ref:`String<class_string>` action **)**
  39. Emitted when a custom button is pressed. See :ref:`add_button<class_AcceptDialog_add_button>`.
  40. Member Variables
  41. ----------------
  42. - :ref:`bool<class_bool>` **dialog_hide_on_ok** - If [code]true[/code] the dialog is hidden when accepted. Default value: [code]true[/code].
  43. - :ref:`String<class_string>` **dialog_text** - The text displayed by this dialog.
  44. Description
  45. -----------
  46. This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result.
  47. Member Function Description
  48. ---------------------------
  49. .. _class_AcceptDialog_add_button:
  50. - :ref:`Button<class_button>` **add_button** **(** :ref:`String<class_string>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_string>` action="" **)**
  51. Adds a button with label *text* and a custom *action* to the dialog and returns the created button. *action* will be passed to the custom_action signal when pressed.
  52. If ``true``, *right* will place the button to the right of any sibling buttons. Default value: ``false``.
  53. .. _class_AcceptDialog_add_cancel:
  54. - :ref:`Button<class_button>` **add_cancel** **(** :ref:`String<class_string>` name **)**
  55. Adds a button with label *name* and a cancel action to the dialog and returns the created button.
  56. .. _class_AcceptDialog_get_hide_on_ok:
  57. - :ref:`bool<class_bool>` **get_hide_on_ok** **(** **)** const
  58. Return true if the dialog will be hidden when accepted (default true).
  59. .. _class_AcceptDialog_get_label:
  60. - :ref:`Label<class_label>` **get_label** **(** **)**
  61. Return the label used for built-in text.
  62. .. _class_AcceptDialog_get_ok:
  63. - :ref:`Button<class_button>` **get_ok** **(** **)**
  64. Return the OK Button.
  65. .. _class_AcceptDialog_get_text:
  66. - :ref:`String<class_string>` **get_text** **(** **)** const
  67. Return the built-in label text.
  68. .. _class_AcceptDialog_register_text_enter:
  69. - void **register_text_enter** **(** :ref:`Node<class_node>` line_edit **)**
  70. Registers a :ref:`LineEdit<class_lineedit>` in the dialog. When the enter key is pressed, the dialog will be accepted.
  71. .. _class_AcceptDialog_set_hide_on_ok:
  72. - void **set_hide_on_ok** **(** :ref:`bool<class_bool>` enabled **)**
  73. Set whether the dialog is hidden when accepted (default true).
  74. .. _class_AcceptDialog_set_text:
  75. - void **set_text** **(** :ref:`String<class_string>` text **)**
  76. Set the built-in label text.