Author: mordante
Date: Mon Jan 11 20:58:59 2010
New Revision: 40664

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

Added:
    trunk/src/gui/auxiliary/widget_definition/text_box.cpp   (with props)
    trunk/src/gui/auxiliary/widget_definition/text_box.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/text_box.cpp

Modified: trunk/po/wesnoth-lib/POTFILES.in
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/po/wesnoth-lib/POTFILES.in?rev=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/po/wesnoth-lib/POTFILES.in (original)
+++ trunk/po/wesnoth-lib/POTFILES.in Mon Jan 11 20:58:59 2010
@@ -25,6 +25,7 @@
 src/gui/auxiliary/widget_definition/slider.cpp
 src/gui/auxiliary/widget_definition/spacer.cpp
 src/gui/auxiliary/widget_definition/stacked_widget.cpp
+src/gui/auxiliary/widget_definition/text_box.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=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/CMakeLists.txt (original)
+++ trunk/src/CMakeLists.txt Mon Jan 11 20:58:59 2010
@@ -241,6 +241,7 @@
     gui/auxiliary/widget_definition/slider.cpp
     gui/auxiliary/widget_definition/spacer.cpp
     gui/auxiliary/widget_definition/stacked_widget.cpp
+    gui/auxiliary/widget_definition/text_box.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=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Mon Jan 11 20:58:59 2010
@@ -121,6 +121,7 @@
        gui/auxiliary/widget_definition/slider.cpp \
        gui/auxiliary/widget_definition/spacer.cpp \
        gui/auxiliary/widget_definition/stacked_widget.cpp \
+       gui/auxiliary/widget_definition/text_box.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=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/SConscript (original)
+++ trunk/src/SConscript Mon Jan 11 20:58:59 2010
@@ -282,6 +282,7 @@
     gui/auxiliary/widget_definition/slider.cpp
     gui/auxiliary/widget_definition/spacer.cpp
     gui/auxiliary/widget_definition/stacked_widget.cpp
+    gui/auxiliary/widget_definition/text_box.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/text_box.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/text_box.cpp?rev=40664&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/text_box.cpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/text_box.cpp Mon Jan 11 20:58:59 
2010
@@ -1,0 +1,69 @@
+/* $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/text_box.hpp"
+
+#include "gui/auxiliary/log.hpp"
+
+namespace gui2 {
+
+ttext_box_definition::ttext_box_definition(const config& cfg) :
+       tcontrol_definition(cfg)
+{
+       DBG_GUI_P << "Parsing text_box " << id << '\n';
+
+       load_resolutions<tresolution>(cfg);
+}
+
+ttext_box_definition::tresolution::tresolution(const config& cfg) :
+       tresolution_definition_(cfg),
+       text_x_offset(cfg["text_x_offset"]),
+       text_y_offset(cfg["text_y_offset"])
+{
+/*WIKI
+ * @page = GUIWidgetDefinitionWML
+ * @order = 1_text_box
+ *
+ * == Text box ==
+ *
+ * The definition of a text box.
+ *
+ * The resolution for a text box also contains the following keys:
+ * @start_table = config
+ *     text_x_offset (f_unsigned = "") The x offset of the text in the text
+ *                                     box. This is needed for the code to
+ *                                     determine where in the text the mouse
+ *                                     clicks, so it can set the cursor
+ *                                     properly.
+ *     text_y_offset (f_unsigned = "") The y offset of the text in the text
+ *                                     box.
+ * @end_table
+ *
+ * The following states exist:
+ * * state_enabled, the text box is enabled.
+ * * state_disabled, the text box is disabled.
+ * * state_focussed, the text box has the focus of the keyboard.
+ *
+ */
+
+       // Note the order should be the same as the enum tstate is text_box.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")));
+}
+
+} // namespace gui2
+

