00001 /* $Id: scrollbar_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/scrollbar_panel.hpp" 00019 00020 #include "gettext.hpp" 00021 #include "gui/auxiliary/log.hpp" 00022 #include "wml_exception.hpp" 00023 00024 namespace gui2 { 00025 00026 tscrollbar_panel_definition::tscrollbar_panel_definition(const config& cfg) 00027 : tcontrol_definition(cfg) 00028 { 00029 DBG_GUI_P << "Parsing scrollbar panel " << id << '\n'; 00030 00031 load_resolutions<tresolution>(cfg); 00032 } 00033 00034 tscrollbar_panel_definition::tresolution::tresolution(const config& cfg) 00035 : tresolution_definition_(cfg) 00036 , grid() 00037 { 00038 /*WIKI 00039 * @page = GUIWidgetDefinitionWML 00040 * @order = 1_scrollbar_panel 00041 * 00042 * == Scrollbar panel == 00043 * 00044 * @begin{parent}{name="gui/"} 00045 * @begin{tag}{name="scrollbar_panel_definition"}{min=0}{max=-1}{super="generic/widget_definition"} 00046 * @begin{tag}{name="resolution"}{min=0}{max=-1}{super="gui/window_definition/resolution"} 00047 * The definition of a panel with scrollbars. A panel is a container holding 00048 * other elements in its grid. A panel is always enabled and can't be 00049 * disabled. Instead it uses the states as layers to draw on. 00050 * 00051 * @begin{table}{config} 00052 * grid & grid & & A grid containing the widgets for main 00053 * widget. $ 00054 * @end{table} 00055 * The following layers exist: 00056 * * background, the background of the panel. 00057 * * foreground, the foreground of the panel. 00058 * 00059 * @end{tag}{name="resolution"} 00060 * @end{tag}{name="scrollbar_panel_definition"} 00061 * @end{parent}{name="gui/"} 00062 */ 00063 // The panel needs to know the order. 00064 state.push_back(tstate_definition(cfg.child("background"))); 00065 state.push_back(tstate_definition(cfg.child("foreground"))); 00066 00067 const config &child = cfg.child("grid"); 00068 VALIDATE(child, _("No grid defined.")); 00069 00070 grid = new tbuilder_grid(child); 00071 } 00072 00073 } // namespace gui2 00074
| Generated by doxygen 1.7.1 on Wed May 23 2012 01:02:42 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |