예제 #1
0
        void ShowPopoverForLayer(CALayer layer)
        {
            if (popover != null)
            {
                return;
            }

            if (!layerToStatus.ContainsKey(layer.Name))
            {
                return;
            }

            CreatePopoverForLayer(layer);
            popover.Show(layer.Frame, this, NSRectEdge.MinYEdge);
        }
        private void UpdateInformationPopover(bool isReopenIfShown = true)
        {
            if (!NSThread.IsMain)
            {
                InvokeOnMainThread(() => UpdateInformationPopover(isReopenIfShown));
                return;
            }

            if (__GuiPopoverConnectionInfo == null)
            {
                return;
            }

            GuiGeoLookupView.Hidden         = __ProofsViewModel.State != ProofsViewModel.StateEnum.Ok;
            GuiGeoLookupCityView.Hidden     = __ProofsViewModel.State != ProofsViewModel.StateEnum.Ok || __ProofsViewModel.GeoLookup == null || string.IsNullOrEmpty(__ProofsViewModel.GeoLookup.City);
            GuiGeoLookupPublicIpView.Hidden = __ProofsViewModel.State != ProofsViewModel.StateEnum.Ok;

            GuiGeoLookupUpdateView.Hidden   = __ProofsViewModel.State != ProofsViewModel.StateEnum.Updating;
            GuiGeoLookupErrorView.Hidden    = __ProofsViewModel.State != ProofsViewModel.StateEnum.Error;
            GuiGeoLookupDurationView.Hidden = __MainViewModel.ConnectionState != ServiceState.Connected || __MainViewModel.PauseStatus != MainViewModel.PauseStatusEnum.Resumed;

            NSViewController informationPopoverController = new NSViewController();

            informationPopoverController.View = __InformationPopoverStacker.CreateView();

            __GuiPopoverConnectionInfo.ContentViewController = informationPopoverController;

            if (isReopenIfShown && __GuiPopoverConnectionInfo.Shown)
            {
                __GuiPopoverConnectionInfo.Show(GuiInformationButton.Bounds, GuiInformationButton, NSRectEdge.MinYEdge);
            }
        }
        partial void OnButtonPauseAddPressed(Foundation.NSObject sender)
        {
            if (__MainViewModel.ConnectionState != ServiceState.Connected)
            {
                return;
            }

            if (__MainViewModel.PauseStatus == MainViewModel.PauseStatusEnum.Paused)
            {
                if (__PausePopoverMenu == null)
                {
                    __PausePopoverMenu = new NSPopover();
                    NSViewController pausePopoverMenuController = new NSViewController();
                    pausePopoverMenuController.View = GuiPausePopoverView;

                    __PausePopoverMenu.ContentViewController = pausePopoverMenuController;
                    __PausePopoverMenu.Behavior = NSPopoverBehavior.Transient;
                }

                if (__PausePopoverMenu.Shown)
                {
                    __PausePopoverMenu.Close();
                }
                else
                {
                    __PausePopoverMenu.Show(PauseAddButton.Bounds, PauseAddButton, NSRectEdge.MaxYEdge);// MinYEdge);
                }
            }
        }
예제 #4
0
        void ShowPopoverForIcon(object sender, EventArgs args)
        {
            if (popover != null)
            {
                return;
            }

            var icon = (StatusIcon)sender;

            if (!CreatePopoverForIcon(icon))
            {
                return;
            }

            popover.Show(icon.Frame, this, NSRectEdge.MinYEdge);
        }
예제 #5
0
        private void ShowLoginErrorPopover(PopoverContentView contentView, NSView positioningView = null)
        {
            if (__LoginPopoverErrorInfo != null)
            {
                __LoginPopoverErrorInfo.Close();
                __LoginPopoverErrorInfo = null;
            }

            // create and show popover
            __LoginPopoverErrorInfo = new NSPopover();

            NSViewController popoverControllerConnectionError = new NSViewController();

            contentView.BackgroundColor           = NSColor.FromRgb(251, 56, 65);
            popoverControllerConnectionError.View = contentView;

            __LoginPopoverErrorInfo.ContentViewController = popoverControllerConnectionError;
            __LoginPopoverErrorInfo.Behavior = NSPopoverBehavior.Transient;

            if (positioningView == null)
            {
                positioningView = GuiTextViewUser;
            }
            __LoginPopoverErrorInfo.Show(GuiTextViewUser.Bounds, positioningView, NSRectEdge.MinYEdge);
        }
