예제 #1
0
widget* builder_spacer::build() const
{
	spacer* widget = new spacer();

	init_control(widget);

	const game_logic::map_formula_callable& size = get_screen_size_variables();

	const unsigned width = width_(size);
	const unsigned height = height_(size);

	if(width || height) {
		widget->set_best_size(point(width, height));
	}

	DBG_GUI_G << "Window builder: placed spacer '" << id
			  << "' with definition '" << definition << "'.\n";

	return widget;
}
twidget* tbuilder_drawing::build() const
{
	tdrawing* widget = new tdrawing();

	init_control(widget);

	const game_logic::map_formula_callable& size =
			get_screen_size_variables();

	const unsigned width = width_(size);
	const unsigned height = height_(size);

	if(width || height) {
		widget->set_best_size(tpoint(width, height));
	}

	widget->canvas().front().set_cfg(draw_);

	DBG_GUI_G << "Window builder: placed drawing '"
			<< id << "' with definition '"
			<< definition << "'.\n";

	return widget;
}