コード例 #1
0
		public bool Run (IWindowFrameBackend parent, string title, bool supportsAlpha)
		{
			if (!String.IsNullOrEmpty (title))
				dlg.Title = title;
			else
				dlg.Title = defaultTitle;

			dlg.ColorSelection.HasOpacityControl = supportsAlpha;
			
			dlg.ColorSelection.CurrentColor = color.ToGtkValue ();
			if (supportsAlpha)
				dlg.ColorSelection.CurrentAlpha = (ushort) (((double)ushort.MaxValue) * color.Alpha);
		
			var p = (WindowFrameBackend) parent;
			int result = MessageService.RunCustomDialog (dlg, p != null ? p.Window : null);
			
			if (result == (int) Gtk.ResponseType.Ok) {
				color = dlg.ColorSelection.CurrentColor.ToXwtValue ();
				if (supportsAlpha)
					color = color.WithAlpha ((double)dlg.ColorSelection.CurrentAlpha / (double)ushort.MaxValue);
				return true;
			}
			else
				return false;
		}
コード例 #2
0
		public bool Run(IWindowFrameBackend parent, string title, bool supportsAlpha)
		{
			//TODO: Support alpha + create custom WPF solution?
			dialog.Title = title;
			if (parent != null)
				return (this.dialog.ShowDialog(new WpfWin32Window(((WindowFrameBackend)parent).Window)) == DialogResult.OK);
			else
				return (this.dialog.ShowDialog() == DialogResult.OK);
		}
コード例 #3
0
ファイル: PopoverBackend.cs プロジェクト: silwol/xwt
 public void Init(IWindowFrameBackend parent, IWidgetBackend child, Xwt.Popover.Position orientation)
 {
     popover = new PopoverWindow ((Gtk.Widget)child.NativeWidget, orientation);
     popover.TransientFor = ((WindowFrameBackend)parent).Window;
     popover.DestroyWithParent = true;
     popover.Hidden += (o, args) => {
         if (Closed != null)
             Closed (this, EventArgs.Empty);
     };
 }
コード例 #4
0
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     if (backend.Window is Gtk.Window)
     {
         return(backend.Window);
     }
     if (Platform.IsMac)
     {
         return(GtkMacInterop.GetGtkWindow(backend.Window));
     }
     return(null);
 }
コード例 #5
0
 public bool Run(IWindowFrameBackend parent, string title, bool supportsAlpha)
 {
     //TODO: Support alpha + create custom WPF solution?
     dialog.Title = title;
     if (parent != null)
     {
         return(this.dialog.ShowDialog(new WpfWin32Window(((WindowFrameBackend)parent).Window)) == DialogResult.OK);
     }
     else
     {
         return(this.dialog.ShowDialog() == DialogResult.OK);
     }
 }
コード例 #6
0
        public bool Run(IWindowFrameBackend parent)
        {
            var returnValue = Panel.RunModal();

            if (parent != null)
            {
                var win = parent as NSWindow ?? Runtime.GetNSObject(parent.NativeHandle) as NSWindow;
                if (win != null)
                {
                    win.MakeKeyAndOrderFront(win);
                }
            }
            return(returnValue == 1);
        }
コード例 #7
0
		public bool Run(IWindowFrameBackend parent, string title, bool supportsAlpha, Action<Color> colorChangedCallback) {
			//TODO: Support alpha + create custom WPF solution?
			dialog = new ColorDialogExtension((int)this.ScreenPosition.X, (int)this.ScreenPosition.Y, title);
			dialog.Color = System.Drawing.Color.FromArgb((byte)(this.Color.Alpha * 255), (byte)(this.Color.Red * 255), (byte)(this.Color.Green * 255), (byte)(this.Color.Blue * 255));
			bool output;
			if (parent != null)
				output = (this.dialog.ShowDialog(new WpfWin32Window(((WindowFrameBackend)parent).Window)) == DialogResult.OK);
			else
				output = (this.dialog.ShowDialog() == DialogResult.OK);

			this.Color = Color.FromBytes(this.dialog.Color.R, this.dialog.Color.G, this.dialog.Color.B, this.dialog.Color.A);
			colorChangedCallback.Invoke(this.Color);
			this.Close();
			return output;
		}