예제 #6
0
        private void ShowWindow()
        {
            if (_mainPage == null)
            {
                // If you dont need a navigation bar, just use this line
                //_mainPage = Application.Current.MainPage.CreateViewController();

                // Create a container view which shows the navigation bar
                var storyboard = NSStoryboard.FromName("Main", null);
                var controller = storyboard.InstantiateControllerWithIdentifier("Container") as Container;
                _mainPage = controller;
                controller.SetContent(Application.Current.MainPage.CreateViewController());
                _mainPage.View.Frame = new CoreGraphics.CGRect(0, 0, 400, 700);

                Application.Current.SendStart();
            }
            else
            {
                Application.Current.SendResume();
            }

            var popover = new NSPopover
            {
                ContentViewController = _mainPage,
                Behavior = NSPopoverBehavior.Transient,
                Delegate = new PopoverDelegate()
            };

            popover.Show(_statusBarItem.Button.Bounds, _statusBarItem.Button, NSRectEdge.MaxYEdge);
        }
예제 #7
0
        void HandleViewBookmarksBtnActivated(object sender, EventArgs e)
        {
            var popover = new NSPopover();

            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = new BookmarkAssistantController(AppDelegate.BookmarkManager.GetAllBookmarks());
            popover.Show(new CGRect(0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
        }
        public void HistoryButtonClick(NSObject sender)
        {
            var popover = new NSPopover();

            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = new HistoryPopoverController(popover, BookID);
            popover.Show(new CGRect(0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
        }
        //ToolBar Events

        partial void ShowServerInfo(NSObject sender)
        {
            var popover = new NSPopover();

            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = new ServerInfoPopOverController(this.Servernode, popover);
            popover.Show(CoreGraphics.CGRect.Empty, (NSView)sender, NSRectEdge.MinYEdge);
        }
 private void PopoverAddTagPanel(NSObject sender, string colorValue, string colorName)
 {
     this.Invoke(() => {
         var popover      = new NSPopover();
         popover.Behavior = NSPopoverBehavior.Transient;
         popover.ContentViewController = new AddTagsViewController(popover, this, colorValue, colorName, Guid.Empty);
         popover.Show(new CGRect(0, 0, 0, 0), (NSView)sender, NSRectEdge.MaxYEdge);
     }, 0.1f);
 }
예제 #11
0
        partial void shop_clicked(NSObject sender)
        {
            var popover    = new NSPopover();
            var storyboard = NSStoryboard.FromName("Main", null);

            popover.ContentViewController = storyboard.InstantiateControllerWithIdentifier("Shop") as NSViewController;
            popover.Behavior = NSPopoverBehavior.Transient;
            popover.Show(CoreGraphics.CGRect.Empty, (NSView)sender, NSRectEdge.MinYEdge);
        }
예제 #12
0
        partial void ShowNotes(NSObject sender)
        {
            popover = new NSPopover();
            ShowNotesPopupController controller = new ShowNotesPopupController();

            controller.NoteNodeClicked   += (s, e) => LoadNote(e.NoteId);
            popover.Behavior              = NSPopoverBehavior.Transient;
            popover.ContentViewController = controller;
            popover.Show(RectangleF.Empty, sender as NSView, NSRectEdge.MaxYEdge);
        }
예제 #13
0
        public void showPopover(NSObject sender)
        {
            var button = statusItem.Button;

            popover.Show(
                relativePositioningRect: button.Bounds,
                positioningView: button,
                preferredEdge: NSRectEdge.MinYEdge);
//            eventMonitor.start();
        }
예제 #14
0
        public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
        {
            popover = MakePopover(child);
            ViewBackend backend   = (ViewBackend)Toolkit.GetBackend(referenceWidget);
            var         reference = backend.Widget;

            popover.Show(positionRect.ToRectangleF(),
                         reference,
                         ToRectEdge(orientation));
        }
 void EditAnnotateMenuClick(NSObject sender)
 {
     this.Invoke(() => {
         var popover      = new NSPopover();
         popover.Behavior = NSPopoverBehavior.Transient;
         popover.ContentViewController = new AddAnnotationViewController(popover);
         CGRect rect = new CGRect(menuLocation.X, menuLocation.Y - 60, 5, 5);
         popover.Show(rect, ContentWebView, NSRectEdge.MinYEdge);
     }, 0.1f);
 }
예제 #16
0
        partial void thingsToDo_clicked(NSObject sender)
        {
            var popover = new NSPopover();

            this.View.AccessibilityEnabled = false;
            var storyboard = NSStoryboard.FromName("Main", null);

            popover.ContentViewController = storyboard.InstantiateControllerWithIdentifier("ThingsToDo") as NSViewController;
            popover.Behavior = NSPopoverBehavior.Transient;
            popover.Show(CoreGraphics.CGRect.Empty, (NSView)sender, NSRectEdge.MinYEdge);
        }
예제 #17
0
 private void MenuAction()
 {
     if (_pop.Shown)
     {
         _pop.Close();
     }
     else
     {
         _pop.Show(_statusItem.Button.Frame, _statusItem.Button, NSRectEdge.MaxYEdge);
     }
 }
예제 #18
0
        partial void OnGuiBtnWireguardTooltip(Foundation.NSObject sender)
        {
            var popover = new NSPopover {
                Behavior = NSPopoverBehavior.Transient
            };
            NSViewController informationPopoverController = new NSViewController();

            informationPopoverController.View = GuiPanelWireguardTooltip;

            popover.ContentViewController = informationPopoverController;
            popover.Show(GuiBtnWireguardTooltip.Bounds, GuiBtnWireguardTooltip, NSRectEdge.MinYEdge);
        }
예제 #19
0
        partial void OnInfoButtonFirewall(Foundation.NSObject sender)
        {
            NSViewController popoverController = new NSViewController();

            popoverController.View = GuiFirewallInfoView;

            NSPopover popover = new NSPopover();

            popover.ContentViewController = popoverController;
            popover.Behavior   = NSPopoverBehavior.Transient;
            popover.Appearance = NSPopoverAppearance.HUD;
            popover.Show(GuiFirewallSwitchControl.Bounds, GuiFirewallSwitchControl, NSRectEdge.MinYEdge);
        }
예제 #20
0
        public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
        {
            var controller = new FactoryViewController(child);

            popover          = new NSPopover();
            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = controller;
            ViewBackend backend   = (ViewBackend)Toolkit.GetBackend(referenceWidget);
            var         reference = backend.Widget;

            popover.Show(System.Drawing.RectangleF.Empty,
                         reference,
                         ToRectEdge(orientation));
        }
        partial void GotoPageNumber(NSObject sender)
        {
            this.Invoke(() => {
                var popover      = new NSPopover();
                popover.Behavior = NSPopoverBehavior.Transient;

                TOCNode currentToc = TOCDataManager.CurrentLeafNode;

                popover.ContentViewController = new GoPagePopViewController(popover, BookID, currentToc.ID);
                var button = (NSButton)sender;
                var frame  = button.Bounds;
                popover.Show(frame, (NSView)sender, NSRectEdge.MinYEdge);
            }, 0.1f);
        }
예제 #22
0
        void HandleAddBookmarkBtnActivated(object sender, EventArgs e)
        {
            var title = string.IsNullOrWhiteSpace(currentTitle) ? "No Title" : currentTitle;

            var entry = new BookmarkManager.Entry()
            {
                Name = title, Url = currentUrl, Notes = string.Empty
            };

            AppDelegate.BookmarkManager.AddBookmark(entry);
            var popover = new NSPopover();

            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = new BookmarkPopoverController(popover, entry);
            popover.Show(new CGRect(0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
        }
예제 #23
0
        public void ShowSettings(NSStatusItem statusBarItem)
        {
            if (MainPage == null)
            {
                CreateMainController();
                Current.SendStart();
            }

            var popover = new NSPopover
            {
                ContentViewController = controller,
                Behavior = NSPopoverBehavior.Transient,
                Delegate = new PopoverDelegate()
            };

            popover.Show(statusBarItem.Button.Bounds, statusBarItem.Button, NSRectEdge.MaxYEdge);
        }
예제 #24
0
        public void ShowPopoverForLayer(CALayer layer)
        {
            if (!layerToStatus.ContainsKey(layer.Name))
            {
                return;
            }

            var    field   = (NSTextField)popover.ContentViewController.View;
            string tooltip = layerToStatus [layer.Name].ToolTip;

            if (tooltip == null)
            {
                return;
            }

            field.AttributedStringValue = GetPopoverString(tooltip);
            popover.Show(layer.Frame, this, NSRectEdge.MinYEdge);
        }
예제 #25
0
        public void StartSearch(object sender, EventArgs e)
        {
            int      row  = (int)splitViewController.MainOutlineView.SelectedRow;
            NSObject item = splitViewController.MainOutlineView.ItemAtRow(row);

            if (item is VMDNSZoneEntryNode)
            {
                QueryRecordPopover          = new NSPopover();
                QueryRecordPopover.Behavior = NSPopoverBehavior.Transient;
                fwc = new FilterRecordsController((item as VMDNSZoneEntryNode).CurrentZone.Name, SearchRecordsField.StringValue, QueryRecordPopover);
                QueryRecordPopover.ContentViewController = fwc;
                QueryRecordPopover.Show(CoreGraphics.CGRect.Empty, (NSView)sender, NSRectEdge.MinYEdge);
            }
            else
            {
                UIErrorHelper.ShowAlert("", VMDNSConstants.SELECT_ZONE);
            }
        }
        /// <summary>
        /// Show popover (pressed Information button)
        /// </summary>
        partial void GuiInformationButtonPressed(Foundation.NSObject sender)
        {
            __GuiPopoverConnectionInfo = new NSPopover()
            {
                Behavior = NSPopoverBehavior.Transient, Appearance = NSPopoverAppearance.HUD
            };

            __ProofsViewModel.UpdateCommand.Execute(null);
            UpdateInformationPopover();

            if (__GuiPopoverConnectionInfo.Shown)
            {
                __GuiPopoverConnectionInfo.Close();
            }
            else
            {
                __GuiPopoverConnectionInfo.Show(GuiInformationButton.Bounds, GuiInformationButton, NSRectEdge.MinYEdge);
            }
        }
예제 #27
0
        partial void OnInfoButtonAntitracker(Foundation.NSObject sender)
        {
            NSViewController popoverController = new NSViewController();

            if (__MainViewModel.IsAntiTrackerEnabled && __MainViewModel.ConnectionState != ServiceState.Connected)
            {
                popoverController.View = GuiAntitrackerWhenConnectedInfo;
            }
            else
            {
                popoverController.View = GuiAntitrackerInfoView;
            }

            NSPopover popover = new NSPopover();

            popover.ContentViewController = popoverController;
            popover.Behavior   = NSPopoverBehavior.Transient;
            popover.Appearance = NSPopoverAppearance.HUD;
            popover.Show(GuiAntiTrackerSwitchControl.Bounds, GuiAntiTrackerSwitchControl, NSRectEdge.MinYEdge);
        }
        public void SearchFieldClick(NSObject sender)
        {
            var textField = (NSSearchField)sender;
            var keyword   = textField.StringValue;

            if (string.IsNullOrEmpty(keyword))
            {
                return;
            }

            this.Invoke(() => {
                var popover      = new NSPopover();
                popover.Behavior = NSPopoverBehavior.Transient;

                TOCNode currentToc = TOCDataManager.CurrentLeafNode;

                popover.ContentViewController = new SearchResultsController(popover, BookID, currentToc.ID, keyword);
                popover.Show(new CGRect(0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
            }, 0.1f);
        }
예제 #29
0
        partial void onClickThemePicker(NSObject sender)
        {
            if (_popoverViewController == null)
            {
                _popoverViewController = Storyboard.InstantiateControllerWithIdentifier("ThemePickerViewController") as ThemePickerViewController;
            }

            if (_popover == null)
            {
                _popover = new NSPopover();
                _popover.ContentViewController = _popoverViewController;
                _popover.SetAppearance(NSAppearance.GetAppearance(NSAppearance.NameVibrantLight));
                _popover.Animates     = true;
                _popover.Behavior     = NSPopoverBehavior.Transient;
                _popover.WeakDelegate = this;

                var button = sender as NSButton;
                _popover.Show(button.Frame, button, NSRectEdge.MaxXEdge);
            }
        }
        public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
        {
            popover = MakePopover(child, BackgroundColor);
            ViewBackend backend   = (ViewBackend)Toolkit.GetBackend(referenceWidget);
            var         reference = backend.Widget;

            // If the position rect is empty, the coordinates of the rect will be ignored.
            // Width and Height of the rect must be > Epsilon, for the positioning to function correctly.
            if (Math.Abs(positionRect.Width) < double.Epsilon)
            {
                positionRect.Width = 1;
            }
            if (Math.Abs(positionRect.Height) < double.Epsilon)
            {
                positionRect.Height = 1;
            }

            popover.Show(positionRect.ToCGRect(),
                         reference,
                         ToRectEdge(orientation));
        }
예제 #31
0
		void HandleViewBookmarksBtnActivated (object sender, EventArgs e)
		{
			if (!AppDelegate.IsOnLion) {
				ShowNonLionAlert ();
				return;
			}
			var popover = new NSPopover ();
			popover.Behavior = NSPopoverBehavior.Transient;
			popover.ContentViewController = new BookmarkAssistantController (AppDelegate.BookmarkManager.GetAllBookmarks ());
			popover.Show (new RectangleF (0, 0, 0, 0), viewBookmarksBtn, NSRectEdge.MinYEdge);
		}
예제 #32
0
		public void Show (Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
		{
			popover = MakePopover (child, BackgroundColor);
			popover.Delegate = new PopoverDelegate (sink);
			ViewBackend backend = (ViewBackend)Toolkit.GetBackend (referenceWidget);
			var reference = backend.Widget;

			// If the position rect is empty, the coordinates of the rect will be ignored.
			// Width and Height of the rect must be > Epsilon, for the positioning to function correctly.
			if (Math.Abs (positionRect.Width) < double.Epsilon)
				positionRect.Width = 1;
			if (Math.Abs (positionRect.Height) < double.Epsilon)
				positionRect.Height = 1;
			positionRect = new Rectangle(positionRect.X, positionRect.Y, positionRect.Width * 2, positionRect.Height); //It appears to be necessary to multiply the width by a factor of 2

			popover.Show (positionRect.ToCGRect (),
			              reference,
			              ToRectEdge (orientation));
		}
예제 #33
0
		public void Show (Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
		{
			popover = MakePopover (child);
			ViewBackend backend = (ViewBackend)Toolkit.GetBackend (referenceWidget);
			var reference = backend.Widget;
			popover.Show (positionRect.ToRectangleF (),
			              reference,
			              ToRectEdge (orientation));
		}
예제 #34
0
		public void Show (Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
		{
			popover = MakePopover (child, BackgroundColor);
			ViewBackend backend = (ViewBackend)Toolkit.GetBackend (referenceWidget);
			var reference = backend.Widget;

			// If the position rect is empty, the coordinates of the rect will be ignored.
			// Width and Height of the rect must be > Epsilon, for the positioning to function correctly.
			if (Math.Abs (positionRect.Width) < double.Epsilon)
				positionRect.Width = 1;
			if (Math.Abs (positionRect.Height) < double.Epsilon)
				positionRect.Height = 1;

			popover.Show (positionRect.ToCGRect (),
			              reference,
			              ToRectEdge (orientation));
		}
예제 #35
0
 public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
 {
     var controller = new FactoryViewController (child);
     popover = new NSPopover ();
     popover.Behavior = NSPopoverBehavior.Transient;
     popover.ContentViewController = controller;
     IMacViewBackend backend = (IMacViewBackend)Toolkit.GetBackend (referenceWidget);
     var reference = backend.View;
     popover.Show (System.Drawing.RectangleF.Empty,
                   reference,
                   ToRectEdge (orientation));
 }
예제 #36
0
		void HandleViewBookmarksBtnActivated (object sender, EventArgs e)
		{
			var popover = new NSPopover ();
			popover.Behavior = NSPopoverBehavior.Transient;
			popover.ContentViewController = new BookmarkAssistantController (AppDelegate.BookmarkManager.GetAllBookmarks ());
			popover.Show (new RectangleF (0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
		}
        //ToolBar Events

        partial void ShowServerInfo (NSObject sender)
        {
            var popover = new NSPopover ();
            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = new ServerInfoPopOverController (this.Servernode, popover);
            popover.Show (CoreGraphics.CGRect.Empty, (NSView)sender, NSRectEdge.MinYEdge);
        }
예제 #38
0
		void HandleAddBookmarkBtnActivated (object sender, EventArgs e)
		{
			var title = string.IsNullOrWhiteSpace (currentTitle) ? "No Title" : currentTitle;
			
			var entry = new BookmarkManager.Entry () { Name = title, Url = currentUrl, Notes = string.Empty };
			AppDelegate.BookmarkManager.AddBookmark (entry);
			var popover = new NSPopover ();
			popover.Behavior = NSPopoverBehavior.Transient;
			popover.ContentViewController = new BookmarkPopoverController (popover, entry);
			popover.Show (new RectangleF (0, 0, 0, 0), (NSView)sender, NSRectEdge.MinYEdge);
		}
예제 #39
0
파일: MyDocument.cs 프로젝트: garuma/Macboy
partial         void ShowNotes(NSObject sender)
        {
            using (NSPopover popover = new NSPopover ()) {
                var controller = new ShowNotesPopupController ();
                controller.NoteNodeClicked += (s, e) => LoadNote (e.NoteId);
                popover.Behavior = NSPopoverBehavior.Transient;
                popover.ContentViewController = controller;
                popover.Show (RectangleF.Empty, sender as NSView, NSRectEdge.MaxYEdge);
            }
        }