本文整理汇总了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
}
示例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);
}