Beispiel #1
0
        public NSViewController GetViewer(object value, bool createInspector)
        {
            var vc = value as NSViewController;

            if (vc != null)
            {
                return(vc);
            }

            var sv = GetSpecialView(value);

            vc = sv as NSViewController;
            if (vc != null && vc.ParentViewController == null)
            {
                return(vc);
            }

            var v = sv as NSView;

            if (v != null && v.Superview == null)
            {
                vc      = new NSViewController();
                vc.View = v;
                return(vc);
            }

            return(null);
        }
 void ShowLoginPage()
 {
     Header.StringValue      = Properties_Resources.Where;
     Description.StringValue = String.Empty;
     SubController           = new SetupSubLoginController(Controller);
     Content.ContentView     = SubController.View;
 }
Beispiel #3
0
        public override void WindowControllerDidLoadNib(NSWindowController windowController)
        {
            base.WindowControllerDidLoadNib(windowController);

            // Add code to here after the controller has loaded the document window

            // Populate the popup menu
            NSMenu menu = popup.Menu;

            NSViewController vc = viewControllers.GetItem <NSViewController>(0);
            NSMenuItem       mi = new NSMenuItem(vc.Title, null, "");

            // Set CMD-B as the key equvialent
//			NSMenuItem mi = new NSMenuItem(vc.Title, null, "b");
//			mi.KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask;
            menu.AddItem(mi);

            vc = viewControllers.GetItem <NSViewController>(1);
            mi = new NSMenuItem(vc.Title, null, "");
            // Set CMD-A as the key equvialent
//			mi = new NSMenuItem(vc.Title, null, "a");
//			mi.KeyEquivalentModifierMask = NSEventModifierMask.CommandKeyMask;
            menu.AddItem(mi);

            // Initially show the first controller.
            popup.SelectItem(0);
            DisplayViewController(viewControllers.GetItem <NSViewController>(0));
        }
 void ShowView(NSViewController vc)
 {
     if (vc?.View != null)
     {
         vc.View.Hidden = false;
     }
 }
Beispiel #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);
        }
 void ShowSettingsPage()
 {
     Header.StringValue      = Properties_Resources.Settings;
     Description.StringValue = "";
     SubController           = new SetupSubSettingController(Controller);
     Content.ContentView     = SubController.View;
 }
 void ShowFinishedPage()
 {
     Header.StringValue      = Properties_Resources.Ready;
     Description.StringValue = Properties_Resources.YouCanFind;
     SubController           = new SetupSubFinishedController(Controller);
     Content.ContentView     = SubController.View;
 }
        public void StartPressed40911()
        {
            var loginViewController = new NSViewController {
                View = { }
            };
            var button = NSButtonExtensions.CreateButton("Login", () =>
            {
                Xamarin.Forms.Application.Current.MainPage = new ContentPage {
                    Content = new Label {
                        Text = "40911 Success"
                    }
                };
                //loginViewController.DismissViewController()true, null);
            });

            button.Frame = new CGRect(20, 100, 200, 44);
            loginViewController.View.AddSubview(button);

            var window = NSApplication.SharedApplication.KeyWindow;
            var vc     = window.ContentViewController;

            while (vc.PresentedViewControllers.Length > 0)
            {
                vc = vc.PresentedViewControllers[0];
            }

            //vc.PresentViewController(loginViewController, new NSViewControllerPresentationAnimator();
        }
Beispiel #9
0
 /// <summary>
 /// Called when this is being created via XIB/NIB.
 /// </summary>
 /// <param name="controller">The controller for the view.</param>
 public virtual void AwakeFromNib(NSViewController controller)
 {
     foreach (var command in CommandList.OfType <VisualRelayCommand>())
     {
         var visual = controller.GetValue(command.UniqueId) as NSObject;
         if (visual != null)
         {
             AttachActivateHandler(command, visual);
             if (command.Visual == null)
             {
                 command.Visual = visual;
             }
             else
             {
                 var additionalVisuals = command.GetValue(AdditionalVisualsPropertyName) as IList <object>;
                 if (additionalVisuals == null)
                 {
                     additionalVisuals = new List <object>();
                 }
                 additionalVisuals.Add(visual);
                 command.SetValue(AdditionalVisualsPropertyName, additionalVisuals);
             }
             visual.SetValue(AttachedCommandPropertyName, command);
             var view = visual as NSView;
             if ((view != null) && !string.IsNullOrEmpty(command.ToolTip))
             {
                 view.ToolTip = command.ToolTip.SafeString();
             }
         }
     }
 }
