class_confirmationdialog.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ConfirmationDialog.xml.
  6. .. _class_ConfirmationDialog:
  7. ConfirmationDialog
  8. ==================
  9. **Inherits:** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`EditorCommandPalette<class_EditorCommandPalette>`, :ref:`EditorFileDialog<class_EditorFileDialog>`, :ref:`FileDialog<class_FileDialog>`, :ref:`ScriptCreateDialog<class_ScriptCreateDialog>`
  11. A dialog used for confirmation of actions.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A dialog used for confirmation of actions. This window is similar to :ref:`AcceptDialog<class_AcceptDialog>`, but pressing its Cancel button can have a different outcome from pressing the OK button. The order of the two buttons varies depending on the host OS.
  16. To get cancel action, you can use:
  17. .. tabs::
  18. .. code-tab:: gdscript
  19. get_cancel_button().pressed.connect(_on_canceled)
  20. .. code-tab:: csharp
  21. GetCancelButton().Pressed += OnCanceled;
  22. \ **Note:** :ref:`AcceptDialog<class_AcceptDialog>` is invisible by default. To make it visible, call one of the ``popup_*`` methods from :ref:`Window<class_Window>` on the node, such as :ref:`Window.popup_centered_clamped()<class_Window_method_popup_centered_clamped>`.
  23. .. rst-class:: classref-reftable-group
  24. Properties
  25. ----------
  26. .. table::
  27. :widths: auto
  28. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  29. | :ref:`String<class_String>` | :ref:`cancel_button_text<class_ConfirmationDialog_property_cancel_button_text>` | ``"Cancel"`` |
  30. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  31. | :ref:`Vector2i<class_Vector2i>` | min_size | ``Vector2i(200, 70)`` (overrides :ref:`Window<class_Window_property_min_size>`) |
  32. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  33. | :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(200, 100)`` (overrides :ref:`Window<class_Window_property_size>`) |
  34. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  35. | :ref:`String<class_String>` | title | ``"Please Confirm..."`` (overrides :ref:`Window<class_Window_property_title>`) |
  36. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-----------------------------+-----------------------------------------------------------------------------------+
  43. | :ref:`Button<class_Button>` | :ref:`get_cancel_button<class_ConfirmationDialog_method_get_cancel_button>`\ (\ ) |
  44. +-----------------------------+-----------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_ConfirmationDialog_property_cancel_button_text:
  51. .. rst-class:: classref-property
  52. :ref:`String<class_String>` **cancel_button_text** = ``"Cancel"`` :ref:`🔗<class_ConfirmationDialog_property_cancel_button_text>`
  53. .. rst-class:: classref-property-setget
  54. - |void| **set_cancel_button_text**\ (\ value\: :ref:`String<class_String>`\ )
  55. - :ref:`String<class_String>` **get_cancel_button_text**\ (\ )
  56. The text displayed by the cancel button (see :ref:`get_cancel_button()<class_ConfirmationDialog_method_get_cancel_button>`).
  57. .. rst-class:: classref-section-separator
  58. ----
  59. .. rst-class:: classref-descriptions-group
  60. Method Descriptions
  61. -------------------
  62. .. _class_ConfirmationDialog_method_get_cancel_button:
  63. .. rst-class:: classref-method
  64. :ref:`Button<class_Button>` **get_cancel_button**\ (\ ) :ref:`🔗<class_ConfirmationDialog_method_get_cancel_button>`
  65. Returns the cancel button.
  66. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  67. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  68. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  69. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  70. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  71. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  73. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  74. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  75. .. |void| replace:: :abbr:`void (No return value.)`