Skip to content
0.2.0-dev Download ZIP
38 lines ·2.1 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="ConfirmationDialog" inherits="AcceptDialog" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A dialog used for confirmation of actions.
5 </brief_description>
6 <description>
7 A dialog used for confirmation of actions. This window is similar to [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.
8 [b]Note:[/b] The dialog controls the size of its buttons, any manual size changes will be overridden. Use the [theme_item AcceptDialog.buttons_min_width] and [theme_item AcceptDialog.buttons_min_height] theme constants instead.
9 To get cancel action, you can use:
10 [codeblocks]
11 [gdscript]
12 get_cancel_button().pressed.connect(_on_canceled)
13 [/gdscript]
14 [csharp]
15 GetCancelButton().Pressed += OnCanceled;
16 [/csharp]
17 [/codeblocks]
18 [b]Note:[/b] [AcceptDialog] is invisible by default. To make it visible, call one of the [code]popup_*[/code] methods from [Window] on the node, such as [method Window.popup_centered_clamped].
19 </description>
20 <tutorials>
21 </tutorials>
22 <methods>
23 <method name="get_cancel_button">
24 <return type="Button" />
25 <description>
26 Returns the cancel button.
27 [b]Warning:[/b] 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 [member CanvasItem.visible] property.
28 </description>
29 </method>
30 </methods>
31 <members>
32 <member name="cancel_button_text" type="String" setter="set_cancel_button_text" getter="get_cancel_button_text" default="&quot;Cancel&quot;">
33 The text displayed by the cancel button (see [method get_cancel_button]).
34 </member>
35 <member name="min_size" type="Vector2i" setter="set_min_size" getter="get_min_size" overrides="Window" default="Vector2i(200, 70)" />
36 <member name="size" type="Vector2i" setter="set_size" getter="get_size" overrides="Window" default="Vector2i(200, 100)" />
37 </members>
38</class>