Beispiel #10
0
        /// <summary>
        /// Disable resizing of the given controller's view based on the width
        /// of the given subview.
        /// </summary>
        /// <param name="controller"></param>
        /// <param name="subView"></param>
        public void DisableResizing(NSViewController controller, NSView subView)
        {
            // Set a dummy name for the subview.
            string controlName = "subview";

            // Get the distance from the top of the subview to the top of the containing view;
            CGRect subViewFrame = subView.Frame;
            nfloat yFromTop     = controller.View.Frame.Height - subViewFrame.Height - subViewFrame.Y;

            // Get views being constrained.
            var views = new NSMutableDictionary();

            views.Add(new NSString(controlName), subView);

            // Define format and assemble constraints.
            // (sorry, couln't find an other way to disable resizing)
            var horzFormat      = $"|-[{controlName}]-|";
            var horzConstraints = NSLayoutConstraint.FromVisualFormat(horzFormat, NSLayoutFormatOptions.None, null, views);

            var vertFormat      = $"V:|-{yFromTop}-[{controlName}]";
            var vertConstraints = NSLayoutConstraint.FromVisualFormat(vertFormat, NSLayoutFormatOptions.None, null, views);

            // Apply constraints.
            NSLayoutConstraint.ActivateConstraints(horzConstraints);
            NSLayoutConstraint.ActivateConstraints(vertConstraints);
        }
 void ShowWelcomePage()
 {
     Header.StringValue      = Properties_Resources.Ready;
     Description.StringValue = String.Empty;
     SubController           = new SetupSubWelcomeController(Controller);
     Content.ContentView     = SubController.View;
 }
 void ShowCustomizePage()
 {
     Header.StringValue      = Properties_Resources.Customize;
     Description.StringValue = String.Empty;
     SubController           = new SetupSubCustomizeController(Controller);
     Content.ContentView     = SubController.View;
 }
Beispiel #13
0
        protected virtual void ShowWindowViewController(
            NSViewController viewController,
            MvxWindowPresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var window = new NSWindow(
                new CGRect(attribute.PositionX, attribute.PositionY, attribute.Width, attribute.Height),
                attribute.WindowStyle,
                attribute.BufferingType,
                false,
                NSScreen.MainScreen)
            {
                Identifier = attribute.Identifier ?? viewController.GetType().Name
            };

            if (!string.IsNullOrEmpty(viewController.Title))
            {
                window.Title = viewController.Title;
            }

            Windows.Add(window);
            window.ContentView           = viewController.View;
            window.ContentViewController = viewController;

            var windowController = CreateWindowController(window);

            windowController.ShouldCascadeWindows = true;
            windowController.ShowWindow(null);
        }
        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);
                }
            }
        }
        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);
            }
        }
        void ShowTutorialPage()
        {
            SubController = new SetupSubTutorialController(Controller);
            switch (Controller.TutorialCurrentPage)
            {
            case 1:
                Header.StringValue = Properties_Resources.WhatsNext;
                SubController      = new SetupSubTutorialBeginController(Controller);
                break;

            case 2:
                Header.StringValue = Properties_Resources.Synchronization;
                SubController      = new SetupSubTutorialController(Controller);
                break;

            case 3:
                Header.StringValue = Properties_Resources.StatusIcon;
                SubController      = new SetupSubTutorialController(Controller);
                break;

            case 4:
                Header.StringValue = String.Format(Properties_Resources.AddFolders, Properties_Resources.ApplicationName);
                SubController      = new SetupSubTutorialEndController(Controller);
                break;
            }
            Description.StringValue = String.Empty;
            Content.ContentView     = SubController.View;
        }
Beispiel #17
0
        public override NSTabViewItem GetTabViewItem(NSViewController viewController)
        {
            var item = base.GetTabViewItem(viewController);

            if (item == null)
            {
                return(null);
            }

            if (viewController is WorkbookViewController)
            {
                item.Image = NSImage.ImageNamed("ToolbarConsoleTemplate");
                if (Session != null)
                {
                    if (Session.SessionKind == ClientSessionKind.Workbook)
                    {
                        item.Label   = Catalog.GetString("Workbook");
                        item.ToolTip = Catalog.GetString("Show the workbook view");
                    }
                    else
                    {
                        item.Label   = Catalog.GetString("REPL");
                        item.ToolTip = Catalog.GetString("Show the REPL view");
                    }
                }
            }
            else if (viewController is ViewInspectorMainViewController)
            {
                item.Image   = NSImage.ImageNamed("ToolbarHierarchyTemplate");
                item.Label   = Catalog.GetString("View Inspector");
                item.ToolTip = Catalog.GetString("Show the view inspector");
            }

            return(item);
        }
