Move twindow_definition to a new file.
This commit is contained in:
parent
80e6944dad
commit
e948226de7
8 changed files with 101 additions and 47 deletions
|
@ -30,6 +30,7 @@ src/gui/auxiliary/widget_definition/toggle_button.cpp
|
|||
src/gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||
src/gui/auxiliary/widget_definition/tooltip.cpp
|
||||
src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
src/gui/auxiliary/widget_definition/window.cpp
|
||||
src/gui/auxiliary/window_builder/button.cpp
|
||||
src/gui/auxiliary/window_builder/control.cpp
|
||||
src/gui/auxiliary/window_builder.cpp
|
||||
|
|
|
@ -246,6 +246,7 @@ set(wesnoth-main_SRC
|
|||
gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||
gui/auxiliary/widget_definition/tooltip.cpp
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
gui/auxiliary/widget_definition/window.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
gui/auxiliary/window_builder/helper.cpp
|
||||
|
|
|
@ -126,6 +126,7 @@ wesnoth_source = \
|
|||
gui/auxiliary/widget_definition/toggle_panel.cpp \
|
||||
gui/auxiliary/widget_definition/tooltip.cpp \
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp \
|
||||
gui/auxiliary/widget_definition/window.cpp \
|
||||
gui/auxiliary/window_builder/button.cpp \
|
||||
gui/auxiliary/window_builder/control.cpp \
|
||||
gui/auxiliary/window_builder/helper.cpp \
|
||||
|
|
|
@ -286,6 +286,7 @@ wesnoth_sources = Split("""
|
|||
gui/auxiliary/widget_definition/toggle_button.cpp
|
||||
gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||
gui/auxiliary/widget_definition/tooltip.cpp
|
||||
gui/auxiliary/widget_definition/window.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
gui/auxiliary/window_builder/helper.cpp
|
||||
|
|
56
src/gui/auxiliary/widget_definition/window.cpp
Normal file
56
src/gui/auxiliary/widget_definition/window.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2007 - 2010 by Mark de Wever <koraq@xs4all.nl>
|
||||
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/window.hpp"
|
||||
|
||||
#include "gui/auxiliary/log.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
twindow_definition::twindow_definition(const config& cfg)
|
||||
: tcontrol_definition(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_window
|
||||
*
|
||||
* == Window ==
|
||||
*
|
||||
* The definition of a window. A window is a kind of panel see the panel for
|
||||
* which fields exist
|
||||
*
|
||||
*/
|
||||
|
||||
DBG_GUI_P << "Parsing window " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
twindow_definition::tresolution::tresolution(const config& cfg)
|
||||
: tpanel_definition::tresolution(cfg)
|
||||
, grid(NULL)
|
||||
{
|
||||
const config &child = cfg.child("grid");
|
||||
// VALIDATE(child, _("No grid defined."));
|
||||
|
||||
/** @todo Evaluate whether the grid should become mandatory. */
|
||||
if(child) {
|
||||
grid = new tbuilder_grid(child);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
40
src/gui/auxiliary/widget_definition/window.hpp
Normal file
40
src/gui/auxiliary/widget_definition/window.hpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2007 - 2010 by Mark de Wever <koraq@xs4all.nl>
|
||||
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_WINDOW_HPP_INCLUDED
|
||||
#define GUI_AUXILIARY_WIDGET_DEFINITION_WINDOW_HPP_INCLUDED
|
||||
|
||||
#include "gui/auxiliary/widget_definition/panel.hpp"
|
||||
#include "gui/auxiliary/window_builder.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
struct twindow_definition
|
||||
: public tcontrol_definition
|
||||
{
|
||||
explicit twindow_definition(const config& cfg);
|
||||
|
||||
struct tresolution
|
||||
: public tpanel_definition::tresolution
|
||||
{
|
||||
explicit tresolution(const config& cfg);
|
||||
|
||||
tbuilder_grid_ptr grid;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
#endif
|
||||
|
|
@ -460,38 +460,6 @@ tstate_definition::tstate_definition(const config &cfg) :
|
|||
canvas.set_cfg(draw);
|
||||
}
|
||||
|
||||
twindow_definition::twindow_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_window
|
||||
*
|
||||
* == Window ==
|
||||
*
|
||||
* The definition of a window. A window is a kind of panel see the panel for
|
||||
* which fields exist
|
||||
*
|
||||
*/
|
||||
|
||||
DBG_GUI_P << "Parsing window " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
twindow_definition::tresolution::tresolution(const config& cfg)
|
||||
: tpanel_definition::tresolution(cfg)
|
||||
, grid(NULL)
|
||||
{
|
||||
const config &child = cfg.child("grid");
|
||||
// VALIDATE(child, _("No grid defined."));
|
||||
|
||||
/** @todo Evaluate whether the grid should become mandatory. */
|
||||
if(child) {
|
||||
grid = new tbuilder_grid(child);
|
||||
}
|
||||
}
|
||||
|
||||
tresolution_definition_ptr get_control(
|
||||
const std::string& control_type, const std::string& definition)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "gui/auxiliary/formula.hpp"
|
||||
#include "gui/auxiliary/widget_definition.hpp"
|
||||
#include "gui/auxiliary/widget_definition/panel.hpp"
|
||||
#include "gui/auxiliary/widget_definition/window.hpp"
|
||||
#include "gui/auxiliary/window_builder.hpp"
|
||||
#include "tstring.hpp"
|
||||
|
||||
|
@ -86,20 +86,6 @@ enum twindow_type {
|
|||
|
||||
const std::string& get_id(const twindow_type window_type);
|
||||
|
||||
struct twindow_definition
|
||||
: public tcontrol_definition
|
||||
{
|
||||
twindow_definition(const config& cfg);
|
||||
|
||||
struct tresolution
|
||||
: public tpanel_definition::tresolution
|
||||
{
|
||||
tresolution(const config& cfg);
|
||||
|
||||
tbuilder_grid_ptr grid;
|
||||
};
|
||||
};
|
||||
|
||||
struct tgui_definition
|
||||
{
|
||||
tgui_definition()
|
||||
|
|
Loading…
Add table
Reference in a new issue