当前位置: 首页>>代码示例>>C++>>正文


C++ window::invalidate_layout方法代码示例

本文整理汇总了C++中window::invalidate_layout方法的典型用法代码示例。如果您正苦于以下问题:C++ window::invalidate_layout方法的具体用法?C++ window::invalidate_layout怎么用?C++ window::invalidate_layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在window的用法示例。


在下文中一共展示了window::invalidate_layout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rename_unit

void unit_recall::rename_unit(window& window)
{
	listbox& list = find_widget<listbox>(&window, "recall_list", false);

	const int index = list.get_selected_row();
	unit& selected_unit = const_cast<unit&>(*recall_list_[index].get());

	std::string name = selected_unit.name();
	const std::string dialog_title(_("Rename Unit"));
	const std::string dialog_label(_("Name:"));

	if(gui2::dialogs::edit_text::execute(dialog_title, dialog_label, name)) {
		selected_unit.rename(name);

		find_widget<label>(list.get_row_grid(index), "unit_name", false).set_label(name);

		filter_options_.erase(filter_options_.begin() + index);
		std::ostringstream filter_text;
		filter_text << selected_unit.type_name() << " " << name << " " << std::to_string(selected_unit.level());
		for(const std::string& trait : selected_unit.trait_names()) {
			filter_text << " " << trait;
		}
		filter_options_.insert(filter_options_.begin() + index, filter_text.str());

		list_item_clicked(window);
		window.invalidate_layout();
	}
}
开发者ID:GregoryLundberg,项目名称:wesnoth,代码行数:28,代码来源:unit_recall.cpp

示例2: update_tod_display

void custom_tod::update_tod_display(window& window)
{
	::image::set_color_adjustment(tod_red_field_->get_value(),
								tod_green_field_->get_value(),
								tod_blue_field_->get_value());

	// Prevent a floating slice of window appearing alone over the
	// theme UI sidebar after redrawing tiles and before we have a
	// chance to redraw the rest of this window.
	window.undraw();

	// NOTE: We only really want to re-render the gamemap tiles here.
	// Redrawing everything is a significantly more expensive task.
	// At this time, tiles are the only elements on which ToD tint is
	// meant to have a visible effect. This is very strongly tied to
	// the image caching mechanism.
	//
	// If this ceases to be the case in the future, you'll need to call
	// redraw_everything() instead.

	// invalidate all tiles so they are redrawn with the new ToD tint next
	display_.invalidate_all();

	// redraw tiles
	display_.draw(false);

	window.invalidate_layout();
}
开发者ID:Wedge009,项目名称:wesnoth,代码行数:28,代码来源:custom_tod.cpp

示例3: show_preferences_button_callback

void lobby_main::show_preferences_button_callback(window& window)
{
	if(preferences_callback_) {
		preferences_callback_();

		/**
		 * The screen size might have changed force an update of the size.
		 *
		 * @todo This might no longer be needed when gui2 is done.
		 */
		window.invalidate_layout();

		wesnothd_connection_.send_data(config("refresh_lobby"));
	}
}
开发者ID:doofus-01,项目名称:wesnoth,代码行数:15,代码来源:lobby.cpp


注:本文中的window::invalidate_layout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。