00001 /* $Id: panel.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/panel.hpp" 00019 00020 #include "gui/auxiliary/log.hpp" 00021 00022 namespace gui2 { 00023 00024 tpanel_definition::tpanel_definition(const config& cfg) 00025 : tcontrol_definition(cfg) 00026 { 00027 DBG_GUI_P << "Parsing panel " << id << '\n'; 00028 00029 load_resolutions<tresolution>(cfg); 00030 } 00031 00032 tpanel_definition::tresolution::tresolution(const config& cfg) 00033 : tresolution_definition_(cfg) 00034 , top_border(cfg["top_border"]) 00035 , bottom_border(cfg["bottom_border"]) 00036 , left_border(cfg["left_border"]) 00037 , right_border(cfg["right_border"]) 00038 { 00039 /*WIKI 00040 * @page = GUIWidgetDefinitionWML 00041 * @order = 1_panel 00042 * 00043 * == Panel == 00044 * 00045 * @macro = panel_description 00046 * 00047 * @begin{parent}{name="gui/"} 00048 * @begin{tag}{name="panel_definition"}{min=0}{max=-1}{super="generic/widget_definition"} 00049 * A panel is always enabled and can't be disabled. Instead it uses the 00050 * states as layers to draw on. 00051 * @begin{tag}{name="resolution"}{min=0}{max=-1}{super="generic/widget_definition/resolution"} 00052 * The resolution for a panel also contains the following keys: 00053 * @begin{table}{config} 00054 * top_border & unsigned & 0 & The size which isn't used for the client 00055 * area. $ 00056 * bottom_border & unsigned & 0 & The size which isn't used for the client 00057 * area. $ 00058 * left_border & unsigned & 0 & The size which isn't used for the client 00059 * area. $ 00060 * right_border & unsigned & 0 & The size which isn't used for the client 00061 * area. $ 00062 * @end{table} 00063 * 00064 * The following layers exist: 00065 * * background, the background of the panel. 00066 * * foreground, the foreground of the panel. 00067 * @begin{tag}{name="foreground"}{min=0}{max=1} 00068 * @allow{link}{name="generic/state/draw"} 00069 * @end{tag}{name="foreground"} 00070 * @begin{tag}{name="background"}{min=0}{max=1} 00071 * @allow{link}{name="generic/state/draw"} 00072 * @end{tag}{name="background"} 00073 * @end{tag}{name="resolution"} 00074 * @end{tag}{name="panel_definition"} 00075 * @end{parent}{name="gui/"} 00076 */ 00077 00078 // The panel needs to know the order. 00079 state.push_back(tstate_definition(cfg.child("background"))); 00080 state.push_back(tstate_definition(cfg.child("foreground"))); 00081 } 00082 00083 } // namespace gui2 00084
| Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:42 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |