class_confirmationdialog.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  28. | :ref:`String<class_String>` | :ref:`cancel_button_text<class_ConfirmationDialog_property_cancel_button_text>` | ``"Cancel"`` |
  29. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  30. | :ref:`Vector2i<class_Vector2i>` | min_size | ``Vector2i(200, 70)`` (overrides :ref:`Window<class_Window_property_min_size>`) |
  31. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  32. | :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(200, 100)`` (overrides :ref:`Window<class_Window_property_size>`) |
  33. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  34. | :ref:`String<class_String>` | title | ``"Please Confirm..."`` (overrides :ref:`Window<class_Window_property_title>`) |
  35. +---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
  36. .. rst-class:: classref-reftable-group
  37. Methods
  38. -------
  39. .. table::
  40. :widths: auto
  41. +-----------------------------+-----------------------------------------------------------------------------------+
  42. | :ref:`Button<class_Button>` | :ref:`get_cancel_button<class_ConfirmationDialog_method_get_cancel_button>`\ (\ ) |
  43. +-----------------------------+-----------------------------------------------------------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Property Descriptions
  48. ---------------------
  49. .. _class_ConfirmationDialog_property_cancel_button_text:
  50. .. rst-class:: classref-property
  51. :ref:`String<class_String>` **cancel_button_text** = ``"Cancel"`` :ref:`🔗<class_ConfirmationDialog_property_cancel_button_text>`
  52. .. rst-class:: classref-property-setget
  53. - |void| **set_cancel_button_text**\ (\ value\: :ref:`String<class_String>`\ )
  54. - :ref:`String<class_String>` **get_cancel_button_text**\ (\ )
  55. The text displayed by the cancel button (see :ref:`get_cancel_button<class_ConfirmationDialog_method_get_cancel_button>`).
  56. .. rst-class:: classref-section-separator
  57. ----
  58. .. rst-class:: classref-descriptions-group
  59. Method Descriptions
  60. -------------------
  61. .. _class_ConfirmationDialog_method_get_cancel_button:
  62. .. rst-class:: classref-method
  63. :ref:`Button<class_Button>` **get_cancel_button**\ (\ ) :ref:`🔗<class_ConfirmationDialog_method_get_cancel_button>`
  64. Returns the cancel button.
  65. \ **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.
  66. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  67. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  68. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  69. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  70. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  71. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  72. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  73. .. |void| replace:: :abbr:`void (No return value.)`