Esempio n. 1
0
        internal virtual void AttachMainToolbar(Gtk.VBox parent, IMainToolbarView toolbar)
        {
            var toolbarBox = new Gtk.HBox();

            parent.PackStart(toolbarBox, false, false, 0);
            toolbarBox.PackStart((MainToolbar)toolbar, true, true, 0);
        }
        public MainToolbarController(IMainToolbarView toolbarView)
        {
            ToolbarView = toolbarView;
            // Attach run button click handler.
            toolbarView.RunButtonClicked += HandleStartButtonClicked;

            // Register Search Entry handlers.
            ToolbarView.SearchEntryChanged += HandleSearchEntryChanged;
            ToolbarView.SearchEntryActivated += HandleSearchEntryActivated;
            ToolbarView.SearchEntryKeyPressed += HandleSearchEntryKeyPressed;
            ToolbarView.SearchEntryResized += (o, e) => PositionPopup ();
            ToolbarView.SearchEntryLostFocus += (o, e) => {
                ToolbarView.SearchText = "";
                DestroyPopup ();
            };

            toolbarView.ConfigurationChanged += HandleConfigurationChanged;
            toolbarView.RunConfigurationChanged += HandleRunConfigurationChanged;
            toolbarView.RuntimeChanged += HandleRuntimeChanged;

            IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
                if (args.Event is Gdk.EventConfigure)
                    PositionPopup ();
            };

            // Update Search Entry on keybinding change.
            var cmd = IdeApp.CommandService.GetCommand (Commands.NavigateTo);
            cmd.KeyBindingChanged += delegate {
                UpdateSearchEntryLabel ();
            };

            executionTargetsChanged = (sender, e) => UpdateCombos ();

            IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;

            IdeApp.Workspace.FirstWorkspaceItemRestored += (sender, e) => {
                IdeApp.Workspace.ConfigurationsChanged += HandleUpdateCombos;
                IdeApp.Workspace.ActiveConfigurationChanged += HandleUpdateCombos;

                IdeApp.Workspace.SolutionLoaded += HandleSolutionLoaded;
                IdeApp.Workspace.SolutionUnloaded += HandleUpdateCombos;
                IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleUpdateCombos;

                UpdateCombos ();
            };

            IdeApp.Workspace.LastWorkspaceItemClosed += (sender, e) => {
                IdeApp.Workspace.ConfigurationsChanged -= HandleUpdateCombos;
                IdeApp.Workspace.ActiveConfigurationChanged -= HandleUpdateCombos;

                IdeApp.Workspace.SolutionLoaded -= HandleSolutionLoaded;
                IdeApp.Workspace.SolutionUnloaded -= HandleUpdateCombos;

                IdeApp.ProjectOperations.CurrentSelectedSolutionChanged -= HandleUpdateCombos;

                StatusBar.ShowReady ();
            };

            AddinManager.ExtensionChanged += OnExtensionChanged;
        }
Esempio n. 3
0
        internal override void AttachMainToolbar(Gtk.VBox parent, IMainToolbarView toolbar)
        {
            var      nativeToolbar = (MonoDevelop.MacIntegration.MainToolbar.MainToolbar)toolbar;
            NSWindow w             = GtkQuartz.GetWindow(nativeToolbar.gtkWindow);

            if (MacSystemInformation.OsVersion >= MacSystemInformation.Yosemite)
            {
                w.TitleVisibility = NSWindowTitleVisibility.Hidden;
            }

            w.Toolbar = nativeToolbar.widget;
            nativeToolbar.Initialize();
        }
		public MainToolbarController (IMainToolbarView toolbarView)
		{
			ToolbarView = toolbarView;
			// Attach run button click handler.
			toolbarView.RunButtonClicked += HandleStartButtonClicked;

			// Register Search Entry handlers.
			ToolbarView.SearchEntryChanged += HandleSearchEntryChanged;
			ToolbarView.SearchEntryActivated += HandleSearchEntryActivated;
			ToolbarView.SearchEntryKeyPressed += HandleSearchEntryKeyPressed;
			ToolbarView.SearchEntryResized += (o, e) => PositionPopup ();
			ToolbarView.SearchEntryLostFocus += (o, e) => {
				ToolbarView.SearchText = "";
				DestroyPopup ();
			};

			toolbarView.ConfigurationChanged += HandleConfigurationChanged;
			toolbarView.RunConfigurationChanged += HandleRunConfigurationChanged;
			toolbarView.RuntimeChanged += HandleRuntimeChanged;

			IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
				if (args.Event is Gdk.EventConfigure)
					PositionPopup ();
			};

			// Update Search Entry on keybinding change.
			var cmd = IdeApp.CommandService.GetCommand (Commands.NavigateTo);
			cmd.KeyBindingChanged += delegate {
				UpdateSearchEntryLabel ();
			};

			executionTargetsChanged = (sender, e) => UpdateCombos ();

			IdeApp.Workspace.LastWorkspaceItemClosed += (sender, e) => StatusBar.ShowReady ();
			IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos ();
			IdeApp.Workspace.ConfigurationsChanged += (sender, e) => UpdateCombos ();

			IdeApp.Workspace.SolutionLoaded += (sender, e) => UpdateCombos ();
			IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos ();

			IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;

			AddinManager.ExtensionChanged += OnExtensionChanged;
		}
Esempio n. 5
0
		internal override void AttachMainToolbar (Gtk.VBox parent, IMainToolbarView toolbar)
		{
			var nativeToolbar = (MonoDevelop.MacIntegration.MainToolbar.MainToolbar)toolbar;
			NSWindow w = GtkQuartz.GetWindow (nativeToolbar.gtkWindow);
			if (MacSystemInformation.OsVersion >= MacSystemInformation.Yosemite)
				w.TitleVisibility = NSWindowTitleVisibility.Hidden;

			w.Toolbar = nativeToolbar.widget;
			nativeToolbar.Initialize ();
		}
		internal virtual void AttachMainToolbar (Gtk.VBox parent, IMainToolbarView toolbar)
		{
			var toolbarBox = new Gtk.HBox ();
			parent.PackStart (toolbarBox, false, false, 0);
			toolbarBox.PackStart ((MainToolbar)toolbar, true, true, 0);
		}