コード例 #8
0
ファイル: SelectFontDialogBackend.cs プロジェクト: m13253/xwt
		public bool Run (IWindowFrameBackend parent)
		{
			fontPanel.Delegate = new FontPanelDelegate ();

			if (SelectedFont != null) {
				NSFontManager.SharedFontManager.SetSelectedFont (((FontData)Toolkit.GetBackend (SelectedFont)).Font, false);
			}

			NSApplication.SharedApplication.RunModalForWindow (fontPanel);

			var font = NSFontPanel.SharedFontPanel.PanelConvertFont (NSFont.SystemFontOfSize (0));
			SelectedFont = Font.FromName (FontData.FromFont (font).ToString ());

			return true;
		}
コード例 #9
0
		// Important note: The dialog was originally modaless. It was switched to be modal.
		//				   You can see the file history in GIT to see the changes. (Eugene) 


		public bool Run(IWindowFrameBackend parent, string title, bool supportsAlpha, Action<Color> colorChangedCallback)
		{
			colorPanel.Delegate = new SelectColorDialogDelegate();
			colorPanel.ShowsAlpha = supportsAlpha;

			this.callback = colorChangedCallback;
			colorPanel.AnimationBehavior = NSWindowAnimationBehavior.None;

#if !MONOMAC // NSColorPanel.ColorChangedNotification is not defined for MonoMac
			observer = NSNotificationCenter.DefaultCenter.AddObserver(NSColorPanel.ColorChangedNotification, OnColorChanged);
#endif

			NSApplication.SharedApplication.RunModalForWindow(colorPanel);

			return true;
		}
コード例 #10
0
ファイル: MacEngine.cs プロジェクト: TelsaV/xwt
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     if (backend == null)
     {
         return(null);
     }
     if (backend.Window is NSWindow)
     {
         return(backend.Window);
     }
     if (Desktop.DesktopType == DesktopType.Mac && Toolkit.NativeEngine == ApplicationContext.Toolkit)
     {
         return(Runtime.GetNSObject(backend.NativeHandle) as NSWindow);
     }
     return(null);
 }
コード例 #11
0
        public bool Run(IWindowFrameBackend parent)
        {
            bool?ok;

            WindowBackend windowBackend = parent as WindowBackend;

            if (windowBackend != null)
            {
                ok = this.dialog.ShowDialog(windowBackend.Window);
            }
            else
            {
                ok = this.dialog.ShowDialog();
            }

            return(ok.HasValue && ok.Value);
        }
コード例 #12
0
        public void SetTransientFor(IWindowFrameBackend window)
        {
            var wpfBackend = window as WindowFrameBackend;

            if (wpfBackend != null)
            {
                Window.Owner = wpfBackend.Window;
            }
            else if (window != null)
            {
                interopHelper.Owner = window.NativeHandle;
            }
            else
            {
                Window.Owner = null;
            }
        }
コード例 #13
0
        public bool Run(IWindowFrameBackend parent)
        {
            fontPanel.Delegate = new FontPanelDelegate();

            if (SelectedFont != null)
            {
                NSFontManager.SharedFontManager.SetSelectedFont(((FontData)Toolkit.GetBackend(SelectedFont)).Font, false);
            }

            NSApplication.SharedApplication.RunModalForWindow(fontPanel);

            var font = NSFontPanel.SharedFontPanel.PanelConvertFont(NSFont.SystemFontOfSize(0));

            SelectedFont = Font.FromName(FontData.FromFont(font).ToString());

            return(true);
        }
コード例 #14
0
        public void RunLoop(IWindowFrameBackend parent)
        {
            // GTK adds a border to the root widget, for some unknown reason
            ((Gtk.Container)Window.Child).BorderWidth = 0;
            var p = (WindowFrameBackend)parent;

            bool keepRunning;

            do
            {
                var res = MessageService.RunCustomDialog(Window, p != null ? p.Window : null);
                keepRunning = false;
                if (res == (int)Gtk.ResponseType.DeleteEvent)
                {
                    keepRunning = !PerformClose(false);
                }
            } while (keepRunning);
        }
