gui/dialogs/game_save.cpp

Go to the documentation of this file.
00001 /* $Id: game_save.cpp 53587 2012-03-21 01:44:33Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2008 - 2012 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 #define GETTEXT_DOMAIN "wesnoth-lib"
00017 
00018 #include "gui/dialogs/game_save.hpp"
00019 
00020 #include "foreach.hpp"
00021 #include "gettext.hpp"
00022 #include "gui/dialogs/field.hpp"
00023 #include "gui/widgets/button.hpp"
00024 #include "gui/widgets/label.hpp"
00025 #include "gui/widgets/settings.hpp"
00026 
00027 namespace gui2 {
00028 
00029 /*WIKI
00030  * @page = GUIWindowDefinitionWML
00031  * @order = 2_game_save
00032  *
00033  * == Save a game ==
00034  *
00035  * This shows the dialog to create a savegame file.
00036  *
00037  * @begin{table}{dialog_widgets}
00038  *
00039  * lblTitle & & label & m &
00040  *         The title of the window. $
00041  *
00042  * txtFilename & & text_box & m &
00043  *         The name of the savefile. $
00044  *
00045  * @end{table}
00046  */
00047 
00048 REGISTER_DIALOG(game_save)
00049 
00050 tgame_save::tgame_save(std::string& filename, const std::string& title)
00051 {
00052     register_text("txtFilename", false, filename, true);
00053     register_label("lblTitle", true, title);
00054 }
00055 
00056 REGISTER_DIALOG(game_save_message)
00057 
00058 tgame_save_message::tgame_save_message(
00059           std::string& filename
00060         , const std::string& title
00061         , const std::string& message)
00062 {
00063     register_label("lblTitle", true, title);
00064     register_text("txtFilename", false, filename, true);
00065     register_label("lblMessage", true, message);
00066 }
00067 
00068 REGISTER_DIALOG(game_save_oos)
00069 
00070 tgame_save_oos::tgame_save_oos(
00071           bool& ignore_all
00072         , std::string& filename
00073         , const std::string& title
00074         , const std::string& message)
00075 {
00076     register_label("lblTitle", true, title);
00077     register_text("txtFilename", false, filename, true);
00078     register_label("lblMessage", true, message);
00079     register_bool("ignore_all", true, ignore_all);
00080 
00081     /* Always need the ignore_all flag. */
00082     set_always_save_fields(true);
00083 }
00084 
00085 } // namespace gui2
00086 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:58 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs