From 5c61e17c103f4f9fc391b2152fdf3dad0f44bd00 Mon Sep 17 00:00:00 2001 From: Geequlim Date: Fri, 29 Apr 2016 16:34:07 +0800 Subject: [PATCH] Add more documentations and fix AcceptDialog::add_cancel --- doc/base/classes.xml | 14 ++++++++++++++ scene/gui/dialogs.cpp | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/base/classes.xml b/doc/base/classes.xml index a71b897e8c9..d9075fcb2b6 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2041,6 +2041,8 @@ + 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. @@ -2049,6 +2051,7 @@ + Add custom cancel button to the dialog and return the created button. @@ -2202,6 +2205,7 @@ + Emmited when frame is changed. @@ -5434,12 +5438,14 @@ + Called when button is pressed. + Called when button is toggled (only if toggle_mode is active). @@ -5460,6 +5466,7 @@ + Return true if mouse entered the button before it exit. @@ -5515,6 +5522,7 @@ + This signal is emitted when the button was released. @@ -5532,12 +5540,16 @@ + The normal state(Are not pressed, not hovered, not toggled and enabled) of buttons. + The state of buttons are pressed. + The state of buttons are hovered. + The state of buttons are disabled. @@ -7801,6 +7813,7 @@ + Return a new color blended with anothor one. @@ -12372,6 +12385,7 @@ Returns an empty String "" at the end of the list. + Should put children to the top left corner instead of center of the container. diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index d00dacd2563..51242d89bdc 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -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; }