コード例 #15
0
ファイル: DialogBackend.cs プロジェクト: wwwK/dotdevelop-xwt
        public void RunLoop(IWindowFrameBackend parent)
        {
            // GTK adds a border to the root widget, for some unknown reason
            ((Gtk.Container)Window.Child).BorderWidth = 0;
            Gtk.Window p = parent != null?ApplicationContext.Toolkit.GetNativeWindow(parent) as Gtk.Window : null;

            bool keepRunning;

            do
            {
                var res = MessageService.RunCustomDialog(Window, p);
                keepRunning = false;
                if (res == (int)Gtk.ResponseType.DeleteEvent)
                {
                    keepRunning = !PerformClose(false);
                }
            } while (keepRunning);
        }
コード例 #16
0
        public bool Run(IWindowFrameBackend parent, string title, bool supportsAlpha)
        {
            if (!String.IsNullOrEmpty(title))
            {
                dlg.Title = title;
            }
            else
            {
                dlg.Title = defaultTitle;
            }

            dlg.ColorSelection.HasOpacityControl = supportsAlpha;

            dlg.ColorSelection.CurrentColor = color.ToGtkValue();
            if (supportsAlpha)
            {
                dlg.ColorSelection.CurrentAlpha = (ushort)(((double)ushort.MaxValue) * color.Alpha);
            }

            var p = parent != null?Toolkit.CurrentEngine.GetNativeWindow(parent) as Gtk.Window : null;

            int result = MessageService.RunCustomDialog(dlg, p);

            if (result == (int)Gtk.ResponseType.Ok)
            {
                color = dlg.ColorSelection.CurrentColor.ToXwtValue();
                if (supportsAlpha)
                {
                    color = color.WithAlpha((double)dlg.ColorSelection.CurrentAlpha / (double)ushort.MaxValue);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #17
0
ファイル: SelectFontDialogBackend.cs プロジェクト: m13253/xwt
		public bool Run (IWindowFrameBackend parent)
		{
			if (!String.IsNullOrEmpty (Title))
				dlg.Title = Title;
			else
				dlg.Title = defaultTitle;

			if (!String.IsNullOrEmpty (PreviewText))
				dlg.PreviewText = PreviewText;
			else
				dlg.PreviewText = defaultPreviewText;

			if (SelectedFont != null)
				dlg.SetFontName (SelectedFont.ToString ());

			var p = (WindowFrameBackend)parent;
			int result = MessageService.RunCustomDialog (dlg, p != null ? p.Window : null);

			if (result == (int)Gtk.ResponseType.Ok) {
				SelectedFont = Font.FromName (dlg.FontName);
				return true;
			}
			return false;
		}
コード例 #18
0
        public bool Run(IWindowFrameBackend parent)
        {
            if (!String.IsNullOrEmpty(Title))
            {
                dlg.Title = Title;
            }
            else
            {
                dlg.Title = defaultTitle;
            }

            if (!String.IsNullOrEmpty(PreviewText))
            {
                dlg.PreviewText = PreviewText;
            }
            else
            {
                dlg.PreviewText = defaultPreviewText;
            }

            if (SelectedFont != null)
            {
                dlg.SetFontName(SelectedFont.ToString());
            }

            var p = parent != null?context.Toolkit.GetNativeWindow(parent) as Gtk.Window : null;

            int result = MessageService.RunCustomDialog(dlg, p);

            if (result == (int)Gtk.ResponseType.Ok)
            {
                SelectedFont = Font.FromName(dlg.FontName);
                return(true);
            }
            return(false);
        }
コード例 #19
0
ファイル: DialogBackend.cs プロジェクト: TheBrainTech/xwt
		public void RunLoop (IWindowFrameBackend parent)
		{
			if (parent != null)
				StyleMask &= ~NSWindowStyle.Miniaturizable;
			else
				StyleMask |= NSWindowStyle.Miniaturizable;
			Visible = true;
			modalSessionRunning = true;
			var win = parent as NSWindow ?? Toolkit.CurrentEngine.GetNativeWindow (parent) as NSWindow;
			if (win != null) {
				win.AddChildWindow (this, NSWindowOrderingMode.Above);
				// always use NSWindow for alignment when running in guest mode and
				// don't rely on AddChildWindow to position the window correctly
				if (!(parent is WindowBackend)) {
					var parentBounds = MacDesktopBackend.ToDesktopRect (win.ContentRectFor (win.Frame));
					var bounds = ((IWindowFrameBackend)this).Bounds;
					bounds.X = parentBounds.Center.X - (Frame.Width / 2);
					bounds.Y = parentBounds.Center.Y - (Frame.Height / 2);
					((IWindowFrameBackend)this).Bounds = bounds;
				}
			}
			NSApplication.SharedApplication.RunModalForWindow (this);
		}
コード例 #20
0
ファイル: WindowFrameBackend.cs プロジェクト: b-theile/xwt
 void IWindowFrameBackend.SetTransientFor(IWindowFrameBackend window)
 {
     this.Window.Owner = ((WindowFrameBackend)window).Window;
 }
コード例 #21
0
ファイル: FileDialogBackend.cs プロジェクト: Clancey/xwt
 public bool Run(IWindowFrameBackend parent)
 {
     var returnValue = this.RunModal();
     return returnValue == 1;
 }
コード例 #22
0
        public void RunLoop(IWindowFrameBackend parent)
        {
            var p = (WindowFrameBackend)parent;

            MessageService.RunCustomDialog(Window, p != null ? p.Window : null);
        }
コード例 #23
0
ファイル: GtkEngine.cs プロジェクト: mono/xwt
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     if (backend.Window is Gtk.Window)
         return backend.Window;
     if (Platform.IsMac)
         return GtkMacInterop.GetGtkWindow (backend.Window);
     return null;
 }
コード例 #24
0
ファイル: WindowFrameBackend.cs プロジェクト: m13253/xwt
		void IWindowFrameBackend.SetTransientFor (IWindowFrameBackend window)
		{
			Window.TransientFor = ((WindowFrameBackend)window).Window;
		}
コード例 #25
0
ファイル: Toolkit.cs プロジェクト: wwwK/dotdevelop-xwt
 /// <summary>
 /// Gets a reference to the native platform window used by the specified backend.
 /// </summary>
 /// <returns>The native window currently used by Xwt for the specific window, or null.</returns>
 /// <param name="w">The Xwt window.</param>
 /// <remarks>
 /// If the window backend belongs to a different toolkit and the current toolkit is the
 /// native toolkit for the current platform, GetNativeWindow will return the underlying
 /// native window, or null if the operation is not supported for the current toolkit.
 /// </remarks>
 public object GetNativeWindow(IWindowFrameBackend w)
 {
     return(backend.GetNativeWindow(w));
 }
コード例 #26
0
ファイル: WPFEngine.cs プロジェクト: akrisiun/xwt
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     return backend?.Window as System.Windows.Window;
 }
コード例 #27
0
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     return(backend?.Window as System.Windows.Window);
 }
