class_confirmationdialog.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ConfirmationDialog.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ConfirmationDialog:
  6. ConfirmationDialog
  7. ==================
  8. **Inherits:** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`EditorCommandPalette<class_EditorCommandPalette>`, :ref:`EditorFileDialog<class_EditorFileDialog>`, :ref:`FileDialog<class_FileDialog>`, :ref:`ScriptCreateDialog<class_ScriptCreateDialog>`
  10. Dialog for confirmation of actions.
  11. Description
  12. -----------
  13. Dialog for confirmation of actions. This dialog inherits from :ref:`AcceptDialog<class_AcceptDialog>`, but has by default an OK and Cancel button (in host OS order).
  14. To get cancel action, you can use:
  15. .. tabs::
  16. .. code-tab:: gdscript
  17. get_cancel().connect("pressed", self, "cancelled")
  18. .. code-tab:: csharp
  19. GetCancel().Connect("pressed", this, nameof(Cancelled));
  20. Properties
  21. ----------
  22. +---------------------------------+----------+---------------------------------------------------------------------------------+
  23. | :ref:`Vector2i<class_Vector2i>` | min_size | ``Vector2i(200, 70)`` (overrides :ref:`Window<class_Window_property_min_size>`) |
  24. +---------------------------------+----------+---------------------------------------------------------------------------------+
  25. | :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(200, 100)`` (overrides :ref:`Window<class_Window_property_size>`) |
  26. +---------------------------------+----------+---------------------------------------------------------------------------------+
  27. | :ref:`String<class_String>` | title | ``"Please Confirm..."`` (overrides :ref:`Window<class_Window_property_title>`) |
  28. +---------------------------------+----------+---------------------------------------------------------------------------------+
  29. Methods
  30. -------
  31. +-----------------------------+-----------------------------------------------------------------------------------------+
  32. | :ref:`Button<class_Button>` | :ref:`get_cancel_button<class_ConfirmationDialog_method_get_cancel_button>` **(** **)** |
  33. +-----------------------------+-----------------------------------------------------------------------------------------+
  34. Method Descriptions
  35. -------------------
  36. .. _class_ConfirmationDialog_method_get_cancel_button:
  37. - :ref:`Button<class_Button>` **get_cancel_button** **(** **)**
  38. Returns the cancel button.
  39. \ **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.
  40. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  41. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  42. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  43. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  44. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  45. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`