GUI2: moved state_definition ctor definiton to the appropriate file

No idea what it was doing all the way over in settings.cpp.
This commit is contained in:
Charles Dang 2017-05-26 21:52:42 +11:00
parent fc83e20dfb
commit 14f6238834
2 changed files with 28 additions and 28 deletions

View file

@ -24,6 +24,34 @@
namespace gui2
{
/*WIKI
* @page = GUIToolkitWML
* @order = 1_widget
*
* == State ==
*
* @begin{parent}{name="generic/"}
* @begin{tag}{name="state"}{min=0}{max=1}
* Definition of a state. A state contains the info what to do in a state.
* Atm this is rather focused on the drawing part, might change later.
* Keys:
* @begin{table}{config}
* draw & section & & Section with drawing directions for a
*canvas. $
* @end{table}
* @end{tag}{name="state"}
* @end{parent}{name="generic/"}
*
*/
state_definition::state_definition(const config& cfg) : canvas_()
{
const config& draw = *(cfg ? &cfg.child("draw") : &cfg);
VALIDATE(draw, _("No state or draw section defined."));
canvas_.set_cfg(draw);
}
/*WIKI
* @page = GUIToolkitWML
* @order = 1_widget

View file

@ -547,34 +547,6 @@ void load_settings()
current_gui->second.activate();
}
/*WIKI
* @page = GUIToolkitWML
* @order = 1_widget
*
* == State ==
*
* @begin{parent}{name="generic/"}
* @begin{tag}{name="state"}{min=0}{max=1}
* Definition of a state. A state contains the info what to do in a state.
* Atm this is rather focused on the drawing part, might change later.
* Keys:
* @begin{table}{config}
* draw & section & & Section with drawing directions for a
*canvas. $
* @end{table}
* @end{tag}{name="state"}
* @end{parent}{name="generic/"}
*
*/
state_definition::state_definition(const config& cfg) : canvas_()
{
const config& draw = *(cfg ? &cfg.child("draw") : &cfg);
VALIDATE(draw, _("No state or draw section defined."));
canvas_.set_cfg(draw);
}
void register_widget(const std::string& id, std::function<styled_widget_definition_ptr(const config&)> f, const char* key)
{
registered_widget_types()[id] = {f, key};