コード例 #28
0
ファイル: DialogBackend.cs プロジェクト: vladimirvaragic/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     // GTK adds a border to the root widget, for some unknown reason
     ((Gtk.Container)Window.Child).BorderWidth = 0;
     var p = (WindowFrameBackend) parent;
     MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
 }
コード例 #29
0
ファイル: DialogBackend.cs プロジェクト: jijamw/xwt
        public void RunLoop(IWindowFrameBackend parent)
        {
            // GTK adds a border to the root widget, for some unknown reason
            ((Gtk.Container)Window.Child).BorderWidth = 0;
            var p = (WindowFrameBackend) parent;

            bool keepRunning;
            do {
                var res = MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
                keepRunning = false;
                if (res == (int) Gtk.ResponseType.DeleteEvent) {
                    keepRunning = !PerformClose (false);
                }
            } while (keepRunning);
        }
コード例 #30
0
 void IWindowFrameBackend.SetTransientFor(IWindowFrameBackend window)
 {
     Window.TransientFor = ((WindowFrameBackend)window).Window;
 }
コード例 #31
0
ファイル: DialogBackend.cs プロジェクト: neiz/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     Visible = true;
     NSApplication.SharedApplication.RunModalForWindow (this);
 }
コード例 #32
0
ファイル: SelectFontDialog.cs プロジェクト: m13253/xwt
		public bool Run (IWindowFrameBackend parent)
		{
			fontSelector.SelectedFont = SelectedFont;
			return fontDialog.Run (this.parent) == Command.Ok;
		}