Beispiel #18
0
        private void DisplaySubview(NSViewController controller, SubviewType type)
        {
            // Is this view already displayed?
            if (ViewType == type)
            {
                return;
            }

            // Is there a view already being displayed?
            if (Subview != null)
            {
                // Yes, remove it from the view
                Subview.RemoveFromSuperview();

                // Release memory
                Subview           = null;
                SubviewController = null;
            }

            // Save values
            ViewType          = type;
            SubviewController = controller;
            Subview           = controller.View;

            // Define frame and display
            Subview.Frame = new CGRect(0, 0, ViewContainer.Frame.Width, ViewContainer.Frame.Height);
            ViewContainer.AddSubview(Subview);
        }
        private void SwapSplitViewItem(int position, NSViewController vc)
        {
            try
            {
                if (vc != null && position < 2)
                {
                    var sv = this.SplitViewItems[position];
                    if (sv != null)
                    {
                        var splitView = new NSSplitViewItem {
                            ViewController = vc
                        };

                        this.InsertSplitViewItem(splitView, position);
                        this.RemoveSplitViewItem(sv);

                        //clean up memory
                        sv.Dispose();
                        sv = null;
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error: {ex.Message} \n\nStack Trace: {ex.StackTrace}");
            }
        }
Beispiel #20
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);
        }
 void ShowRepoSelectPage()
 {
     Header.StringValue      = Properties_Resources.Which;
     Description.StringValue = String.Empty;
     SubController           = new SetupSubRepoSelectController(Controller);
     Content.ContentView     = SubController.View;
 }
        protected void SwitchContent(NSViewController viewController)
        {
            if (currentView != null)
            {
                currentView.View.RemoveFromSuperview();
                var childIndex = Array.IndexOf(ChildViewControllers, currentView);
                this.RemoveChildViewController(childIndex);
            }

            //TODO: Get Title
            //var navItem = view as INavigationItem;
            //Toolbar.Title = navItem?.Title ?? "";
            //if (navItem != null) {
            //	navItem.NavigationController = this;
            //}
            Toolbar.Title            = "Test";
            Toolbar.BackButtonHidden = BackStack.Count <= 1;



            viewController.View.Frame            = MainContentView.Bounds;
            viewController.View.AutoresizingMask = NSViewResizingMask.WidthSizable | NSViewResizingMask.HeightSizable;
            this.AddChildViewController(viewController);
            MainContentView.AddSubview(viewController.View);
            currentView = viewController;
        }
 void HideView(NSViewController vc)
 {
     if (vc?.View != null)
     {
         vc.View.Hidden = true;
     }
 }
Beispiel #24
0
        public override void WindowDidLoad()
        {
            base.WindowDidLoad();

            this.ActivateWindowDrag();

            viewController = this.ContentViewController;
        }
Beispiel #25
0
        public void NSSplitViewItemShouldCreateFromViewController()
        {
            var viewController = new NSViewController();
            var splitViewItem  = NSSplitViewItem.FromViewController(viewController);

            Assert.IsFalse(splitViewItem == null, "NSSplitViewItemShouldCreateFromViewController - Returned null");
            Assert.IsTrue(splitViewItem.ViewController == viewController, "NSSplitViewItemShouldCreateFromViewController - ViewController property not set correctly");
        }
Beispiel #26
0
 /// <summary>
 /// Wraps the specified <paramref name="viewController"/> to an Eto control that can be used directly in Eto.Forms code.
 /// </summary>
 /// <returns>The eto control wrapper around the native control.</returns>
 /// <param name="viewController">Native control to wrap.</param>
 public static Control ToEto(this NSViewController viewController)
 {
     if (viewController == null)
     {
         return(null);
     }
     return(new Control(new NativeControlHandler(viewController)));
 }
Beispiel #27
0
        public void Setup()
        {
            Asserts.EnsureYosemite();

            source      = new NSViewController();
            destination = new NSViewController();
            segue       = new NSStoryboardSegue("Test", source, destination);
        }
        public void ShowWaitingView()
        {
            NSViewController viewController = Storyboard.InstantiateControllerWithIdentifier("WaitingViewController") as NSViewController;

            PresentViewController(viewController, new ViewAnimator());

            modalViewControllers.Push(viewController);
        }
