Пример #1
0
        public DialogResult ShowDialog(Control parent)
        {
            if (parent != null && parent.ParentWindow != null)
            {
                var nswindow = parent.ParentWindow.ControlObject as NSWindow;
                if (nswindow != null)
                {
                    Control.ParentWindow = nswindow;
                }
            }
            Control.MakeKeyWindow();
            Widget.OnShown(EventArgs.Empty);

            Widget.Closed += HandleClosed;
            switch (DisplayMode)
            {
            case DialogDisplayMode.Attached:
                MacModal.RunSheet(Control, out session);
                break;

            default:
                MacModal.Run(Control, out session);
                break;
            }
            return(Widget.DialogResult);
        }
Пример #2
0
        public DialogResult ShowDialog(Control parent)
        {
            var alert = new NSAlert();

            AddButtons(alert);

            alert.AlertStyle      = Convert(Type);
            alert.MessageText     = Caption ?? string.Empty;
            alert.InformativeText = Text ?? string.Empty;
            var ret = MacModal.Run(alert, parent);

            switch (Buttons)
            {
            default:
                return(DialogResult.Ok);

            case MessageBoxButtons.OKCancel:
                return((ret == 1000) ? DialogResult.Ok : DialogResult.Cancel);

            case MessageBoxButtons.YesNo:
                return((ret == 1000) ? DialogResult.Yes : DialogResult.No);

            case MessageBoxButtons.YesNoCancel:
                return((ret == 1000) ? DialogResult.Yes : (ret == 1001) ? DialogResult.Cancel : DialogResult.No);
            }
        }
Пример #3
0
        public DialogResult ShowDialog(Control parent)
        {
            if (parent != null)
            {
                if (parent.ControlObject is NSWindow)
                {
                    Control.ParentWindow = (NSWindow)parent.ControlObject;
                }
                else if (parent.ControlObject is NSView)
                {
                    Control.ParentWindow = ((NSView)parent.ControlObject).Window;
                }
            }
            Control.MakeKeyWindow();
            Widget.OnShown(EventArgs.Empty);

            Widget.Closed += HandleClosed;
            switch (DisplayMode)
            {
            case DialogDisplayMode.Attached:
                MacModal.RunSheet(Control, out session);
                break;

            default:
            case DialogDisplayMode.Default:
            case DialogDisplayMode.Separate:
                MacModal.Run(Control, out session);
                break;
            }
            return(Widget.DialogResult);
        }
Пример #4
0
        public Eto.Forms.DialogResult ShowDialog(Window parent)
        {
            //Control.AllowsOtherFileTypes = false;
            Control.Delegate = new SavePanelDelegate {
                Handler = this
            };
            Create();


            int ret = MacModal.Run(Control, parent);

            return(ret == 1 ? DialogResult.Ok : DialogResult.Cancel);
        }
Пример #5
0
 int RunDialog(Control parent, NSAlert alert)
 {
     alert.MessageText     = Caption ?? string.Empty;
     alert.InformativeText = Text ?? string.Empty;
     return(MacModal.Run(alert, parent));
 }