コード例 #33
0
 /// <summary>
 /// Gets a native window reference from an Xwt window backend.
 /// </summary>
 /// <returns> The native window object. </returns>
 /// <param name='backend'> The Xwt window backend. </param>
 public abstract object GetNativeWindow(IWindowFrameBackend backend);
コード例 #34
0
            public override IEnumerable <Tuple <IntPtr, object> > AllForms(IntPtr display, IWindowFrameBackend window)
            {
                var wi = CGWindowListCopyWindowInfo(0x1, 0);

                var count = CFArrayGetCount(wi);

                var app      = XamMac.appkit_nsapplication.GetPropertyValueStatic("SharedApplication");
                var winarray = (Array)app.GetType().GetPropertyValue(app, "Windows");

                var curapp = XamMac.appkit_nsrunningapp.GetPropertyValueStatic("CurrentApplication");
                var appid  = (int)XamMac.appkit_nsrunningapp.GetPropertyValue(curapp, "ProcessIdentifier");

                var kCGWindowIsOnscreen = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowIsOnscreen");
                var name_window         = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowName");
                var id_window           = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowNumber");
                var id_owner            = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowOwnerPID");
                var kCGWindowBounds     = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowBounds");

                for (int nit = 0; nit < count; nit++)
                {
                    var cfdict = CFArrayGetValueAtIndex(wi, nit);

                    var visible = OpenTK.Platform.MacOS.Cocoa.SendBool(CFDictionaryGetValue(cfdict, kCGWindowIsOnscreen), OpenTK.Platform.MacOS.Selector.Get("boolValue"));

                    if (visible)
                    {
                        var windowid = OpenTK.Platform.MacOS.Cocoa.SendInt(CFDictionaryGetValue(cfdict, id_window), OpenTK.Platform.MacOS.Selector.Get("intValue"));
                        var i2       = OpenTK.Platform.MacOS.Cocoa.SendInt(CFDictionaryGetValue(cfdict, id_owner), OpenTK.Platform.MacOS.Selector.Get("intValue"));

                        if (i2 == appid)
                        {
                            foreach (var nswin in winarray) // AppKit.NSApplication.SharedApplication.Windows
                            {
                                object nint = nswin.GetType().GetPropertyValue(nswin, "WindowNumber");
                                if ((nint as System.IConvertible).ToInt32(null) == windowid)
                                {
                                    yield return(new Tuple <IntPtr, object>(new IntPtr(windowid), nswin));
                                }
                            }
                        }
                        else
                        {
                            if (CGRectMakeWithDictionaryRepresentation(CFDictionaryGetValue(cfdict, kCGWindowBounds), out CGRect rr))
                            {
                                var    name = OpenTK.Platform.MacOS.Cocoa.FromNSString(CFDictionaryGetValue(cfdict, name_window));
                                object r2   = Activator.CreateInstance(XamMac.cg_cgrect, new object[] { rr.x, rr.y, rr.w, rr.h });
                                var    r3   = (Xwt.Rectangle)XamMac.xwtmacbackend.InvokeStatic("ToDesktopRect", r2);

                                if (name != "Dock") // todo check with screenbounds
                                {
                                    yield return(new Tuple <IntPtr, object>(new IntPtr(windowid), r3));
                                }
                            }
                        }
                    }
                }
                OpenTK.Platform.MacOS.Cocoa.SendVoid(wi, OpenTK.Platform.MacOS.Selector.Release);
            }
コード例 #35
0
		void IWindowFrameBackend.SetTransientFor (IWindowFrameBackend window)
		{
			Window.TransientFor = ApplicationContext.Toolkit.GetNativeWindow (window) as Gtk.Window;
		}
コード例 #36
0
ファイル: DialogBackend.cs プロジェクト: m13253/xwt
		public void RunLoop (IWindowFrameBackend parent)
		{
			if (parent != null)
				Window.Owner = ((WindowFrameBackend) parent).Window;
			Window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
			Window.ShowDialog ();
		}
コード例 #37
0
 public void SetTransientFor(IWindowFrameBackend window)
 {
     throw new NotImplementedException();
 }
