gui/auxiliary/widget_definition/tree_view.cpp

Go to the documentation of this file.
00001 /* $Id: tree_view.cpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2010 - 2012 by Mark de Wever <koraq@xs4all.nl>
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/auxiliary/widget_definition/tree_view.hpp"
00019 
00020 #include "gettext.hpp"
00021 #include "gui/auxiliary/log.hpp"
00022 #include "wml_exception.hpp"
00023 
00024 namespace gui2 {
00025 
00026 ttree_view_definition::ttree_view_definition(const config& cfg)
00027     : tcontrol_definition(cfg)
00028 {
00029     DBG_GUI_P << "Parsing tree view " << id << '\n';
00030 
00031     load_resolutions<tresolution>(cfg);
00032 }
00033 
00034 ttree_view_definition::tresolution::tresolution(const config& cfg)
00035     : tresolution_definition_(cfg)
00036     , grid(NULL)
00037 {
00038 /*WIKI
00039  * @page = GUIWidgetDefinitionWML
00040  * @order = 1_tree_view
00041  *
00042  * == Tree view ==
00043  *
00044  * @macro = tree_view_description
00045  *
00046  * The documentation is not written yet.
00047  *
00048  * The following states exist:
00049  * * state_enabled, the listbox is enabled.
00050  * * state_disabled, the listbox is disabled.
00051  * @begin{parent}{name="gui/"}
00052  * @begin{tag}{name="tree_view_definition"}{min=0}{max=-1}{super="generic/widget_definition"}
00053  * @begin{tag}{name="resolution"}{min=0}{max=-1}{super="generic/widget_definition/resolution"}
00054  * @allow{link}{name="gui/window/resolution/grid"}
00055  * @begin{tag}{name="state_enabled"}{min=0}{max=1}{super="generic/state"}
00056  * @end{tag}{name="state_enabled"}
00057  * @begin{tag}{name="state_disabled"}{min=0}{max=1}{super="generic/state"}
00058  * @end{tag}{name="state_disabled"}
00059  * @end{tag}{name="resolution"}
00060  * @end{tag}{name="tree_view_definition"}
00061  * @end{parent}{name="gui/"}
00062  */
00063 
00064     // Note the order should be the same as the enum tstate is listbox.hpp.
00065     state.push_back(tstate_definition(cfg.child("state_enabled")));
00066     state.push_back(tstate_definition(cfg.child("state_disabled")));
00067 
00068     const config &child = cfg.child("grid");
00069     VALIDATE(child, _("No grid defined."));
00070 
00071     grid = new tbuilder_grid(child);
00072 }
00073 
00074 } // namespace gui2
00075 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:42 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs