Example #1
0
tbuilder_label::tbuilder_label(const config& cfg)
	: tbuilder_control(cfg)
	, wrap(cfg["wrap"].to_bool())
	, characters_per_line(cfg["characters_per_line"])
	, text_alignment(decode_text_alignment(cfg["text_alignment"]))
{
}
Example #2
0
inline PangoAlignment typed_formula<PangoAlignment>::execute(
		const game_logic::map_formula_callable& variables,
		game_logic::function_symbol_table* functions) const
{
	return decode_text_alignment(game_logic::formula(formula_, functions)
										 .evaluate(variables)
										 .as_string());
}
Example #3
0
builder_scroll_label::builder_scroll_label(const config& cfg)
	: implementation::builder_styled_widget(cfg)
	, vertical_scrollbar_mode(get_scrollbar_mode(cfg["vertical_scrollbar_mode"]))
	, horizontal_scrollbar_mode(get_scrollbar_mode(cfg["horizontal_scrollbar_mode"]))
	, wrap_on(cfg["wrap"].to_bool(true))
	, text_alignment(decode_text_alignment(cfg["text_alignment"]))
{
}
Example #4
0
void styled_widget::set_members(const string_map& data)
{
	/** @todo document this feature on the wiki. */
	/** @todo do we need to add the debug colors here as well? */
	string_map::const_iterator itor = data.find("id");
	if(itor != data.end()) {
		set_id(itor->second);
	}

	itor = data.find("linked_group");
	if(itor != data.end()) {
		set_linked_group(itor->second);
	}

	itor = data.find("label");
	if(itor != data.end()) {
		set_label(itor->second);
	}

	itor = data.find("tooltip");
	if(itor != data.end()) {
		set_tooltip(itor->second);
	}

	itor = data.find("help");
	if(itor != data.end()) {
		set_help_message(itor->second);
	}

	itor = data.find("use_markup");
	if(itor != data.end()) {
		set_use_markup(utils::string_bool(itor->second));
	}

	itor = data.find("text_alignment");
	if(itor != data.end()) {
		set_text_alignment(decode_text_alignment(itor->second));
	}
}
Example #5
0
inline void tformula<PangoAlignment>::convert(const std::string& str)
{
	value_ = decode_text_alignment(str);
}
Example #6
0
inline PangoAlignment tformula<PangoAlignment>::execute(
		const game_logic::map_formula_callable& variables) const
{
	return decode_text_alignment(
			game_logic::formula(formula_).evaluate(variables).as_string());
}