Move tmenubar_definition to a new file.
This commit is contained in:
parent
f16f87feec
commit
a7f49fe205
8 changed files with 96 additions and 40 deletions
|
@ -15,6 +15,7 @@ src/gui/auxiliary/widget_definition/horizontal_scrollbar.cpp
|
|||
src/gui/auxiliary/widget_definition/image.cpp
|
||||
src/gui/auxiliary/widget_definition/label.cpp
|
||||
src/gui/auxiliary/widget_definition/listbox.cpp
|
||||
src/gui/auxiliary/widget_definition/menubar.cpp
|
||||
src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
src/gui/auxiliary/window_builder/button.cpp
|
||||
src/gui/auxiliary/window_builder/control.cpp
|
||||
|
|
|
@ -231,6 +231,7 @@ set(wesnoth-main_SRC
|
|||
gui/auxiliary/widget_definition/image.cpp
|
||||
gui/auxiliary/widget_definition/label.cpp
|
||||
gui/auxiliary/widget_definition/listbox.cpp
|
||||
gui/auxiliary/widget_definition/menubar.cpp
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
|
|
|
@ -111,6 +111,7 @@ wesnoth_source = \
|
|||
gui/auxiliary/widget_definition/image.cpp \
|
||||
gui/auxiliary/widget_definition/label.cpp \
|
||||
gui/auxiliary/widget_definition/listbox.cpp \
|
||||
gui/auxiliary/widget_definition/menubar.cpp \
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp \
|
||||
gui/auxiliary/window_builder/button.cpp \
|
||||
gui/auxiliary/window_builder/control.cpp \
|
||||
|
|
|
@ -271,6 +271,7 @@ wesnoth_sources = Split("""
|
|||
gui/auxiliary/widget_definition/image.cpp
|
||||
gui/auxiliary/widget_definition/label.cpp
|
||||
gui/auxiliary/widget_definition/listbox.cpp
|
||||
gui/auxiliary/widget_definition/menubar.cpp
|
||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||
gui/auxiliary/window_builder/button.cpp
|
||||
gui/auxiliary/window_builder/control.cpp
|
||||
|
|
53
src/gui/auxiliary/widget_definition/menubar.cpp
Normal file
53
src/gui/auxiliary/widget_definition/menubar.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
/* $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/menubar.hpp"
|
||||
|
||||
#include "gui/auxiliary/log.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
tmenubar_definition::tmenubar_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
DBG_GUI_P << "Parsing menubar " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
tmenubar_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_menubar
|
||||
*
|
||||
* == Menubar ==
|
||||
*
|
||||
* The definition of a normal menubar.
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the menubar is enabled.
|
||||
* * state_disabled, the menubar is disabled.
|
||||
*
|
||||
*/
|
||||
// Note the order should be the same as the enum tstate is menubar.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
38
src/gui/auxiliary/widget_definition/menubar.hpp
Normal file
38
src/gui/auxiliary/widget_definition/menubar.hpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/* $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_MENUBAR_HPP_INCLUDED
|
||||
#define GUI_AUXILIARY_WIDGET_DEFINITION_MENUBAR_HPP_INCLUDED
|
||||
|
||||
#include "gui/auxiliary/widget_definition.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
struct tmenubar_definition
|
||||
: public tcontrol_definition
|
||||
{
|
||||
|
||||
explicit tmenubar_definition(const config& cfg);
|
||||
|
||||
struct tresolution
|
||||
: public tresolution_definition_
|
||||
{
|
||||
explicit tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
#endif
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
#include "gui/auxiliary/widget_definition/image.hpp"
|
||||
#include "gui/auxiliary/widget_definition/label.hpp"
|
||||
#include "gui/auxiliary/widget_definition/listbox.hpp"
|
||||
#include "gui/auxiliary/widget_definition/menubar.hpp"
|
||||
#include "gui/auxiliary/widget_definition/vertical_scrollbar.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "serialization/parser.hpp"
|
||||
|
@ -446,35 +447,6 @@ tstate_definition::tstate_definition(const config &cfg) :
|
|||
canvas.set_cfg(draw);
|
||||
}
|
||||
|
||||
tmenubar_definition::tmenubar_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
DBG_GUI_P << "Parsing menubar " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
tmenubar_definition::tresolution::tresolution(const config& cfg) :
|
||||
tresolution_definition_(cfg)
|
||||
{
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_menubar
|
||||
*
|
||||
* == Menubar ==
|
||||
*
|
||||
* The definition of a normal menubar.
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the menubar is enabled.
|
||||
* * state_disabled, the menubar is disabled.
|
||||
*
|
||||
*/
|
||||
// Note the order should be the same as the enum tstate is menubar.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
}
|
||||
|
||||
tminimap_definition::tminimap_definition(const config& cfg) :
|
||||
tcontrol_definition(cfg)
|
||||
{
|
||||
|
|
|
@ -85,17 +85,6 @@ enum twindow_type {
|
|||
|
||||
const std::string& get_id(const twindow_type window_type);
|
||||
|
||||
struct tmenubar_definition : public tcontrol_definition
|
||||
{
|
||||
|
||||
tmenubar_definition(const config& cfg);
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
tresolution(const config& cfg);
|
||||
};
|
||||
};
|
||||
|
||||
struct tminimap_definition : public tcontrol_definition
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue