static Command GenericAlert(WindowFrame parent, MessageDescription message) { if (message.ApplyToAllButton != null) { return(message.ApplyToAllButton); } IAlertDialogBackend backend = Toolkit.CurrentEngine.Backend.CreateBackend <IAlertDialogBackend> (); backend.Initialize(Toolkit.CurrentEngine.Context); if (message.Icon != null) { message.Icon.InitForToolkit(Toolkit.CurrentEngine); } using (backend) { Command res = null; Toolkit.CurrentEngine.InvokePlatformCode(delegate { res = backend.Run(parent ?? RootWindow, message); }); if (backend.ApplyToAll) { message.ApplyToAllButton = res; } return(res); } }
public Command Run(WindowFrame parent) { Toolkit.InvokePlatformCode(delegate { Backend.RunLoop((IWindowFrameBackend)WidgetRegistry.GetBackend(parent)); }); return(resultCommand); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectFontDialogBackend> (); if (backend == null) { backend = new DefaultSelectFontDialogBackend(parentWindow); } try { backend.SelectedFont = SelectedFont; backend.Title = Title; backend.PreviewText = PreviewText; bool result = false; Toolkit.CurrentEngine.InvokePlatformCode(delegate { result = backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow)); }); return(result); } catch (Exception ex) { Console.WriteLine(ex); return(false); } finally { font = backend.SelectedFont; backend.Dispose(); } }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize(multiselect); if (!string.IsNullOrEmpty(currentFolder)) { Backend.CurrentFolder = currentFolder; } if (!string.IsNullOrEmpty(title)) { Backend.Title = title; } Backend.CanCreateFolders = canCreateFolders; bool result = false; BackendHost.ToolkitEngine.InvokePlatformCode(delegate { result = Backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow)); }); return(result); } finally { currentFolder = Backend.CurrentFolder; folder = Backend.Folder; folders = Backend.Folders; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup(); } }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize(filters, multiselect, initialFileName); if (!string.IsNullOrEmpty(currentFolder)) { Backend.CurrentFolder = currentFolder; } if (activeFilter != null) { Backend.ActiveFilter = activeFilter; } if (!string.IsNullOrEmpty(title)) { Backend.Title = title; } return(Backend.Run((IWindowFrameBackend)BackendHost.ToolkitEngine.GetSafeBackend(parentWindow))); } finally { currentFolder = Backend.CurrentFolder; activeFilter = Backend.ActiveFilter; fileName = Backend.FileName; fileNames = Backend.FileNames; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup(); } }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize(filters, multiselect, initialFileName); if (!string.IsNullOrEmpty(currentFolder)) { Backend.CurrentFolder = currentFolder; } if (activeFilter != null) { Backend.ActiveFilter = activeFilter; } if (!string.IsNullOrEmpty(title)) { Backend.Title = title; } bool result = false; BackendHost.ToolkitEngine.InvokePlatformCode(delegate { result = Backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow)); }); return(result); } finally { activeFilter = Backend.ActiveFilter; fileName = Backend.FileName; fileNames = Backend.FileNames; if (fileName != string.Empty) { currentFolder = Backend.CurrentFolder; } running = false; Backend.Cleanup(); } }
public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText, string title, Drawing.Image icon) { if (string.IsNullOrEmpty(title)) { title = parent?.Title ?? Application.TranslationCatalog.GetString("Information"); } GenericAlert(parent, icon, primaryText, secondaryText, title, Command.Ok); }
public static void ShowError(WindowFrame parent, string primaryText, string secondaryText, string title) { if (string.IsNullOrEmpty(title)) { title = parent?.Title ?? Application.TranslationCatalog.GetString("Error"); } GenericAlert(parent, Toolkit.CurrentEngine.Defaults.MessageDialog.ErrorIcon, primaryText, secondaryText, title, Command.Ok); }
public Command Run(WindowFrame parent) { BackendHost.ToolkitEngine.ValidateObject(parent); BackendHost.ToolkitEngine.InvokePlatformCode(delegate { Backend.RunLoop((IWindowFrameBackend)Toolkit.GetBackend(parent)); }); return(resultCommand); }
public virtual Xwt.WindowFrame ShowTooltipWindow(MonoTextEditor editor, Xwt.WindowFrame tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, MonoDevelop.Ide.Editor.TooltipItem item) { int w; double xalign; GetRequiredPosition(editor, tipWindow, out w, out xalign); ShowAndPositionTooltip(editor, tipWindow, mouseX, mouseY, w, xalign); return(tipWindow); }
public Popover(WindowFrame parent, Widget child, Position arrowPosition) { this.arrowPosition = arrowPosition; backend = WidgetRegistry.CreateBackend<IPopoverBackend> (GetType ()); backend.Init ((IWindowFrameBackend) WidgetRegistry.GetBackend (parent), (IWidgetBackend) WidgetRegistry.GetBackend (child), arrowPosition); backend.Closed += (sender, e) => { if (Closed != null) Closed (this, EventArgs.Empty); }; }
/// <summary> /// Shows the dialog. /// </summary> public bool Run (WindowFrame parentWindow) { var backend = Toolkit.CurrentEngine.Backend.CreateBackend<ISelectColorDialogBackend> (); try { if (color != Colors.Transparent) backend.Color = color; return backend.Run ((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend (parentWindow), title, supportsAlpha); } finally { color = backend.Color; backend.Dispose (); } }
public Command Run(WindowFrame parent) { if (parent != null) { TransientFor = parent; } AdjustSize(); loopEnded = false; BackendHost.ToolkitEngine.InvokePlatformCode(delegate { Backend.RunLoop((IWindowFrameBackend)Toolkit.GetBackend(parent)); }); return(resultCommand); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { var backend = WidgetRegistry.CreateBackend <ISelectColorDialogBackend> (GetType()); try { if (color != Colors.Transparent) { backend.Color = color; } return(backend.Run((IWindowFrameBackend)WidgetRegistry.GetBackend(parentWindow), title, supportsAlpha)); } finally { color = backend.Color; backend.Dispose(); } }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectColorDialogBackend> (); try { if (color != Colors.Transparent) { backend.Color = color; } return(backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow), title, supportsAlpha)); } finally { color = backend.Color; backend.Dispose(); } }
static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, int defaultButton, params Command[] buttons) { GenericMessage message = new GenericMessage() { Icon = icon, Text = primaryText, SecondaryText = secondaryText, DefaultButton = defaultButton }; foreach (Command but in buttons) { message.Buttons.Add(but); } return(GenericAlert(parent, message)); }
internal static void ShowAndPositionTooltip(MonoTextEditor editor, Xwt.WindowFrame tipWindow, int mouseX, int mouseY, int width, double xalign) { int ox = 0, oy = 0; if (editor.GdkWindow != null) { editor.GdkWindow.GetOrigin(out ox, out oy); } width += 10; int x = mouseX + ox + editor.Allocation.X; int y = mouseY + oy + editor.Allocation.Y; Gdk.Rectangle geometry = editor.Screen.GetUsableMonitorGeometry(editor.Screen.GetMonitorAtPoint(x, y)); x -= (int)((double)width * xalign); y += 10; if (x + width >= geometry.X + geometry.Width) { x = geometry.X + geometry.Width - width; } if (x < geometry.Left) { x = geometry.Left; } int h = (int)tipWindow.Height; if (y + h >= geometry.Y + geometry.Height) { y = geometry.Y + geometry.Height - h; } if (y < geometry.Top) { y = geometry.Top; } tipWindow.Location = new Xwt.Point(x, y); tipWindow.Show(); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { var backend = Toolkit.CurrentEngine.Backend.CreateBackend <ISelectColorDialogBackend> (); try { if (color != Colors.Transparent) { backend.Color = color; } bool result = false; Toolkit.CurrentEngine.InvokePlatformCode(delegate { result = backend.Run((IWindowFrameBackend)Toolkit.GetBackend(parentWindow), title, supportsAlpha); }); return(result); } finally { color = backend.Color; backend.Dispose(); } }
public DefaultSelectFontDialogBackend(WindowFrame parentWindow) { parent = parentWindow; fontDialog = new Dialog(); fontDialog.Width = 500; fontDialog.Height = 300; VBox box = new VBox(); fontSelector = new FontSelector(); fontSelector.FontChanged += (sender, e) => SelectedFont = fontSelector.SelectedFont; box.PackStart(fontSelector, true); fontDialog.Content = box; fontDialog.Buttons.Add(new DialogButton(Command.Cancel)); fontDialog.Buttons.Add(new DialogButton(Command.Ok)); }
static Command GenericAlert(WindowFrame parent, MessageDescription message) { if (message.ApplyToAllButton != null) { return(message.ApplyToAllButton); } IAlertDialogBackend backend = WidgetRegistry.CreateBackend <IAlertDialogBackend> (typeof(IAlertDialogBackend)); using (backend) { var res = backend.Run(parent ?? RootWindow, message); if (backend.ApplyToAll) { message.ApplyToAllButton = res; } return(res); } }
public RunConfigurationNameDialog(Xwt.WindowFrame parent, string name, Command action, IEnumerable <string> invalidNames) { TransientFor = parent; Resizable = false; Width = 300; this.invalidNames = invalidNames; mainBox = new VBox(); var box = new HBox(); mainBox.PackStart(box, true); box.PackStart(new Label(GettextCatalog.GetString("Name")), false); entry = new TextEntry(); entry.Text = name ?? ""; box.PackStart(entry, true); Content = mainBox; Buttons.Add(new DialogButton(Command.Cancel)); Buttons.Add(okButton = new DialogButton(action)); this.DefaultCommand = okButton.Command; entry.Activated += Entry_Activated; entry.Changed += (s, o) => UpdateControls(); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize(multiselect); if (!string.IsNullOrEmpty(currentFolder)) { Backend.CurrentFolder = currentFolder; } if (!string.IsNullOrEmpty(title)) { Backend.Title = title; } return(Backend.Run((IWindowFrameBackend)WidgetRegistry.GetBackend(parentWindow))); } finally { currentFolder = Backend.CurrentFolder; folder = Backend.Folder; folders = Backend.Folders; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup(); } }
public Command Run (WindowFrame parent) { BackendHost.ToolkitEngine.ValidateObject (parent); if (parent != null) TransientFor = parent; AdjustSize (); loopEnded = false; BackendHost.ToolkitEngine.InvokePlatformCode (delegate { Backend.RunLoop ((IWindowFrameBackend) Toolkit.GetBackend (parent)); }); return resultCommand; }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize (filters, multiselect, initialFileName); if (!string.IsNullOrEmpty (currentFolder)) Backend.CurrentFolder = currentFolder; if (activeFilter != null) Backend.ActiveFilter = activeFilter; if (!string.IsNullOrEmpty (title)) Backend.Title = title; return Backend.Run ((IWindowFrameBackend)backendHost.ToolkitEngine.GetSafeBackend (parentWindow)); } finally { currentFolder = Backend.CurrentFolder; activeFilter = Backend.ActiveFilter; fileName = Backend.FileName; fileNames = Backend.FileNames; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup (); } }
public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText) { GenericAlert(parent, StockIcons.Warning, primaryText, secondaryText, Command.Ok); }
public static void ShowError(WindowFrame parent, string primaryText) { ShowError(parent, primaryText, null); }
static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, params Command[] buttons) { return(GenericAlert(parent, icon, primaryText, secondaryText, buttons.Length - 1, buttons)); }
public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText) { ShowMessage(parent, StockIcons.Information, primaryText, secondaryText); }
internal void SetParentWindow(WindowFrame win) { parentWindow = win; }
static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, params Command[] buttons) { return GenericAlert (parent, icon, primaryText, secondaryText, buttons.Length - 1, buttons); }
public DefaultSelectFontDialogBackend (WindowFrame parentWindow) { parent = parentWindow; fontDialog = new Dialog (); fontDialog.Width = 500; fontDialog.Height = 300; VBox box = new VBox (); fontSelector = new FontSelector (); fontSelector.FontChanged += (sender, e) => SelectedFont = fontSelector.SelectedFont; box.PackStart (fontSelector, true); fontDialog.Content = box; fontDialog.Buttons.Add (new DialogButton (Command.Cancel)); fontDialog.Buttons.Add (new DialogButton (Command.Ok)); }
public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText, Drawing.Image icon) { GenericAlert (parent, icon, primaryText, secondaryText, Command.Ok); }
public new bool Run (WindowFrame parentWindow) { return base.Run (parentWindow) == Command.Ok; }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize (multiselect); if (!string.IsNullOrEmpty (currentFolder)) Backend.CurrentFolder = currentFolder; if (!string.IsNullOrEmpty (title)) Backend.Title = title; return Backend.Run ((IWindowFrameBackend)BackendHost.ToolkitEngine.GetSafeBackend (parentWindow)); } finally { currentFolder = Backend.CurrentFolder; folder = Backend.Folder; folders = Backend.Folders; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup (); } }
public Command Run(WindowFrame parent) { BackendHost.ToolkitEngine.ValidateObject (parent); BackendHost.ToolkitEngine.InvokePlatformCode (delegate { Backend.RunLoop ((IWindowFrameBackend) Toolkit.GetBackend (parent)); }); return resultCommand; }
static Command GenericAlert(WindowFrame parent, MessageDescription message) { if (message.ApplyToAllButton != null) return message.ApplyToAllButton; IAlertDialogBackend backend = Toolkit.CurrentEngine.Backend.CreateBackend<IAlertDialogBackend> (); backend.Initialize (Toolkit.CurrentEngine.Context); using (backend) { var res = backend.Run (parent ?? RootWindow, message); if (backend.ApplyToAll) message.ApplyToAllButton = res; return res; } }
public Command Run(WindowFrame parent) { Toolkit.InvokePlatformCode (delegate { Backend.RunLoop ((IWindowFrameBackend) WidgetRegistry.GetBackend (parent)); }); return resultCommand; }
public static bool Confirm(WindowFrame window, string primaryText, string secondaryText, Drawing.Image icon, Command button) { return GenericAlert (window, icon, primaryText, secondaryText, Command.Cancel, button) == button; }
public static void ShowMessage(WindowFrame parent, string primaryText, string secondaryText) { GenericAlert (parent, StockIcons.Information, primaryText, secondaryText, Command.Ok); }
public static Command AskQuestion(WindowFrame window, QuestionMessage message) { return(GenericAlert(window, message)); }
public static void ShowMessage(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText) { GenericAlert(parent, icon, primaryText, secondaryText, Command.Ok); }
public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText) { GenericAlert (parent, StockIcons.Warning, primaryText, secondaryText, Command.Ok); }
public static void ShowMessage(WindowFrame parent, string primaryText) { ShowMessage (parent, primaryText, null); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run (WindowFrame parentWindow, Action<Color> colorChangedCallback) { if(backend.Color != Colors.Transparent) { backend.Color = backend.Color; } return backend.Run((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend(parentWindow), title, supportsAlpha, colorChangedCallback); }
public static void ShowWarning(WindowFrame parent, string primaryText) { ShowWarning(parent, primaryText, null); }
public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText) { ShowWarning(parent, primaryText, secondaryText, string.Empty); }
public static void ShowMessage(WindowFrame parent, string primaryText) { ShowMessage(parent, primaryText, null); }
public static void ShowWarning(WindowFrame parent, string primaryText) { ShowWarning (parent, primaryText, null); }
public static void ShowError(WindowFrame parent, string primaryText) { ShowError (parent, primaryText, null); }
public static bool Confirm(WindowFrame window, string primaryText, string secondaryText, Command button) { return GenericAlert (window, Toolkit.CurrentEngine.Defaults.MessageDialog.QuestionIcon, primaryText, secondaryText, Command.Cancel, button) == button; }
static Command GenericAlert(WindowFrame parent, Xwt.Drawing.Image icon, string primaryText, string secondaryText, int defaultButton, params Command[] buttons) { GenericMessage message = new GenericMessage () { Icon = icon, Text = primaryText, SecondaryText = secondaryText, DefaultButton = defaultButton }; foreach (Command but in buttons) message.Buttons.Add (but); return GenericAlert (parent, message); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { var backend = WidgetRegistry.CreateBackend<ISelectColorDialogBackend> (GetType ()); try { if (color != Colors.Transparent) backend.Color = color; return backend.Run ((IWindowFrameBackend)WidgetRegistry.GetBackend (parentWindow), title, supportsAlpha); } finally { color = backend.Color; backend.Dispose (); } }
public static void ShowWarning(WindowFrame parent, string primaryText, string secondaryText) { GenericAlert (parent, Toolkit.CurrentEngine.Defaults.MessageDialog.WarningIcon, primaryText, secondaryText, Command.Ok); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run (WindowFrame parentWindow) { var backend = Toolkit.CurrentEngine.Backend.CreateBackend<ISelectFontDialogBackend> (); if (backend == null) backend = new DefaultSelectFontDialogBackend (parentWindow); try { backend.SelectedFont = SelectedFont; backend.Title = Title; backend.PreviewText = PreviewText; return backend.Run ((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend (parentWindow)); } catch (Exception ex) { Console.WriteLine (ex); return false; } finally { font = backend.SelectedFont; backend.Dispose (); } }
public bool Run (WindowFrame parent) { var cmd = Dialog.Run (parent); return cmd == Command.Ok; }