Beispiel #29
0
        protected virtual void ShowSheetViewController(
            NSViewController viewController,
            MvxSheetPresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var window = Windows.FirstOrDefault(w => w.Identifier == attribute.WindowIdentifier) ?? Windows.Last();

            window.ContentViewController.PresentViewControllerAsSheet(viewController);
        }
        public void ShowTabView(NSViewController viewController, string tabTitle)
        {
            AddChildViewController(viewController);

            if (!string.IsNullOrEmpty(tabTitle))
            {
                TabViewItems[ChildViewControllers.Count() - 1].Label = tabTitle;
            }
        }
		protected virtual void Show(NSViewController viewController, MvxViewModelRequest request)
		{
			while (Window.ContentView.Subviews.Any()) {
				Window.ContentView.Subviews [0].RemoveFromSuperview ();
			}

            Window.ContentView.AddSubview(viewController.View);

            AddLayoutConstraints(viewController, request);
		}
Beispiel #32
0
		private void DisplaySubview(NSViewController controller, SubviewType type) {

			// Is this view already displayed?
			if (ViewType == type) return;

			// Is there a view already being displayed?
			if (Subview != null) {
				// Yes, remove it from the view
				Subview.RemoveFromSuperview ();

				// Release memory
				Subview = null;
				SubviewController = null;
			}

			// Save values
			ViewType = type;
			SubviewController = controller;
			Subview = controller.View;

			// Define frame and display
			Subview.Frame = new CGRect (0, 0, ViewContainer.Frame.Width, ViewContainer.Frame.Height);
			ViewContainer.AddSubview (Subview);

			// Take action on type
			switch (type) {
			case SubviewType.TableBinding:
				AddButton.Active = true;
				EditButton.Active = true;
				DeleteButton.Active = true;
				Search.Enabled = true;
				break;
			case SubviewType.CollectionView:
				AddButton.Active = true;
				EditButton.Active = true;
				DeleteButton.Active = true;
				Search.Enabled = true;
				break;
			default:
				AddButton.Active = false;
				EditButton.Active = false;
				DeleteButton.Active = false;
				Search.Enabled = false;
				break;
			}
		}
//        partial void OkClicked (NSObject sender)
//        {                       
//            (WindowController as PreferencesWindowController).OkPressed();
//            Close();
//        }

        private void ShowPanel(NSViewController controller) {

            // Is there a view already being displayed?
            if (_subview != null) {
                // Yes, remove it from the view
                _subview.RemoveFromSuperview ();

                // Release memory
                _subview = null;
                _subviewController = null;
            }

            // Save values
            _subviewController = controller;
            _subview = controller.View;

            // Define frame and display
            _subview.Frame = new CGRect (0, 0, _preferencesView.Frame.Width, _preferencesView.Frame.Height);
            _preferencesView.AddSubview (_subview);
        }
Beispiel #34
0
		private void DisplaySubview(NSViewController controller, SubviewType type) {

			// Is this view already displayed?
			if (ViewType == type) return;

			// Is there a view already being displayed?
			if (Subview != null) {
				// Yes, remove it from the view
				Subview.RemoveFromSuperview ();

				// Release memory
				Subview = null;
				SubviewController = null;
			}

			// Save values
			ViewType = type;
			SubviewController = controller;
			Subview = controller.View;

			// Define frame and display
			Subview.Frame = new CGRect (0, 0, ViewContainer.Frame.Width, ViewContainer.Frame.Height);
			ViewContainer.AddSubview (Subview);
		}
