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


C++ Surface::SetCurrentDeployment方法代码示例

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


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

示例1:

// NOTE: this is used from 'mscorlib.dll' System.IO.IsolatedStorage/MoonIsolatedStorageFile.cs
// NOTE: we let the caller supply the string so i18n can occur in managed land only
gboolean
isolated_storage_increase_quota_to (const char *primary_text, const char* secondary_text)
{
#if PAL_GTK_WINDOWING
	// the dialog is displayed only if the action leading to this call was initiated directly from the user
	if (!Deployment::GetCurrent ()->GetSurface ()->IsUserInitiatedEvent ())
		return false;

	Surface *surface = Deployment::GetCurrent ()->GetSurface ();

	GtkWidget *widget = gtk_message_dialog_new_with_markup (NULL,
						GTK_DIALOG_MODAL,
						GTK_MESSAGE_QUESTION,
						GTK_BUTTONS_YES_NO,
						primary_text);

	gtk_window_set_title (GTK_WINDOW (widget), PACKAGE_STRING);
	gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (widget), secondary_text);

	gboolean result = (gtk_dialog_run (GTK_DIALOG (widget)) == GTK_RESPONSE_YES);
	surface->SetCurrentDeployment ();
	gtk_widget_destroy (widget);
	return result;
#else
	return TRUE;
#endif
}
开发者ID:499940913,项目名称:moon,代码行数:29,代码来源:openfile.cpp

示例2:

static void
option_cell_toggled (GtkCellRendererToggle *cell_renderer,
		     gchar *path,
		     GtkTreeModel *model) 
{
	GtkTreeIter iter;
	GtkTreePath *tree_path;
	gboolean set;
	guint32 flag;
	Surface *surface;

	tree_path = gtk_tree_path_new_from_string (path);

	if (!gtk_tree_model_get_iter (model,
				      &iter,
				      tree_path)) {
		gtk_tree_path_free (tree_path);
		return;
	}

	gtk_tree_path_free (tree_path);

	gtk_tree_model_get (model,
			    &iter,
			    OPTION_COLUMN_TOGGLE, &set,
			    OPTION_COLUMN_FLAG, &flag,
			    OPTION_COLUMN_SURFACE, &surface,
			    -1);

	// we're toggling here
	set = !set;

	surface->SetCurrentDeployment ();

	// toggle the debug state for moonlight
	surface->SetRuntimeOption ((RuntimeInitFlag)flag, set);

	// and reflect the change in the UI
	gtk_list_store_set (GTK_LIST_STORE (model),
			    &iter,
			    OPTION_COLUMN_TOGGLE, set,
			    -1);
}
开发者ID:,项目名称:,代码行数:43,代码来源:


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