gui2::tbuilder_labbel to its own file.

This commit is contained in:
Mark de Wever 2009-06-16 19:14:41 +00:00
parent f1a1fd322f
commit fccbb0fac9
8 changed files with 110 additions and 46 deletions

View File

@ -9,6 +9,7 @@ src/gui/auxiliary/log.cpp
src/gui/auxiliary/window_builder/button.cpp
src/gui/auxiliary/window_builder/control.cpp
src/gui/auxiliary/window_builder/image.cpp
src/gui/auxiliary/window_builder/label.cpp
src/gui/auxiliary/window_builder.cpp
src/gui/dialogs/addon_connect.cpp
src/gui/dialogs/addon_list.cpp

View File

@ -266,6 +266,7 @@ SET(wesnoth-main_SRC
gui/auxiliary/window_builder/button.cpp
gui/auxiliary/window_builder/control.cpp
gui/auxiliary/window_builder/image.cpp
gui/auxiliary/window_builder/label.cpp
gui/auxiliary/window_builder.cpp
gui/dialogs/addon_connect.cpp
gui/dialogs/addon_list.cpp

View File

@ -91,6 +91,7 @@ wesnoth_source = \
gui/auxiliary/window_builder/button.cpp \
gui/auxiliary/window_builder/control.cpp \
gui/auxiliary/window_builder/image.cpp \
gui/auxiliary/window_builder/label.cpp \
gui/auxiliary/window_builder.cpp \
gui/dialogs/addon_connect.cpp \
gui/dialogs/addon_list.cpp \

View File

@ -247,6 +247,7 @@ wesnoth_sources = Split("""
gui/auxiliary/window_builder/button.cpp
gui/auxiliary/window_builder/control.cpp
gui/auxiliary/window_builder/image.cpp
gui/auxiliary/window_builder/label.cpp
gui/auxiliary/window_builder.cpp
gui/dialogs/addon_connect.cpp
gui/dialogs/addon_list.cpp

View File

@ -22,6 +22,7 @@
#include "gui/auxiliary/log.hpp"
#include "gui/auxiliary/window_builder/button.hpp"
#include "gui/auxiliary/window_builder/image.hpp"
#include "gui/auxiliary/window_builder/label.hpp"
#include "gui/widgets/button.hpp"
#include "gui/widgets/horizontal_scrollbar.hpp"
#include "gui/widgets/image.hpp"
@ -572,39 +573,6 @@ tbuilder_gridcell::tbuilder_gridcell(const config& cfg) :
{
}
tbuilder_label::tbuilder_label(const config& cfg)
: implementation::tbuilder_control(cfg)
, wrap(utils::string_bool("wrap"))
{
/*WIKI
* @page = GUIWidgetInstanceWML
* @order = 2_label
*
* == Label ==
*
* Instance of a label.
*
* List with the label specific variables:
* @start_table = config
* wrap (bool = false) Is wrapping enabled for the label.
* @end_table
*/
}
twidget* tbuilder_label::build() const
{
tlabel* tmp_label = new tlabel();
init_control(tmp_label);
tmp_label->set_can_wrap(wrap);
DBG_GUI_G << "Window builder: placed label '" << id << "' with defintion '"
<< definition << "'.\n";
return tmp_label;
}
tbuilder_listbox::tbuilder_listbox(const config& cfg) :
implementation::tbuilder_control(cfg),
vertical_scrollbar_mode(

View File

@ -0,0 +1,65 @@
/* $Id$ */
/*
Copyright (C) 2008 - 2009 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/window_builder/label.hpp"
#include "config.hpp"
#include "gui/auxiliary/log.hpp"
#include "gui/widgets/label.hpp"
namespace gui2 {
namespace implementation {
tbuilder_label::tbuilder_label(const config& cfg)
: tbuilder_control(cfg)
, wrap(utils::string_bool("wrap"))
{
}
twidget* tbuilder_label::build() const
{
tlabel* widget = new tlabel();
init_control(widget);
widget->set_can_wrap(wrap);
DBG_GUI_G << "Window builder: placed label '"
<< id << "' with defintion '"
<< definition << "'.\n";
return widget;
}
} // namespace implementation
} // namespace gui2
/*WIKI
* @page = GUIWidgetInstanceWML
* @order = 2_label
*
* == Label ==
*
* Instance of a label.
*
* List with the label specific variables:
* @start_table = config
* wrap (bool = false) Is wrapping enabled for the label.
* @end_table
*/

View File

@ -0,0 +1,40 @@
/* $Id$ */
/*
Copyright (C) 2008 - 2009 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_WINDOW_BUILDER_LABEL_HPP_INCLUDED
#define GUI_AUXILIARY_WINDOW_BUILDER_LABEL_HPP_INCLUDED
#include "gui/auxiliary/window_builder/control.hpp"
namespace gui2 {
namespace implementation {
struct tbuilder_label
: public tbuilder_control
{
tbuilder_label(const config& cfg);
twidget* build () const;
bool wrap;
};
} // namespace implementation
} // namespace gui2
#endif

View File

@ -74,19 +74,6 @@ public:
twidget* build () const;
};
struct tbuilder_label : public implementation::tbuilder_control
{
private:
tbuilder_label();
public:
tbuilder_label(const config& cfg);
twidget* build () const;
bool wrap;
};
struct tbuilder_listbox : public implementation::tbuilder_control
{