Author: mordante
Date: Mon Jan 11 21:09:33 2010
New Revision: 40665
URL: http://svn.gna.org/viewcvs/wesnoth?rev=40665&view=rev
Log:
Move ttoggle_button_definition to a new file.
Added:
trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp (with props)
trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp (with props)
Modified:
trunk/src/CMakeLists.txt
trunk/src/Makefile.am
trunk/src/SConscript
trunk/src/gui/widgets/settings.cpp
trunk/src/gui/widgets/settings.hpp
Modified: trunk/src/CMakeLists.txt
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/CMakeLists.txt?rev=40665&r1=40664&r2=40665&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Mon Jan 11 21:09:33 2010
@@ -242,6 +242,7 @@
gui/auxiliary/widget_definition/spacer.cpp
gui/auxiliary/widget_definition/stacked_widget.cpp
gui/auxiliary/widget_definition/text_box.cpp
+ gui/auxiliary/widget_definition/toggle_button.cpp
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
gui/auxiliary/window_builder/button.cpp
gui/auxiliary/window_builder/control.cpp
Modified: trunk/src/Makefile.am
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/Makefile.am?rev=40665&r1=40664&r2=40665&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Mon Jan 11 21:09:33 2010
@@ -122,6 +122,7 @@
gui/auxiliary/widget_definition/spacer.cpp \
gui/auxiliary/widget_definition/stacked_widget.cpp \
gui/auxiliary/widget_definition/text_box.cpp \
+ gui/auxiliary/widget_definition/toggle_button.cpp \
gui/auxiliary/widget_definition/vertical_scrollbar.cpp \
gui/auxiliary/window_builder/button.cpp \
gui/auxiliary/window_builder/control.cpp \
Modified: trunk/src/SConscript
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/SConscript?rev=40665&r1=40664&r2=40665&view=diff
==============================================================================
--- trunk/src/SConscript (original)
+++ trunk/src/SConscript Mon Jan 11 21:09:33 2010
@@ -283,6 +283,7 @@
gui/auxiliary/widget_definition/spacer.cpp
gui/auxiliary/widget_definition/stacked_widget.cpp
gui/auxiliary/widget_definition/text_box.cpp
+ gui/auxiliary/widget_definition/toggle_button.cpp
gui/auxiliary/window_builder/button.cpp
gui/auxiliary/window_builder/control.cpp
gui/auxiliary/window_builder/helper.cpp
Added: trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp?rev=40665&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp Mon Jan 11
21:09:33 2010
@@ -1,0 +1,64 @@
+/* $Id$ */
+/*
+ Copyright (C) 2007 - 2010 by Mark de Wever <[email protected]>
+ Part of the Battle for Wesnoth Project http://www.wesnoth.org/
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2
+ or at your option any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY.
+
+ See the COPYING file for more details.
+*/
+
+#define GETTEXT_DOMAIN "wesnoth-lib"
+
+#include "gui/auxiliary/widget_definition/toggle_button.hpp"
+
+#include "gui/auxiliary/log.hpp"
+
+namespace gui2 {
+
+ttoggle_button_definition::ttoggle_button_definition(const config& cfg)
+ : tcontrol_definition(cfg)
+{
+ DBG_GUI_P << "Parsing toggle button " << id << '\n';
+
+ load_resolutions<tresolution>(cfg);
+}
+
+ttoggle_button_definition::tresolution::tresolution(const config& cfg)
+ : tresolution_definition_(cfg)
+{
+/*WIKI
+ * @page = GUIWidgetDefinitionWML
+ * @order = 1_toggle_button
+ *
+ * == Toggle button ==
+ *
+ * The definition of a toggle button.
+ *
+ * The following states exist:
+ * * state_enabled, the button is enabled and not selected.
+ * * state_disabled, the button is disabled and not selected.
+ * * state_focussed, the mouse is over the button and not selected.
+ *
+ * * state_enabled_selected, the button is enabled and selected.
+ * * state_disabled_selected, the button is disabled and selected.
+ * * state_focussed_selected, the mouse is over the button and selected.
+ *
+ */
+
+ // Note the order should be the same as the enum tstate is
toggle_button.hpp.
+ state.push_back(tstate_definition(cfg.child("state_enabled")));
+ state.push_back(tstate_definition(cfg.child("state_disabled")));
+ state.push_back(tstate_definition(cfg.child("state_focussed")));
+
+ state.push_back(tstate_definition(cfg.child("state_enabled_selected")));
+
state.push_back(tstate_definition(cfg.child("state_disabled_selected")));
+
state.push_back(tstate_definition(cfg.child("state_focussed_selected")));
+}
+
+} // namespace gui2
+
Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_button.cpp
------------------------------------------------------------------------------
svn:keywords = r"Author Date Id Revision"
Added: trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp?rev=40665&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp Mon Jan 11
21:09:33 2010
@@ -1,0 +1,37 @@
+/* $Id$ */
+/*
+ Copyright (C) 2007 - 2010 by Mark de Wever <[email protected]>
+ Part of the Battle for Wesnoth Project http://www.wesnoth.org/
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2
+ or at your option any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY.
+
+ See the COPYING file for more details.
+*/
+
+#ifndef GUI_AUXILIARY_WIDGET_DEFINITION_TOGGLE_BUTTON_HPP_INCLUDED
+#define GUI_AUXILIARY_WIDGET_DEFINITION_TOGGLE_BUTTON_HPP_INCLUDED
+
+#include "gui/auxiliary/widget_definition.hpp"
+
+namespace gui2 {
+
+struct ttoggle_button_definition
+ : public tcontrol_definition
+{
+ explicit ttoggle_button_definition(const config& cfg);
+
+ struct tresolution
+ : public tresolution_definition_
+ {
+ explicit tresolution(const config& cfg);
+ };
+};
+
+} // namespace gui2
+
+#endif
+
Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_button.hpp
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: trunk/src/gui/widgets/settings.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.cpp?rev=40665&r1=40664&r2=40665&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Mon Jan 11 21:09:33 2010
@@ -41,6 +41,7 @@
#include "gui/auxiliary/widget_definition/spacer.hpp"
#include "gui/auxiliary/widget_definition/stacked_widget.hpp"
#include "gui/auxiliary/widget_definition/text_box.hpp"
+#include "gui/auxiliary/widget_definition/toggle_button.hpp"
#include "gui/auxiliary/widget_definition/vertical_scrollbar.hpp"
#include "gui/widgets/window.hpp"
#include "serialization/parser.hpp"
@@ -457,46 +458,6 @@
canvas.set_cfg(draw);
}
-ttoggle_button_definition::ttoggle_button_definition(const config& cfg) :
- tcontrol_definition(cfg)
-{
- DBG_GUI_P << "Parsing toggle button " << id << '\n';
-
- load_resolutions<tresolution>(cfg);
-}
-
-ttoggle_button_definition::tresolution::tresolution(const config& cfg) :
- tresolution_definition_(cfg)
-{
-/*WIKI
- * @page = GUIWidgetDefinitionWML
- * @order = 1_toggle_button
- *
- * == Toggle button ==
- *
- * The definition of a toggle button.
- *
- * The following states exist:
- * * state_enabled, the button is enabled and not selected.
- * * state_disabled, the button is disabled and not selected.
- * * state_focussed, the mouse is over the button and not selected.
- *
- * * state_enabled_selected, the button is enabled and selected.
- * * state_disabled_selected, the button is disabled and selected.
- * * state_focussed_selected, the mouse is over the button and selected.
- *
- */
-
- // Note the order should be the same as the enum tstate is
toggle_button.hpp.
- state.push_back(tstate_definition(cfg.child("state_enabled")));
- state.push_back(tstate_definition(cfg.child("state_disabled")));
- state.push_back(tstate_definition(cfg.child("state_focussed")));
-
- state.push_back(tstate_definition(cfg.child("state_enabled_selected")));
-
state.push_back(tstate_definition(cfg.child("state_disabled_selected")));
-
state.push_back(tstate_definition(cfg.child("state_focussed_selected")));
-}
-
ttoggle_panel_definition::ttoggle_panel_definition(const config& cfg) :
tcontrol_definition(cfg)
{
Modified: trunk/src/gui/widgets/settings.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.hpp?rev=40665&r1=40664&r2=40665&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.hpp (original)
+++ trunk/src/gui/widgets/settings.hpp Mon Jan 11 21:09:33 2010
@@ -86,16 +86,6 @@
const std::string& get_id(const twindow_type window_type);
-struct ttoggle_button_definition : public tcontrol_definition
-{
- ttoggle_button_definition(const config& cfg);
-
- struct tresolution : public tresolution_definition_
- {
- tresolution(const config& cfg);
- };
-};
-
struct ttoggle_panel_definition : public tcontrol_definition
{
ttoggle_panel_definition(const config& cfg);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits