Base window
상속: Eto.Forms.Panel
예제 #1
0
파일: MacModal.cs 프로젝트: mhusen/Eto
		public ModalEventArgs(IntPtr session, Window window, NSWindow nativeWindow, bool isModal = false, bool isSheet = false)
		{
			Session = session;
			EtoWindow = window;
			NativeWindow = nativeWindow;
			IsModal = isModal;
			IsSheet = isSheet;
		}
예제 #2
0
        public void ShowModal(Eto.Forms.Window owner)
        {
            if (!this.Loaded)
            {
                this.Owner = owner;

                var c = owner.Bounds.Center;
                c.X           = c.X - this.Width / 2;
                c.Y           = c.Y - 200;
                this.Location = c;
            }

            this.Show();
        }
예제 #3
0
 public ViewContext(Window window)
 {
     this.window = window;
 }
예제 #4
0
파일: ScreenSection.cs 프로젝트: mhusen/Eto
		protected override void OnLoadComplete(EventArgs e)
		{
			base.OnLoadComplete(e);
			parentWindow = ParentWindow;
			parentWindow.LocationChanged += HandleLocationChanged;
		}
예제 #5
0
		internal void AddWindow(Window window)
		{
			window.Closed += HandleClosed;
			windows.Add(window);
		}
예제 #6
0
		void CreateChild()
		{
			if (child != null)
				child.Close();
			Action show;

			var layout = new DynamicLayout();
			layout.Add(null);
			layout.AddCentered(TestChangeSizeButton());
			layout.AddCentered(TestChangeClientSizeButton());
			layout.AddCentered(SendToBackButton());
			layout.AddCentered(CreateCancelClose());
			layout.AddCentered(CloseButton());

			if (typeRadio.SelectedKey == "form")
			{
				var form = new Form();
				child = form;
				show = form.Show;
			}
			else
			{
				var dialog = new Dialog();

				dialog.DefaultButton = new Button { Text = "Default" };
				dialog.DefaultButton.Click += (sender, e) => Log.Write(dialog, "Default button clicked");

				dialog.AbortButton = new Button { Text = "Abort" };
				dialog.AbortButton.Click += (sender, e) => Log.Write(dialog, "Abort button clicked");

				layout.AddSeparateRow(null, dialog.DefaultButton, dialog.AbortButton, null);

				child = dialog;
				show = dialog.ShowModal;
			}

			layout.Add(null);
			child.Content = layout;

			child.OwnerChanged += child_OwnerChanged;
			child.WindowStateChanged += child_WindowStateChanged;
			child.Closed += child_Closed;
			child.Closing += child_Closing;
			child.Shown += child_Shown;
			child.GotFocus += child_GotFocus;
			child.LostFocus += child_LostFocus;
			child.LocationChanged += child_LocationChanged;
			child.SizeChanged += child_SizeChanged;

			child.Title = "Child Window";
			child.WindowStyle = styleCombo.SelectedValue;
			child.WindowState = stateCombo.SelectedValue;
			child.Topmost = topMostCheckBox.Checked ?? false;
			child.Resizable = resizableCheckBox.Checked ?? false;
			child.Maximizable = maximizableCheckBox.Checked ?? false;
			child.Minimizable = minimizableCheckBox.Checked ?? false;
			child.ShowInTaskbar = showInTaskBarCheckBox.Checked ?? false;
			if (setInitialLocation)
				child.Location = initialLocation;
			if (setInitialClientSize)
				child.ClientSize = initialClientSize;
			if (setInitialMinimumSize)
				child.MinimumSize = initialMinimumSize;
			if (setOwnerCheckBox.Checked ?? false)
				child.Owner = ParentWindow;
			bringToFrontButton.Enabled = true;
			show();
			// show that the child is now referenced
			Log.Write(null, "Open Windows: {0}", Application.Instance.Windows.Count());
		}
예제 #7
0
		public override void OnLoadComplete(EventArgs e)
		{
			base.OnLoadComplete(e);
			parentWindow = this.ParentWindow;
			parentWindow.LocationChanged += HandleLocationChanged;
		}
예제 #8
0
파일: Window.cs 프로젝트: gene-l-thomas/Eto
			/// <summary>
			/// Raises the location changed event.
			/// </summary>
			public void OnLocationChanged(Window widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnLocationChanged(e));
			}
