gui/auxiliary/widget_definition/label.cpp

Go to the documentation of this file.
00001 /* $Id: label.cpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2007 - 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/label.hpp"
00019 
00020 #include "gui/auxiliary/log.hpp"
00021 
00022 namespace gui2 {
00023 
00024 tlabel_definition::tlabel_definition(const config& cfg)
00025     : tcontrol_definition(cfg)
00026 {
00027     DBG_GUI_P << "Parsing label " << id << '\n';
00028 
00029     load_resolutions<tresolution>(cfg);
00030 }
00031 
00032 
00033 tlabel_definition::tresolution::tresolution(const config& cfg)
00034     : tresolution_definition_(cfg)
00035 {
00036 /*WIKI
00037  * @page = GUIWidgetDefinitionWML
00038  * @order = 1_label
00039  *
00040  * == Label ==
00041  *
00042  * @macro = label_description
00043  *
00044  * Although the label itself has no event interaction it still has two states.
00045  * The reason is that labels are often used as visual indication of the state
00046  * of the widget it labels.
00047  *
00048  * The following states exist:
00049  * * state_enabled, the label is enabled.
00050  * * state_disabled, the label is disabled.
00051  * @begin{parent}{name="gui/"}
00052  * @begin{tag}{name="label_definition"}{min=0}{max=-1}{super="generic/widget_definition"}
00053  * @begin{tag}{name="resolution"}{min=0}{max=-1}{super="generic/widget_definition/resolution"}
00054  * @begin{tag}{name="state_enabled"}{min=0}{max=1}{super="generic/state"}
00055  * @end{tag}{name="state_enabled"}
00056  * @begin{tag}{name="state_disabled"}{min=0}{max=1}{super="generic/state"}
00057  * @end{tag}{name="state_disabled"}
00058  * @end{tag}{name="resolution"}
00059  * @end{tag}{name="label_definition"}
00060  * @end{parent}{name="gui/"}
00061  */
00062     // Note the order should be the same as the enum tstate is label.hpp.
00063     state.push_back(tstate_definition(cfg.child("state_enabled")));
00064     state.push_back(tstate_definition(cfg.child("state_disabled")));
00065 }
00066 
00067 } // namespace gui2
00068 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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