mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
116 lines
5.4 KiB
ReStructuredText
116 lines
5.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_ConfirmationDialog:
|
|
|
|
ConfirmationDialog
|
|
==================
|
|
|
|
**繼承:** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**被繼承:** :ref:`EditorCommandPalette<class_EditorCommandPalette>`, :ref:`EditorFileDialog<class_EditorFileDialog>`, :ref:`FileDialog<class_FileDialog>`, :ref:`ScriptCreateDialog<class_ScriptCreateDialog>`
|
|
|
|
用於確認動作的對話方塊。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
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.
|
|
|
|
To get cancel action, you can use:
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
get_cancel_button().pressed.connect(_on_canceled)
|
|
|
|
.. code-tab:: csharp
|
|
|
|
GetCancelButton().Pressed += OnCanceled;
|
|
|
|
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | :ref:`cancel_button_text<class_ConfirmationDialog_property_cancel_button_text>` | ``"Cancel"`` |
|
|
+---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | min_size | ``Vector2i(200, 70)`` (overrides :ref:`Window<class_Window_property_min_size>`) |
|
|
+---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
|
|
| :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(200, 100)`` (overrides :ref:`Window<class_Window_property_size>`) |
|
|
+---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
|
|
| :ref:`String<class_String>` | title | ``"Please Confirm..."`` (overrides :ref:`Window<class_Window_property_title>`) |
|
|
+---------------------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
方法
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------+-----------------------------------------------------------------------------------+
|
|
| :ref:`Button<class_Button>` | :ref:`get_cancel_button<class_ConfirmationDialog_method_get_cancel_button>`\ (\ ) |
|
|
+-----------------------------+-----------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_ConfirmationDialog_property_cancel_button_text:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`String<class_String>` **cancel_button_text** = ``"Cancel"`` :ref:`🔗<class_ConfirmationDialog_property_cancel_button_text>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_cancel_button_text**\ (\ value\: :ref:`String<class_String>`\ )
|
|
- :ref:`String<class_String>` **get_cancel_button_text**\ (\ )
|
|
|
|
取消按鈕顯示的文字(見 :ref:`get_cancel_button()<class_ConfirmationDialog_method_get_cancel_button>`\ )。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法說明
|
|
--------
|
|
|
|
.. _class_ConfirmationDialog_method_get_cancel_button:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Button<class_Button>` **get_cancel_button**\ (\ ) :ref:`🔗<class_ConfirmationDialog_method_get_cancel_button>`
|
|
|
|
返回取消按鈕。
|
|
|
|
\ **警告:**\ 這是一個必需的內部節點,移除並釋放它可能會導致當機。如果你希望隱藏它或其任何子項,請使用其 :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` 屬性。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
|
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
|
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
|
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
|
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
|
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
|
.. |void| replace:: :abbr:`void (無回傳值。)`
|