• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AppKit.NSWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoMac.AppKit.NSWindow的典型用法代码示例。如果您正苦于以下问题:C# NSWindow类的具体用法?C# NSWindow怎么用?C# NSWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NSWindow类属于MonoMac.AppKit命名空间,在下文中一共展示了NSWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

		public override void FinishedLaunching (NSObject notification)
		{
			window = new NSWindow(new RectangleF (50, 50, 400, 400), (NSWindowStyle) (1 | (1 << 1) | (1 << 2) | (1 << 3)), NSBackingStore.Buffered, false);
			window.MakeKeyAndOrderFront(this);
			//mainWindowController = new MainWindowController ();
			//mainWindowController.Window.MakeKeyAndOrderFront (this);
		}
开发者ID:Clancey,项目名称:MonoMac.Windows.Form,代码行数:7,代码来源:AppDelegate.cs


示例2: BeginSheet

		public void BeginSheet (NSWindow window, NSAction onEnded)
		{
			BeginSheetForResponse (window, r => {
				if (onEnded != null)
					onEnded ();
			});
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:7,代码来源:NSAlert.cs


示例3: ModalEventArgs

		public ModalEventArgs(IntPtr session, Window window, NSWindow nativeWindow, bool isModal = false, bool isSheet = false)
		{
			Session = session;
			EtoWindow = window;
			NativeWindow = nativeWindow;
			IsModal = isModal;
			IsSheet = isSheet;
		}
开发者ID:mhusen,项目名称:Eto,代码行数:8,代码来源:MacModal.cs


示例4: RunModal

        public void RunModal(NSWindow window)
        {
            SetUiToStart();

            window.DidBecomeKey -= DidBecomeKey;
            window.DidBecomeKey += DidBecomeKey;
            window.WillClose -= WindowWillClose;
            window.WillClose += WindowWillClose;
            NSApplication.SharedApplication.RunModalForWindow(window);
        }
开发者ID:kevintavog,项目名称:Radish.net,代码行数:10,代码来源:SearchController.cs


示例5: FinishedLaunching

    public override void FinishedLaunching(NSObject notification)
    {
        text = new NSTextField (new RectangleF (44, 32, 232, 31)) {
            StringValue = "Hello Mono Mac!"
        };

        window = new NSWindow (new RectangleF (50, 50, 400, 400), (NSWindowStyle) (1 | (1 << 1) | (1 << 2) | (1 << 3)), 0, false);
        window.ContentView.AddSubview (text);
        window.MakeKeyAndOrderFront (this);
    }
开发者ID:sichy,项目名称:monomac,代码行数:10,代码来源:hello.cs


示例6: goFullScreen

		partial void goFullScreen (NSObject sender)
		{
			isInFullScreenMode = true;
			
			// Pause the non-fullscreen view
			openGLView.StopAnimation ();
			
			RectangleF mainDisplayRect;
			RectangleF viewRect;
			
			// Create a screen-sized window on the display you want to take over
			// Note, mainDisplayRect has a non-zero origin if the key window is on a secondary display
			mainDisplayRect = NSScreen.MainScreen.Frame;
			
			fullScreenWindow = new NSWindow (mainDisplayRect, NSWindowStyle.Borderless, NSBackingStore.Buffered, true);
			
			// Set the window level to be above the menu bar
			fullScreenWindow.Level = NSWindowLevel.MainMenu + 1;
			
			// Perform any other window configuration you desire
			fullScreenWindow.IsOpaque = true;
			fullScreenWindow.HidesOnDeactivate = true;
			
			// Create a view with a double-buffered OpenGL context and attach it to the window
			// By specifying the non-fullscreen context as the shareContext, we automatically inherit the 
			// OpenGL objects (textures, etc) it has defined
			viewRect = new RectangleF (0, 0, mainDisplayRect.Size.Width, mainDisplayRect.Size.Height);
			
			fullScreenView = new MyOpenGLView (viewRect, openGLView.OpenGLContext);
			fullScreenWindow.ContentView = fullScreenView;
			
			// Show the window
			fullScreenWindow.MakeKeyAndOrderFront (this);
			
			// Set the scene with the full-screen viewport and viewing transformation
			camera.init(viewRect);
//			scene.ResizeGLScene (viewRect);
			
			// Assign the view's MainController to self
			fullScreenView.MainController = this;
			
			if (!isAnimating) {
				// Mark the view as needing drawing to initalize its contents
				fullScreenView.NeedsDisplay = true;
			} else {
				// Start playing the animation
				fullScreenView.StartAnimation ();
				
			}
		}
开发者ID:interfaceVision,项目名称:monomac,代码行数:50,代码来源:MainWindowController.cs


示例7: DidFinishLaunching

        public override void DidFinishLaunching(NSNotification notification)
        {
            var menu = new NSMenu ();

            var menuItem = new NSMenuItem ();
            menu.AddItem (menuItem);

            var appMenu = new NSMenu ();
            var quitItem = new NSMenuItem ("Quit " + NSProcessInfo.ProcessInfo.ProcessName, "q", (s, e) => NSApplication.SharedApplication.Terminate (menu));
            appMenu.AddItem (quitItem);

            var window = new NSWindow ();

            menuItem.Submenu = appMenu;
            NSApplication.SharedApplication.MainMenu = menu;
        }
开发者ID:Sracinas,项目名称:XamarinTest,代码行数:16,代码来源:AppDelegate.cs


示例8: FinishedLaunching

		public override void FinishedLaunching (NSObject notification)
		{
			_window = new NSWindow (new RectangleF(200,200,400,700), NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled,
			                        NSBackingStore.Buffered, false, NSScreen.MainScreen);

			var setup = new Setup (this, _window);
			setup.Initialize ();

			var startup = Mvx.Resolve<IMvxAppStart> ();
			startup.Start ();

			_window.MakeKeyAndOrderFront (this);

			return;

		}
开发者ID:Dexyon,项目名称:MvvmCross-Samples,代码行数:16,代码来源:AppDelegate.cs


示例9: SelectFile

		public static void SelectFile(NSWindow window, NSTextField field)
		{
			NSOpenPanel openPanel = new NSOpenPanel ();
			openPanel.BeginSheet (window, (i) => {

				try {
					if (openPanel.Url != null) {
						string path = openPanel.Url.Path;

						if (!string.IsNullOrEmpty (path))
							field.StringValue = path;
					}
				} finally {
					openPanel.Dispose ();
				}


			});

		}
开发者ID:liftir,项目名称:airvpn-client,代码行数:20,代码来源:GuiUtils.cs


示例10: AQ_Exception

        /// <summary>
        /// Log Exception/Error. To display alert requires source NSWindow
        /// </summary>
        /// <param name="exception">Exception.</param>
        /// <param name="message">Message.</param>
        /// <param name="displayAlert">If set to <c>true</c> display alert.</param>
        /// <param name="source">Source.</param>
        public static void AQ_Exception(AQ_EXCEPTION_CODE exception, string message, bool displayAlert = true, NSWindow source = null)
        {
            // build entry
            string sExceptionEntry = string.Format ("{0} {1}{2}Exception: {3}{2}{4}"
                , DateTime.Now.ToShortDateString()
                , DateTime.Now.ToShortTimeString()
                , Environment.NewLine
                , exception
                , message);

            // add to log
            m_sLog += sExceptionEntry + Environment.NewLine;

            // display alert
            if (displayAlert) {
                // create and display alert
                NSAlert alert = new NSAlert ();
                alert.AlertStyle = NSAlertStyle.Warning;
                alert.MessageText = sExceptionEntry;
                alert.BeginSheet (source);
            }
        }
开发者ID:photo-bro,项目名称:AquaTempus,代码行数:29,代码来源:AQ_Exceptions.cs


示例11: BeginSheet

		public void BeginSheet (NSWindow sheet, NSWindow docWindow)
		{
			BeginSheet (sheet, docWindow, null, null, IntPtr.Zero);
		}
开发者ID:spicypixel-forks,项目名称:cs-monomac,代码行数:4,代码来源:BeginSheet.cs


示例12: ShowSheet

		public virtual void ShowSheet(NSWindow dockToWindow) {
			NSApplication.SharedApplication.BeginSheet(Window, dockToWindow);
			DidOpen(this, new EventArgs());
		}
开发者ID:kylewlacy,项目名称:electrolyte.net,代码行数:4,代码来源:SheetController.cs


示例13: Initialize

		// Shared initialization code
		void Initialize ()
		{
			//window = new NSWindow(new RectangleF(0,0, 470, 250), NSWindowStyle.Titled | NSWindowStyle.Closable, NSBackingStore.Buffered, false);
			window = new NSWindow(new RectangleF(0,0, 470, 250), NSWindowStyle.Titled, NSBackingStore.Buffered, false);
			window.HasShadow = true;
			NSView content = window.ContentView;
			window.WindowController = this;
			window.Title = "Sign In";
			NSTextField signInLabel = new NSTextField(new RectangleF(17, 190, 109, 17));
			signInLabel.StringValue = "Sign In:";
			signInLabel.Editable = false;
			signInLabel.Bordered = false;
			signInLabel.BackgroundColor = NSColor.Control;
			
			content.AddSubview(signInLabel);
			
			// Create our select button
			selectButton = new NSButton(new RectangleF(358,12,96,32));
			selectButton.Title = "Select";
			selectButton.SetButtonType(NSButtonType.MomentaryPushIn);
			selectButton.BezelStyle = NSBezelStyle.Rounded;
			
			selectButton.Activated += delegate {
				
				profileSelected();
			};
			
			selectButton.Enabled = false;
			
			content.AddSubview(selectButton);
			
			// Setup our table view
			NSScrollView tableContainer = new NSScrollView(new RectangleF(20,60,428, 123));
			tableContainer.BorderType = NSBorderType.BezelBorder;
			tableContainer.AutohidesScrollers = true;
			tableContainer.HasVerticalScroller = true;
			
			tableView = new NSTableView(new RectangleF(0,0,420, 123));
			tableView.UsesAlternatingRowBackgroundColors = true;
			
			NSTableColumn colGamerTag = new NSTableColumn("Gamer");
			tableView.AddColumn(colGamerTag);
			
			colGamerTag.Width = 420;
			colGamerTag.HeaderCell.Title = "Gamer Profile";
			tableContainer.DocumentView = tableView;
			
			content.AddSubview(tableContainer);
			
			// Create our add button
			NSButton addButton = new NSButton(new RectangleF(20,27,25,25));
			//Console.WriteLine(NSImage.AddTemplate);
			addButton.Image = NSImage.ImageNamed("NSAddTemplate");
			addButton.SetButtonType(NSButtonType.MomentaryPushIn);
			addButton.BezelStyle = NSBezelStyle.SmallSquare;
			
			addButton.Activated += delegate {
				addLocalPlayer();
			};
			content.AddSubview(addButton);
			
			// Create our remove button
			NSButton removeButton = new NSButton(new RectangleF(44,27,25,25));
			removeButton.Image = NSImage.ImageNamed("NSRemoveTemplate");
			removeButton.SetButtonType(NSButtonType.MomentaryPushIn);
			removeButton.BezelStyle = NSBezelStyle.SmallSquare;
			
			removeButton.Activated += delegate {
				removeLocalPlayer();
			};
			content.AddSubview(removeButton);			
			
			gamerList = MonoGameGamerServicesHelper.DeserializeProfiles();
			
//			for (int x= 1; x< 25; x++) {
//				gamerList.Add("Player " + x);
//			}
			tableView.DataSource = new GamersDataSource(this);
			tableView.Delegate = new GamersTableDelegate(this);
		}
开发者ID:Boerlam001,项目名称:MonoGame,代码行数:81,代码来源:SigninController.cs


示例14: ShouldZoom

			public override bool ShouldZoom (NSWindow window, RectangleF newFrame)
			{
				return _owner.AllowUserResizing;
			}
开发者ID:bwfox,项目名称:MonoGame,代码行数:4,代码来源:MacGamePlatform.cs


示例15: Run

		public static void Run (NSWindow mainForm)
		{
			MonoMacInit();
			NSApplication.Main (new string[]{});
		}
开发者ID:gabfr,项目名称:MonoMac.Windows.Form,代码行数:5,代码来源:Application.cs


示例16: WillResize

        public override SizeF WillResize(NSWindow sender, SizeF to_frame_size)
        {
            if (WindowResized != null)
                WindowResized (to_frame_size);

            return to_frame_size;
        }
开发者ID:neiljbrookes,项目名称:SparkleShare,代码行数:7,代码来源:SparkleEventLog.cs


示例17: RunSheetModal

		public int RunSheetModal (NSWindow window, NSApplication application)
		{
			if (application == null)
				throw new ArgumentNullException ("application");

			// same behavior as BeginSheet with a null window
			if (window == null)
				return RunModal ();

			int returnCode = -1000;

			BeginSheetForResponse (window, r => {
				returnCode = r;
				application.StopModal ();
			});

			application.RunModalForWindow (Window);

			return returnCode;
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:20,代码来源:NSAlert.cs


示例18: BeginSheetForResponse

		public void BeginSheetForResponse (NSWindow window, Action<int> onEnded)
		{
			BeginSheet (window, new NSAlertDidEndDispatcher (onEnded), NSAlertDidEndDispatcher.Selector, IntPtr.Zero);
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:4,代码来源:NSAlert.cs


示例19: RunModalSheet

		public int RunModalSheet (NSWindow parent)
		{
			var sel = new MonoMac.ObjCRuntime.Selector ("sheetSel");
			NSApplication.SharedApplication.BeginSheet (this, parent, this, sel, IntPtr.Zero);
			this.DidResignKey += StopSharedAppModal;
			try {
				sheet = true;
				return SaveIfOk (NSApplication.SharedApplication.RunModalForWindow (this));
			} finally {
				sheet = false;
				this.DidResignKey -= StopSharedAppModal;
			}
		}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:13,代码来源:SelectEncodingPanel.cs


示例20: ShowSheetWithTransaction

		public void ShowSheetWithTransaction(NSWindow dockToWindow, Transaction transaction) {
			Transaction = transaction;
			ShowSheet(dockToWindow);
		}
开发者ID:kylewlacy,项目名称:electrolyte.net,代码行数:4,代码来源:ConfirmTransactionSheetController.cs



注:本文中的MonoMac.AppKit.NSWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CoreGraphics.CGAffineTransform类代码示例发布时间:2022-05-26
下一篇:
C# AppKit.NSView类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap