From 5365ae921220e6333cdd643ba2da44cdb3c32d4b 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 (cherry picked from commit 5c61e17c103f4f9fc391b2152fdf3dad0f44bd00) --- 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 a3a03e39c06..c0474c3e2f0 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2039,6 +2039,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. @@ -2047,6 +2049,7 @@ + Add custom cancel button to the dialog and return the created button. @@ -2200,6 +2203,7 @@ + Emmited when frame is changed. @@ -5324,12 +5328,14 @@ + Called when button is pressed. + Called when button is toggled (only if toggle_mode is active). @@ -5350,6 +5356,7 @@ + Return true if mouse entered the button before it exit. @@ -5405,6 +5412,7 @@ + This signal is emitted when the button was released. @@ -5422,12 +5430,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. @@ -7691,6 +7703,7 @@ + Return a new color blended with anothor one. @@ -11577,6 +11590,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; }