Add more documentations and fix AcceptDialog::add_cancel

(cherry picked from commit 5c61e17c10)
This commit is contained in:
Geequlim 2016-04-29 16:34:07 +08:00 committed by Rémi Verschelde
parent a3fd381a4f
commit 5365ae9212
2 changed files with 15 additions and 1 deletions

View File

@ -2039,6 +2039,8 @@
<argument index="2" name="action" type="String" default="&quot;&quot;">
</argument>
<description>
Add custom button to the dialog and return the created button.
The button titled with [i]text[/i] and the [i]action[/i] will be passed to [custom_action] signal when it is pressed.
</description>
</method>
<method name="add_cancel">
@ -2047,6 +2049,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
Add custom cancel button to the dialog and return the created button.
</description>
</method>
<method name="register_text_enter">
@ -2200,6 +2203,7 @@
<signals>
<signal name="frame_changed">
<description>
Emmited when frame is changed.
</description>
</signal>
</signals>
@ -5324,12 +5328,14 @@
<methods>
<method name="_pressed" qualifiers="virtual">
<description>
Called when button is pressed.
</description>
</method>
<method name="_toggled" qualifiers="virtual">
<argument index="0" name="pressed" type="bool">
</argument>
<description>
Called when button is toggled (only if toggle_mode is active).
</description>
</method>
<method name="set_pressed">
@ -5350,6 +5356,7 @@
<return type="bool">
</return>
<description>
Return true if mouse entered the button before it exit.
</description>
</method>
<method name="set_toggle_mode">
@ -5405,6 +5412,7 @@
<signals>
<signal name="released">
<description>
This signal is emitted when the button was released.
</description>
</signal>
<signal name="toggled">
@ -5422,12 +5430,16 @@
</signals>
<constants>
<constant name="DRAW_NORMAL" value="0">
The normal state(Are not pressed, not hovered, not toggled and enabled) of buttons.
</constant>
<constant name="DRAW_PRESSED" value="1">
The state of buttons are pressed.
</constant>
<constant name="DRAW_HOVER" value="2">
The state of buttons are hovered.
</constant>
<constant name="DRAW_DISABLED" value="3">
The state of buttons are disabled.
</constant>
</constants>
</class>
@ -7691,6 +7703,7 @@
<argument index="0" name="over" type="Color">
</argument>
<description>
Return a new color blended with anothor one.
</description>
</method>
<method name="contrasted">
@ -11577,6 +11590,7 @@ Returns an empty String "" at the end of the list.
<return type="bool">
</return>
<description>
Should put children to the top left corner instead of center of the container.
</description>
</method>
</methods>

View File

@ -285,7 +285,7 @@ Button* AcceptDialog::add_cancel(const String &p_cancel) {
String c = p_cancel;
if (p_cancel=="")
c="Cancel";
Button *b = swap_ok_cancel ? add_button("Cancel",true) : add_button("Cancel");
Button *b = swap_ok_cancel ? add_button(c,true) : add_button(c);
b->connect("pressed",this,"_closed");
return b;
}