C++ twindow::register_hotkey方法代码示例

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


C++ twindow::register_hotkey方法代码示例

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

示例1: post_build

void tlobby_main::post_build(twindow& window)
{
	/** @todo Should become a global hotkey after 1.8, then remove it here. */
	window.register_hotkey(hotkey::HOTKEY_FULLSCREEN, std::bind(fullscreen, std::ref(window.video())));

	/*** Local hotkeys. ***/
	window.register_hotkey(hotkey::HOTKEY_PREFERENCES, [this](event::tdispatcher& win, hotkey::HOTKEY_COMMAND)->bool {
		show_preferences_button_callback(dynamic_cast<twindow&>(win));
		return true;
	});
}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:11,代码来源:lobby.cpp

示例2: post_build

void tlobby_main::post_build(twindow& window)
{
	/** @todo Should become a global hotkey after 1.8, then remove it here. */
	window.register_hotkey(hotkey::HOTKEY_FULLSCREEN,
			std::bind(fullscreen, std::ref(window.video())));

	/*** Local hotkeys. ***/
	preferences_wrapper_
			= std::bind(&tlobby_main::show_preferences_button_callback,
						  this,
						  std::ref(window));

	window.register_hotkey(
			hotkey::HOTKEY_PREFERENCES,
			std::bind(function_wrapper<bool, std::function<void()> >,
						true,
						std::cref(preferences_wrapper_)));
}
开发者ID:CliffsDover,项目名称:wesnoth,代码行数:18,代码来源:lobby.cpp

示例3: post_build

void ttitle_screen::post_build(CVideo& video, twindow& window)
{
	/** @todo Should become a title screen hotkey. */
	window.register_hotkey(hotkey::TITLE_SCREEN__RELOAD_WML
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, RELOAD_GAME_DATA));

	window.register_hotkey(hotkey::HOTKEY_FULLSCREEN
			, boost::bind(fullscreen, boost::ref(video)));

	window.register_hotkey(hotkey::HOTKEY_LANGUAGE
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, CHANGE_LANGUAGE));

	window.register_hotkey(hotkey::HOTKEY_LOAD_GAME
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, LOAD_GAME));

	window.register_hotkey(hotkey::HOTKEY_HELP
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, SHOW_HELP));

	window.register_hotkey(hotkey::HOTKEY_PREFERENCES
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, EDIT_PREFERENCES));

	static const boost::function<void()> next_tip_wrapper = boost::bind(
			  &ttitle_screen::update_tip
			, this
			, boost::ref(window)
			, true);

	window.register_hotkey(hotkey::TITLE_SCREEN__NEXT_TIP
			, boost::bind(function_wrapper<bool, boost::function<void()> >
				, true
				, boost::cref(next_tip_wrapper)));

	static const boost::function<void()> previous_tip_wrapper = boost::bind(
			  &ttitle_screen::update_tip
			, this
			, boost::ref(window)
			, false);

	window.register_hotkey(hotkey::TITLE_SCREEN__PREVIOUS_TIP
			, boost::bind(function_wrapper<bool, boost::function<void()> >
				, true
				, boost::cref(previous_tip_wrapper)));

	window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, TUTORIAL));

	window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, TUTORIAL));

	window.register_hotkey(hotkey::TITLE_SCREEN__CAMPAIGN
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, NEW_CAMPAIGN));

	window.register_hotkey(hotkey::TITLE_SCREEN__MULTIPLAYER
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, MULTIPLAYER));

	window.register_hotkey(hotkey::TITLE_SCREEN__ADDONS
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, GET_ADDONS));

	window.register_hotkey(hotkey::TITLE_SCREEN__EDITOR
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, START_MAP_EDITOR));

	window.register_hotkey(hotkey::TITLE_SCREEN__CREDITS
				, boost::bind(
					  &hotkey
					, boost::ref(window)
					, SHOW_ABOUT));

//.........这里部分代码省略.........
开发者ID:asimonov-im,项目名称:wesnoth,代码行数:101,代码来源:title_screen.cpp

示例4: post_build

void ttitle_screen::post_build(twindow& window)
{
	/** @todo Should become a title screen hotkey. */
	window.register_hotkey(
			hotkey::TITLE_SCREEN__RELOAD_WML,
			std::bind(&hotkey, std::ref(window), RELOAD_GAME_DATA));

	window.register_hotkey(hotkey::HOTKEY_FULLSCREEN,
			std::bind(fullscreen, std::ref(window.video())));

	window.register_hotkey(
			hotkey::HOTKEY_LANGUAGE,
			std::bind(&hotkey, std::ref(window), CHANGE_LANGUAGE));

	window.register_hotkey(hotkey::HOTKEY_LOAD_GAME,
						   std::bind(&hotkey, std::ref(window), LOAD_GAME));

	window.register_hotkey(hotkey::HOTKEY_HELP,
						   std::bind(&hotkey, std::ref(window), SHOW_HELP));

	window.register_hotkey(
			hotkey::HOTKEY_PREFERENCES,
			std::bind(&hotkey, std::ref(window), EDIT_PREFERENCES));

	std::function<void()> next_tip_wrapper = std::bind(
			&ttitle_screen::update_tip, this, std::ref(window), true);

	window.register_hotkey(
			hotkey::TITLE_SCREEN__NEXT_TIP,
			std::bind(function_wrapper<bool, std::function<void()> >,
						true,
						next_tip_wrapper));

	std::function<void()> previous_tip_wrapper = std::bind(
			&ttitle_screen::update_tip, this, std::ref(window), false);

	window.register_hotkey(
			hotkey::TITLE_SCREEN__PREVIOUS_TIP,
			std::bind(function_wrapper<bool, std::function<void()> >,
						true,
						previous_tip_wrapper));

	window.register_hotkey(hotkey::TITLE_SCREEN__TUTORIAL,
						   std::bind(&hotkey, std::ref(window), TUTORIAL));

	window.register_hotkey(
			hotkey::TITLE_SCREEN__CAMPAIGN,
			std::bind(&hotkey, std::ref(window), NEW_CAMPAIGN));

	window.register_hotkey(
			hotkey::TITLE_SCREEN__MULTIPLAYER,
			std::bind(&hotkey, std::ref(window), MULTIPLAYER));

	window.register_hotkey(
			hotkey::TITLE_SCREEN__ADDONS,
			std::bind(&hotkey, std::ref(window), GET_ADDONS));

	window.register_hotkey(hotkey::TITLE_SCREEN__CORES,
						   std::bind(&hotkey, std::ref(window), CORES));

	window.register_hotkey(
			hotkey::TITLE_SCREEN__EDITOR,
			std::bind(&hotkey, std::ref(window), START_MAP_EDITOR));

	window.register_hotkey(
			hotkey::TITLE_SCREEN__CREDITS,
			std::bind(&hotkey, std::ref(window), SHOW_ABOUT));

	window.register_hotkey(hotkey::HOTKEY_QUIT_TO_DESKTOP,
						   std::bind(&hotkey, std::ref(window), QUIT_GAME));

	window.register_hotkey(
			hotkey::LUA_CONSOLE,
			std::bind(&launch_lua_console, std::ref(window)));
}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:75,代码来源:title_screen.cpp

本文标签属性:

示例:示例的拼音

代码:代码生成器

上一篇:Python libmpf.mpf_add函数代码示例
下一篇:C# CSharp.CSharpFormattingOptions类代码示例

为您推荐