Propchange: trunk/src/gui/auxiliary/widget_definition/text_box.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: trunk/src/gui/auxiliary/widget_definition/text_box.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/auxiliary/widget_definition/text_box.hpp?rev=40664&view=auto
==============================================================================
--- trunk/src/gui/auxiliary/widget_definition/text_box.hpp (added)
+++ trunk/src/gui/auxiliary/widget_definition/text_box.hpp Mon Jan 11 20:58:59 
2010
@@ -1,0 +1,41 @@
+/* $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_TEXT_BOX_HPP_INCLUDED
+#define GUI_AUXILIARY_WIDGET_DEFINITION_TEXT_BOX_HPP_INCLUDED
+
+#include "gui/auxiliary/formula.hpp"
+#include "gui/auxiliary/widget_definition.hpp"
+
+namespace gui2 {
+
+struct ttext_box_definition
+       : public tcontrol_definition
+{
+       explicit ttext_box_definition(const config& cfg);
+
+       struct tresolution
+               : public tresolution_definition_
+       {
+               explicit tresolution(const config& cfg);
+
+               tformula<unsigned> text_x_offset;
+               tformula<unsigned> text_y_offset;
+       };
+};
+
+} // namespace gui2
+
+#endif
+

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

Propchange: trunk/src/gui/auxiliary/widget_definition/text_box.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=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Mon Jan 11 20:58:59 2010
@@ -40,6 +40,7 @@
 #include "gui/auxiliary/widget_definition/slider.hpp"
 #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/vertical_scrollbar.hpp"
 #include "gui/widgets/window.hpp"
 #include "serialization/parser.hpp"
@@ -456,51 +457,6 @@
        canvas.set_cfg(draw);
 }
 
-ttext_box_definition::ttext_box_definition(const config& cfg) :
-       tcontrol_definition(cfg)
-{
-       DBG_GUI_P << "Parsing text_box " << id << '\n';
-
-       load_resolutions<tresolution>(cfg);
-}
-
-ttext_box_definition::tresolution::tresolution(const config& cfg) :
-       tresolution_definition_(cfg),
-       text_x_offset(cfg["text_x_offset"]),
-       text_y_offset(cfg["text_y_offset"])
-{
-/*WIKI
- * @page = GUIWidgetDefinitionWML
- * @order = 1_text_box
- *
- * == Text box ==
- *
- * The definition of a text box.
- *
- * The resolution for a text box also contains the following keys:
- * @start_table = config
- *     text_x_offset (f_unsigned = "") The x offset of the text in the text
- *                                     box. This is needed for the code to
- *                                     determine where in the text the mouse
- *                                     clicks, so it can set the cursor
- *                                     properly.
- *     text_y_offset (f_unsigned = "") The y offset of the text in the text
- *                                     box.
- * @end_table
- *
- * The following states exist:
- * * state_enabled, the text box is enabled.
- * * state_disabled, the text box is disabled.
- * * state_focussed, the text box has the focus of the keyboard.
- *
- */
-
-       // Note the order should be the same as the enum tstate is text_box.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")));
-}
-
 ttoggle_button_definition::ttoggle_button_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=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.hpp (original)
+++ trunk/src/gui/widgets/settings.hpp Mon Jan 11 20:58:59 2010
@@ -86,21 +86,6 @@
 
 const std::string& get_id(const twindow_type window_type);
 
-struct ttext_box_definition : public tcontrol_definition
-{
-
-       ttext_box_definition(const config& cfg);
-
-       struct tresolution : public tresolution_definition_
-       {
-               tresolution(const config& cfg);
-
-               tformula<unsigned> text_x_offset;
-               tformula<unsigned> text_y_offset;
-       };
-
-};
-
 struct ttoggle_button_definition : public tcontrol_definition
 {
        ttoggle_button_definition(const config& cfg);

Modified: trunk/src/gui/widgets/text_box.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text_box.cpp?rev=40664&r1=40663&r2=40664&view=diff
==============================================================================
--- trunk/src/gui/widgets/text_box.cpp (original)
+++ trunk/src/gui/widgets/text_box.cpp Mon Jan 11 20:58:59 2010
@@ -19,6 +19,7 @@
 #include "font.hpp"
 #include "foreach.hpp"
 #include "gui/auxiliary/log.hpp"
+#include "gui/auxiliary/widget_definition/text_box.hpp"
 #include "gui/widgets/window.hpp"
 #include "game_preferences.hpp"
 


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

Reply via email to