Author: mordante
Date: Mon Jan 11 21:20:17 2010
New Revision: 40667

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40667&view=rev
Log:
Move ttoggle_panel_definition to a new file.

Added:
    trunk/src/gui/auxiliary/widget_definition/toggle_panel.cpp   (with props)
    trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp   (with props)
Modified:
    trunk/po/wesnoth-lib/POTFILES.in
    trunk/src/CMakeLists.txt
    trunk/src/Makefile.am
    trunk/src/SConscript
    trunk/src/gui/widgets/settings.cpp
    trunk/src/gui/widgets/settings.hpp
    trunk/src/gui/widgets/toggle_panel.cpp

Modified: trunk/po/wesnoth-lib/POTFILES.in
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/po/wesnoth-lib/POTFILES.in?rev=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/po/wesnoth-lib/POTFILES.in (original)
+++ trunk/po/wesnoth-lib/POTFILES.in Mon Jan 11 21:20:17 2010
@@ -27,6 +27,7 @@
 src/gui/auxiliary/widget_definition/stacked_widget.cpp
 src/gui/auxiliary/widget_definition/text_box.cpp
 src/gui/auxiliary/widget_definition/toggle_button.cpp
+src/gui/auxiliary/widget_definition/toggle_panel.cpp
 src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
 src/gui/auxiliary/window_builder/button.cpp
 src/gui/auxiliary/window_builder/control.cpp

Modified: trunk/src/CMakeLists.txt
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/CMakeLists.txt?rev=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Mon Jan 11 21:20:17 2010
@@ -243,6 +243,7 @@
     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/toggle_panel.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=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Mon Jan 11 21:20:17 2010
@@ -123,6 +123,7 @@
        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/toggle_panel.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=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/SConscript (original)
+++ trunk/src/SConscript Mon Jan 11 21:20:17 2010
@@ -284,6 +284,7 @@
     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/toggle_panel.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_panel.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/toggle_panel.cpp?rev=40667&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/toggle_panel.cpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/toggle_panel.cpp Mon Jan 11 
21:20:17 2010
@@ -1,0 +1,80 @@
+/* $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_panel.hpp"
+
+#include "gui/auxiliary/log.hpp"
+
+namespace gui2 {
+
+ttoggle_panel_definition::ttoggle_panel_definition(const config& cfg)
+       : tcontrol_definition(cfg)
+{
+       DBG_GUI_P << "Parsing toggle panel " << id << '\n';
+
+       load_resolutions<tresolution>(cfg);
+}
+
+ttoggle_panel_definition::tresolution::tresolution(const config& cfg)
+       : tresolution_definition_(cfg)
+       , top_border(lexical_cast_default<unsigned>(cfg["top_border"]))
+       , bottom_border(lexical_cast_default<unsigned>(cfg["bottom_border"]))
+       , left_border(lexical_cast_default<unsigned>(cfg["left_border"]))
+       , right_border(lexical_cast_default<unsigned>(cfg["right_border"]))
+{
+/*WIKI
+ * @page = GUIWidgetDefinitionWML
+ * @order = 1_toggle_panel
+ *
+ * == Toggle panel ==
+ *
+ * The definition of a toggle panel. A toggle panel is like a toggle button, 
but
+ * instead of being a button it's a panel. This means it can hold multiple 
child
+ * items.
+ *
+ * The resolution for a toggle panel also contains the following keys:
+ * @start_table = config
+ *     top_border (unsigned = 0)     The size which isn't used for the client 
area.
+ *     bottom_border (unsigned = 0)  The size which isn't used for the client 
area.
+ *     left_border (unsigned = 0)    The size which isn't used for the client 
area.
+ *     right_border (unsigned = 0)   The size which isn't used for the client 
area.
+ * @end_table
+ *
+ * The following layers exist:
+ *
+ * The following states exist:
+ * * state_enabled, the panel is enabled and not selected.
+ * * state_disabled, the panel is disabled and not selected.
+ * * state_focussed, the mouse is over the panel and not selected.
+ *
+ * * state_enabled_selected, the panel is enabled and selected.
+ * * state_disabled_selected, the panel is disabled and selected.
+ * * state_focussed_selected, the mouse is over the panel and selected.
+ *
+ */
+
+       // Note the order should be the same as the enum tstate is 
toggle_panel.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_panel.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_panel.cpp
------------------------------------------------------------------------------
    svn:keywords = r"Author Date Id Revision"

