class_acceptdialog.rst 6.6 KB

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