コード例 #38
0
            public override IEnumerable <Tuple <IntPtr, object> > AllForms(IntPtr _display, IWindowFrameBackend window)
            {
                var wi = CGWindowListCopyWindowInfo(0x1, 0);

                var count = CFArrayGetCount(wi);

                var winarray = CreateGdkLookup();

                var curapp = XamMac.appkit_nsrunningapp.GetPropertyValueStatic("CurrentApplication");
                var appid  = (int)XamMac.appkit_nsrunningapp.GetPropertyValue(curapp, "ProcessIdentifier");

                var kCGWindowIsOnscreen = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowIsOnscreen");
                var name_window         = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowName");
                var id_window           = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowNumber");
                var id_owner            = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowOwnerPID");
                var kCGWindowBounds     = OpenTK.Platform.MacOS.Cocoa.ToNSString("kCGWindowBounds");

                for (int nit = 0; nit < count; nit++)
                {
                    var cfdict = CFArrayGetValueAtIndex(wi, nit);

                    var visible = OpenTK.Platform.MacOS.Cocoa.SendBool(CFDictionaryGetValue(cfdict, kCGWindowIsOnscreen), OpenTK.Platform.MacOS.Selector.Get("boolValue"));

                    if (visible)
                    {
                        var windowid = OpenTK.Platform.MacOS.Cocoa.SendInt(CFDictionaryGetValue(cfdict, id_window), OpenTK.Platform.MacOS.Selector.Get("intValue"));
                        var i2       = OpenTK.Platform.MacOS.Cocoa.SendInt(CFDictionaryGetValue(cfdict, id_owner), OpenTK.Platform.MacOS.Selector.Get("intValue"));

                        if (i2 == appid)
                        {
                            if (winarray.TryGetValue(windowid, out object gtkwin))
                            {
                                yield return(new Tuple <IntPtr, object>(new IntPtr(windowid), gtkwin));
                            }
                        }
                        else
                        {
                            if (CGRectMakeWithDictionaryRepresentation(CFDictionaryGetValue(cfdict, kCGWindowBounds), out CGRect rr))
                            {
                                var name = OpenTK.Platform.MacOS.Cocoa.FromNSString(CFDictionaryGetValue(cfdict, name_window));

                                if (name != "Dock") // todo check with screenbounds
                                {
                                    yield return(new Tuple <IntPtr, object>(new IntPtr(windowid), new  Rectangle(rr.x, rr.y, rr.w, rr.h)));
                                }
                            }
                        }
                    }
                }
                OpenTK.Platform.MacOS.Cocoa.SendVoid(wi, OpenTK.Platform.MacOS.Selector.Release);
            }
コード例 #39
0
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     throw new NotImplementedException();
 }
コード例 #40
0
ファイル: DialogBackend.cs プロジェクト: antonydenyer/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     Window.Owner = ((WindowFrameBackend) parent).Window;
     Window.ShowDialog ();
 }
コード例 #41
0
ファイル: WindowBackend.cs プロジェクト: TheBrainTech/xwt
		void IWindowFrameBackend.SetTransientFor (IWindowFrameBackend window)
		{
			// Generally, TransientFor is used to implement dialog, we reproduce the assumption here
			Level = window == null ? NSWindowLevel.Normal : NSWindowLevel.ModalPanel;
		}
コード例 #42
0
 void IWindowFrameBackend.SetTransientFor(IWindowFrameBackend window)
 {
     // Generally, TransientFor is used to implement dialog, we reproduce the assumption here
     Level = window == null ? NSWindowLevel.Normal : NSWindowLevel.ModalPanel;
 }
コード例 #43
0
ファイル: Toolkit.cs プロジェクト: inorton/xwt
 public NativeWindowFrame(IWindowFrameBackend backend)
 {
     BackendHost.SetCustomBackend(backend);
 }
コード例 #44
0
ファイル: DialogBackend.cs プロジェクト: nite2006/xwt
        public void RunLoop(IWindowFrameBackend parent)
        {
            // GTK adds a border to the root widget, for some unknown reason
            ((Gtk.Container)Window.Child).BorderWidth = 0;
            var p = (WindowFrameBackend) parent;

            bool keepRunning;
            do {
                var res = MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
                keepRunning = false;
                endLoopRequested = false;
                if (res == (int) Gtk.ResponseType.DeleteEvent) {
                    ApplicationContext.InvokeUserCode(delegate {
                        keepRunning = !EventSink.OnCloseRequested ();
                    });
                }
            } while (keepRunning && !endLoopRequested);
        }