Added: trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp?rev=40667&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp Mon Jan 11 
21:20:17 2010
@@ -1,0 +1,43 @@
+/* $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_PANEL_HPP_INCLUDED
+#define GUI_AUXILIARY_WIDGET_DEFINITION_TOGGLE_PANEL_HPP_INCLUDED
+
+#include "gui/auxiliary/widget_definition.hpp"
+
+namespace gui2 {
+
+struct ttoggle_panel_definition
+       : public tcontrol_definition
+{
+       explicit ttoggle_panel_definition(const config& cfg);
+
+       struct tresolution
+               : public tresolution_definition_
+       {
+               explicit tresolution(const config& cfg);
+
+               unsigned top_border;
+               unsigned bottom_border;
+
+               unsigned left_border;
+               unsigned right_border;
+       };
+};
+
+} // namespace gui2
+
+#endif
+

Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_panel.hpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/src/gui/auxiliary/widget_definition/toggle_panel.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=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Mon Jan 11 21:20:17 2010
@@ -42,6 +42,7 @@
 #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/toggle_panel.hpp"
 #include "gui/auxiliary/widget_definition/vertical_scrollbar.hpp"
 #include "gui/widgets/window.hpp"
 #include "serialization/parser.hpp"
@@ -458,62 +459,6 @@
        canvas.set_cfg(draw);
 }
 
-ttoggle_panel_definition::ttoggle_panel_definition(const config& cfg) :
-       tcontrol_definition(cfg)
-{
-       DBG_GUI_P << "Parsing toggle panel " << id << '\n';
-
-       load_resolutions<tresolution>(cfg);
-}
-
-ttoggle_panel_definition::tresolution::tresolution(const config& cfg) :
-       tresolution_definition_(cfg),
-       top_border(lexical_cast_default<unsigned>(cfg["top_border"])),
-       bottom_border(lexical_cast_default<unsigned>(cfg["bottom_border"])),
-       left_border(lexical_cast_default<unsigned>(cfg["left_border"])),
-       right_border(lexical_cast_default<unsigned>(cfg["right_border"]))
-{
-/*WIKI
- * @page = GUIWidgetDefinitionWML
- * @order = 1_toggle_panel
- *
- * == Toggle panel ==
- *
- * The definition of a toggle panel. A toggle panel is like a toggle button, 
but
- * instead of being a button it's a panel. This means it can hold multiple 
child
- * items.
- *
- * The resolution for a toggle panel also contains the following keys:
- * @start_table = config
- *     top_border (unsigned = 0)     The size which isn't used for the client 
area.
- *     bottom_border (unsigned = 0)  The size which isn't used for the client 
area.
- *     left_border (unsigned = 0)    The size which isn't used for the client 
area.
- *     right_border (unsigned = 0)   The size which isn't used for the client 
area.
- * @end_table
- *
- * The following layers exist:
- *
- * The following states exist:
- * * state_enabled, the panel is enabled and not selected.
- * * state_disabled, the panel is disabled and not selected.
- * * state_focussed, the mouse is over the panel and not selected.
- *
- * * state_enabled_selected, the panel is enabled and selected.
- * * state_disabled_selected, the panel is disabled and selected.
- * * state_focussed_selected, the mouse is over the panel and selected.
- *
- */
-
-       // Note the order should be the same as the enum tstate is 
toggle_panel.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")));
-}
-
 ttooltip_definition::ttooltip_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=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.hpp (original)
+++ trunk/src/gui/widgets/settings.hpp Mon Jan 11 21:20:17 2010
@@ -86,22 +86,6 @@
 
 const std::string& get_id(const twindow_type window_type);
 
-struct ttoggle_panel_definition : public tcontrol_definition
-{
-       ttoggle_panel_definition(const config& cfg);
-
-       struct tresolution : public tresolution_definition_
-       {
-               tresolution(const config& cfg);
-
-               unsigned top_border;
-               unsigned bottom_border;
-
-               unsigned left_border;
-               unsigned right_border;
-       };
-};
-
 struct ttooltip_definition : public tcontrol_definition
 {
        ttooltip_definition(const config& cfg);

Modified: trunk/src/gui/widgets/toggle_panel.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/toggle_panel.cpp?rev=40667&r1=40666&r2=40667&view=diff
==============================================================================
--- trunk/src/gui/widgets/toggle_panel.cpp (original)
+++ trunk/src/gui/widgets/toggle_panel.cpp Mon Jan 11 21:20:17 2010
@@ -18,6 +18,7 @@
 
 #include "foreach.hpp"
 #include "gui/auxiliary/log.hpp"
+#include "gui/auxiliary/widget_definition/toggle_panel.hpp"
 #include "gui/widgets/window.hpp"
 #include "sound.hpp"
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to