Beispiel #35
0
		public NSViewController GetViewer(object value, bool createInspector)
		{
			var vc = value as NSViewController;
			if (vc != null)
				return vc;

			var sv = GetSpecialView(value);

			vc = sv as NSViewController;
			if (vc != null && vc.ParentViewController == null)
			{
				return vc;
			}

			var v = sv as NSView;
			if (v != null && v.Superview == null)
			{
				vc = new NSViewController();
				vc.View = v;
				return vc;
			}

			return null;
		}
        protected virtual void AddLayoutConstraints(NSViewController viewController, MvxViewModelRequest request)
        {
            var child = viewController.View;
            var container = Window.ContentView;

            // See http://blog.xamarin.com/autolayout-with-xamarin.mac/ for more on constraints
            // as well as https://gist.github.com/garuma/3de3bbeb954ad5679e87 (latter maybe helpful as tools...)

            child.TranslatesAutoresizingMaskIntoConstraints = false;
            container.AddConstraints(new[] {
                NSLayoutConstraint.Create (child, NSLayoutAttribute.Left, NSLayoutRelation.Equal, container, NSLayoutAttribute.Left, 1, 0),
                NSLayoutConstraint.Create (child, NSLayoutAttribute.Right, NSLayoutRelation.Equal, container, NSLayoutAttribute.Right, 1, 0),
                NSLayoutConstraint.Create (child, NSLayoutAttribute.Top, NSLayoutRelation.Equal, container, NSLayoutAttribute.Top, 1, 0),
                NSLayoutConstraint.Create (child, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, container, NSLayoutAttribute.Bottom, 1, 0),
            });
        }
Beispiel #37
0
 void SwitchToController(NSViewController theController)
 {
     if (theController == currentController) {
         return;
     }
     libraryBox.ContentView = theController.View;
     currentController = theController;
     if (theController is LibraryGridViewController) {
         gridViewMenuItem.State = NSCellStateValue.On;
         listViewMenuItem.State = NSCellStateValue.Off;
         viewSwitcher.SelectedSegment = 1;
     } else if (theController is LibraryListViewController) {
         gridViewMenuItem.State = NSCellStateValue.Off;
         listViewMenuItem.State = NSCellStateValue.On;
         viewSwitcher.SelectedSegment = 0;
     }
 }
 void ShowTutorialPage()
 {
     SubController = new SetupSubTutorialController (Controller);
     switch (Controller.TutorialCurrentPage) {
     case 1:
         Header.StringValue = Properties_Resources.WhatsNext;
         SubController = new SetupSubTutorialBeginController (Controller);
         break;
     case 2:
         Header.StringValue = Properties_Resources.Synchronization;
         SubController = new SetupSubTutorialController (Controller);
         break;
     case 3:
         Header.StringValue = Properties_Resources.StatusIcon;
         SubController = new SetupSubTutorialController (Controller);
         break;
     case 4:
         Header.StringValue = Properties_Resources.AddFolders;
         SubController = new SetupSubTutorialEndController (Controller);
         break;
     }
     Description.StringValue = "";
     Content.ContentView = SubController.View;
 }
 void ShowWelcomePage()
 {
     Header.StringValue = Properties_Resources.Ready;
     Description.StringValue = "";
     SubController = new SetupSubWelcomeController (Controller);
     Content.ContentView = SubController.View;
 }
 void ShowFinishedPage()
 {
     Header.StringValue = Properties_Resources.Ready;
     Description.StringValue = Properties_Resources.YouCanFind;
     SubController = new SetupSubFinishedController (Controller);
     Content.ContentView = SubController.View;
 }
		void SwitchView (NSViewController controller, string name)
		{
			if (currentController != null)
				currentController.View.RemoveFromSuperview ();

			currentController = controller;
			AsyncTaskRunnerController.Switch (((IAsyncViewController)controller).TaskRunner);
			View.AddSubview (controller.View);
			currentController.View.Frame = View.Bounds;
			currentController.View.AutoresizingMask = NSViewResizingMask.HeightSizable |
				NSViewResizingMask.WidthSizable;

			Window.Title = name;
		}
		/// <summary>
		/// Sets the inspector panel.
		/// </summary>
		/// <param name="panel">The new Inspector Panel (<c>View Controller</c>) to display.</param>
		/// <remarks>If the <c>panel</c> is <c>null</c>, the current panel is removed from the 
		/// screen.</remarks>
		public void SetInspectorPanel (NSViewController panel)
		{
			// Remove existing panel
			if (InspectorPanel != null) {
				InspectorPanel.View.RemoveFromSuperview ();
				InspectorPanel.RemoveFromParentViewController ();
			}

			// Save new panel
			InspectorPanel = panel;

			// Insert new panel
			if (panel != null) {
				AddChildViewController (panel);
				View.AddSubview (panel.View);
			}
		}
Beispiel #43
0
 void ShowSettingsPage()
 {
     Header.StringValue = Properties_Resources.Settings;
     Description.StringValue = "";
     SubController = new SetupSubSettingController(Controller);
     Content.ContentView = SubController.View;
 }