예제 #9
0
파일: Window.cs 프로젝트: gene-l-thomas/Eto
			/// <summary>
			/// Raises the window state changed event.
			/// </summary>
			public void OnWindowStateChanged(Window widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnWindowStateChanged(e));
			}
예제 #10
0
파일: Window.cs 프로젝트: gene-l-thomas/Eto
			/// <summary>
			/// Raises the closed event.
			/// </summary>
			public void OnClosed(Window widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnClosed(e));
			}
예제 #11
0
파일: Window.cs 프로젝트: gene-l-thomas/Eto
			/// <summary>
			/// Raises the closing event.
			/// </summary>
			public void OnClosing(Window widget, CancelEventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnClosing(e));
			}
예제 #12
0
파일: Window.cs 프로젝트: picoe/Eto
			/// <summary>
			/// Raises the logical pixel size changed event.
			/// </summary>
			public void OnLogicalPixelSizeChanged(Window widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnLogicalPixelSizeChanged(e));
			}
예제 #13
0
 internal void AddWindow(Window window)
 {
     window.Closed += HandleClosed;
     windows.Add(window);
 }
예제 #14
0
		public void SetOwner(Window owner)
		{
			throw new NotImplementedException();
		}
예제 #15
0
파일: CommonDialog.cs 프로젝트: mhusen/Eto
		/// <summary>
		/// Shows the dialog with the specified parent window, blocking until a result is returned.
		/// </summary>
		/// <returns>The dialog result.</returns>
		/// <param name="parent">Parent window.</param>
		public virtual DialogResult ShowDialog(Window parent)
		{
			return Handler.ShowDialog(parent);
		}
예제 #16
0
파일: MacModal.cs 프로젝트: mhusen/Eto
		public static void RunSheet(Window window, NSWindow theWindow, out ModalEventArgs helper)
		{
			var app = NSApplication.SharedApplication;
			var parent = theWindow.ParentWindow;
			app.BeginSheet(theWindow, parent, delegate
			{
				NSApplication.SharedApplication.StopModal();				
			});
			
			var session = app.BeginModalSession(theWindow);
			helper = new ModalEventArgs(session, window, theWindow, isModal: true, isSheet: true);
			int result;
			var etoapp = ApplicationHandler.Instance;

			// Loop until some result other than continues:
			do
			{
				etoapp.TriggerProcessModalSession(helper);
				// Run the window modally until there are no events to process:
				result = (int)app.RunModalSession(session);
				
				// Give the main loop some time:
				NSRunLoop.Current.RunUntil(NSRunLoop.NSDefaultRunLoopMode, NSDate.DistantFuture);
			} while (result == (int)NSRun.ContinuesResponse || !helper.Stopped);
			
			app.EndModalSession(session);

			/**
			theWindow.OrderOut (null);
			app.EndSheet (theWindow);
			/**/
		}
예제 #17
0
		public DialogResult ShowDialog (Window parent)
		{
			return handler.ShowDialog (parent);
		}
예제 #18
0
파일: MacModal.cs 프로젝트: mhusen/Eto
		public static void BeginSheet(Window window, NSWindow theWindow, out ModalEventArgs helper, Action completed)
		{
			var app = NSApplication.SharedApplication;
			var parent = theWindow.ParentWindow;
			app.BeginSheet(theWindow, parent, delegate
			{
				NSApplication.SharedApplication.StopModal();
				if (completed != null)
					completed();
			});
			helper = new ModalEventArgs(IntPtr.Zero, window, theWindow, isSheet: true);
		}
예제 #19
0
		void child_Closed(object sender, EventArgs e)
		{
			Log.Write(child, "Closed");
			child.OwnerChanged -= child_OwnerChanged;
			child.WindowStateChanged -= child_WindowStateChanged;
			child.Closed -= child_Closed;
			child.Closing -= child_Closing;
			child.Shown -= child_Shown;
			child.GotFocus -= child_GotFocus;
			child.LostFocus -= child_LostFocus;
			child.LocationChanged -= child_LocationChanged;
			child.SizeChanged -= child_SizeChanged;
			bringToFrontButton.Enabled = false;
			child.Unbind();
			child = null;
			// write out number of open windows after the closed event is called
			Application.Instance.AsyncInvoke(() => Log.Write(null, "Open Windows: {0}", Application.Instance.Windows.Count()));
		}
예제 #20
0
 public DialogResult ShowDialog(Window parent)
 {
     return(Handler.ShowDialog(parent));
 }