コード例 #45
0
ファイル: MacEngine.cs プロジェクト: akrisiun/xwt
 public override object GetNativeWindow(IWindowFrameBackend backend)
 {
     if (backend == null)
         return null;
     if (backend.Window is NSWindow)
         return backend.Window;
     if (Desktop.DesktopType == DesktopType.Mac && Toolkit.NativeEngine == ApplicationContext.Toolkit)
         return Runtime.GetNSObject (backend.NativeHandle) as NSWindow;
     return null;
 }
コード例 #46
0
		public bool Run (IWindowFrameBackend parent)
		{
			if (parent != null)
				return (this.dialog.ShowDialog (new WpfWin32Window (((WindowFrameBackend) parent).Window)) == DialogResult.OK);
			else
				return (this.dialog.ShowDialog () == DialogResult.OK);
		}
コード例 #47
0
        public bool Run(IWindowFrameBackend parent)
        {
            var returnValue = this.RunModal();

            return(returnValue == 1);
        }
コード例 #48
0
ファイル: WindowFrameBackend.cs プロジェクト: Jeha/xwt
 void IWindowFrameBackend.SetTransientFor(IWindowFrameBackend window)
 {
     this.Window.Owner = ((WindowFrameBackend) window).Window;
 }
コード例 #49
0
ファイル: WindowFrameBackend.cs プロジェクト: ivan95603/xwt
 void IWindowFrameBackend.SetTransientFor(IWindowFrameBackend window)
 {
     Window.TransientFor = ApplicationContext.Toolkit.GetNativeWindow(window) as Gtk.Window;
 }
コード例 #50
0
ファイル: DialogBackend.cs プロジェクト: wesreid/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     Visible = true;
     NSApplication.SharedApplication.RunModalForWindow(this);
 }
コード例 #51
0
ファイル: DialogBackend.cs プロジェクト: garuma/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     var p = (WindowFrameBackend) parent;
     MessageService.RunCustomDialog (Window, p != null ? p.Window : null);
 }
コード例 #52
0
 public bool Run(IWindowFrameBackend parent)
 {
     fontSelector.SelectedFont = SelectedFont;
     return(fontDialog.Run(this.parent) == Command.Ok);
 }
コード例 #53
0
ファイル: Util.cs プロジェクト: xecrets/xwt
 public XwtWin32Window(IWindowFrameBackend window)
 {
     this.window = window;
 }
コード例 #54
0
ファイル: WidgetRegistry.cs プロジェクト: migueldeicaza/xwt
 public NativeWindowFrame(IWindowFrameBackend backend)
 {
     this.backend = backend;
 }
コード例 #55
0
ファイル: DialogBackend.cs プロジェクト: akrisiun/xwt
 public void RunLoop(IWindowFrameBackend parent)
 {
     if (parent != null)
         SetTransientFor(parent);
     Window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     Window.ShowDialog ();
 }
コード例 #56
0
ファイル: FileDialogBackend.cs プロジェクト: chkn/xwt
 public bool Run(IWindowFrameBackend parent)
 {
     var p = (WindowFrameBackend) parent;
     int result = MessageService.RunCustomDialog (dialog, p != null ? p.Window : null);
     return result == (int) Gtk.ResponseType.Ok;
 }
コード例 #57
0
ファイル: DialogBackend.cs プロジェクト: mono/xwt
        public void RunLoop(IWindowFrameBackend parent)
        {
            // GTK adds a border to the root widget, for some unknown reason
            ((Gtk.Container)Window.Child).BorderWidth = 0;
            Gtk.Window p = parent != null ? ApplicationContext.Toolkit.GetNativeWindow (parent) as Gtk.Window : null;

            bool keepRunning;
            do {
                var res = MessageService.RunCustomDialog (Window, p);
                keepRunning = false;
                if (res == (int) Gtk.ResponseType.DeleteEvent) {
                    keepRunning = !PerformClose (false);
                }
            } while (keepRunning);
        }