Beispiel #44
0
		async Task ShowViewerAsync(NSViewController vc)
		{
		}
 void ShowLoginPage()
 {
     Header.StringValue = Properties_Resources.Where;
     Description.StringValue = "";
     SubController = new SetupSubLoginController (Controller);
     Content.ContentView = SubController.View;
 }
Beispiel #46
0
        private void DisplayViewController(NSViewController vc)
        {
            BeginInvokeOnMainThread(() => {
                NSWindow w = box.Window;

                bool ended = w.MakeFirstResponder(w);
                if (!ended) {
                    AppKitFramework.NSBeep();
                    return;
                }
                // get the new View
                NSView newView = vc.View;

                // Get the old View
                NSView oldView = (NSView)box.ContentView;

                if (oldView == newView)
                    return;

                // Compute the new window frame
                CGSize currentSize = oldView.Frame.Size;
                CGSize newSize = newView.Frame.Size;

                nfloat deltaWidth = newSize.Width - currentSize.Width;
                nfloat deltaHeight = newSize.Height - currentSize.Height;
                CGRect windowframe = w.Frame;
                windowframe.Size = new CGSize(windowframe.Size.Width, windowframe.Size.Height + deltaHeight);
                windowframe.Location = new CGPoint(windowframe.Location.X, windowframe.Location.Y - deltaHeight);
                windowframe.Size = new CGSize(windowframe.Size.Width + deltaWidth, windowframe.Size.Height);

                NSDictionary windowResize = NSDictionary.FromObjectsAndKeys( new NSObject[]{w, NSValue.FromCGRect(windowframe)}, new NSObject[]{NSViewAnimation.TargetKey, NSViewAnimation.EndFrameKey});
                NSDictionary oldViewFadeOut = NSDictionary.FromObjectsAndKeys( new NSObject[]{oldView, NSViewAnimation.FadeOutEffect}, new NSObject[]{NSViewAnimation.TargetKey, NSViewAnimation.EffectKey});
                NSDictionary newViewFadeOut = NSDictionary.FromObjectsAndKeys( new NSObject[]{newView, NSViewAnimation.FadeOutEffect}, new NSObject[]{NSViewAnimation.TargetKey, NSViewAnimation.EffectKey});
                NSDictionary fadeIn = NSDictionary.FromObjectsAndKeys( new NSObject[]{newView, NSViewAnimation.FadeInEffect}, new NSObject[]{NSViewAnimation.TargetKey, NSViewAnimation.EffectKey});

                NSViewAnimation animation = new NSViewAnimation(new NSDictionary[]{oldViewFadeOut});
                animation.AnimationBlockingMode = NSAnimationBlockingMode.Blocking;
                animation.AnimationCurve = NSAnimationCurve.Linear;
                animation.Duration = 0.1;
                animation.StartAnimation();

                NSViewAnimation animation2 = new NSViewAnimation(new NSDictionary[]{newViewFadeOut});
                animation2.AnimationBlockingMode = NSAnimationBlockingMode.Blocking;
                animation2.Duration = 0.0;
                animation2.StartAnimation();

                box.ContentView = newView;

                NSViewAnimation animation3 = new NSViewAnimation(new NSDictionary[]{windowResize});
                animation3.AnimationBlockingMode = NSAnimationBlockingMode.Blocking;
                animation3.AnimationCurve = NSAnimationCurve.EaseInOut;
                animation3.Duration = 0.2;
                animation3.StartAnimation();

                NSViewAnimation animation4 = new NSViewAnimation(new NSDictionary[]{fadeIn});
                animation4.AnimationBlockingMode = NSAnimationBlockingMode.Blocking;
                animation4.AnimationCurve = NSAnimationCurve.Linear;
                animation4.Duration = 0.1;
                animation4.StartAnimation();
            });
        }
 void ShowRepoSelectPage()
 {
     Header.StringValue = Properties_Resources.Which;
     Description.StringValue = "";
     SubController = new SetupSubRepoSelectController (Controller);
     Content.ContentView = SubController.View;
 }
 void ShowCustomizePage()
 {
     Header.StringValue = Properties_Resources.Customize;
     Description.StringValue = "";
     SubController = new SetupSubCustomizeController (Controller);
     Content.ContentView = SubController.View;
 }
		protected virtual void PlaceView(MvxShowViewModelRequest request, NSViewController viewController)
		{
			Window.ContentView.AddSubview(viewController.View);
		}