Пример #1
0
        public DockItemToolbar GetToolbar(PositionType position)
        {
            switch (position)
            {
            case PositionType.Top:
                if (toolbarTop == null)
                {
                    toolbarTop = new DockItemToolbar(this, PositionType.Top);
                }
                return(toolbarTop);

            case PositionType.Bottom:
                if (toolbarBottom == null)
                {
                    toolbarBottom = new DockItemToolbar(this, PositionType.Bottom);
                }
                return(toolbarBottom);

            case PositionType.Left:
                if (toolbarLeft == null)
                {
                    toolbarLeft = new DockItemToolbar(this, PositionType.Left);
                }
                return(toolbarLeft);

            case PositionType.Right:
                if (toolbarRight == null)
                {
                    toolbarRight = new DockItemToolbar(this, PositionType.Right);
                }
                return(toolbarRight);

            default: throw new ArgumentException();
            }
        }
		public CommandDockBar (DockItemToolbar toolbar, object initialTarget)
		{
			this.toolbar = toolbar;
			this.initialTarget = initialTarget;
			if (toolbar.DockItem.ContentVisible)
				IdeApp.CommandService.RegisterCommandBar (this);
			toolbar.DockItem.ContentVisibleChanged += HandleToolbarDockItemContentVisibleChanged;
		}
Пример #3
0
		protected override void Initialize (IPadWindow window)
		{
			base.Initialize (window);
			IdeApp.Workbench.ActiveDocumentChanged += DocumentChangedHandler;
			CurrentDoc = IdeApp.Workbench.ActiveDocument;
			toolbar = window.GetToolbar (DockPositionType.Top);
			toolbar.Visible = false;
			Update ();
		}
Пример #4
0
		public DockItemToolbar GetToolbar (PositionType position)
		{
			switch (position) {
				case PositionType.Top:
					if (toolbarTop == null)
						toolbarTop = new DockItemToolbar (this, PositionType.Top);
					return toolbarTop;
				case PositionType.Bottom:
					if (toolbarBottom == null)
						toolbarBottom = new DockItemToolbar (this, PositionType.Bottom);
					return toolbarBottom;
				case PositionType.Left:
					if (toolbarLeft == null)
						toolbarLeft = new DockItemToolbar (this, PositionType.Left);
					return toolbarLeft;
				case PositionType.Right:
					if (toolbarRight == null)
						toolbarRight = new DockItemToolbar (this, PositionType.Right);
					return toolbarRight;
				default: throw new ArgumentException ();
			}
		}
Пример #5
0
		public void Attach (DockItemToolbar tb)
		{
			if (this.tb == tb)
				return;
			this.tb = tb;
			if (tb != null) {
				tb.Visible = visible;
				foreach (var c in tb.Children)
					tb.Remove (c);
				foreach (var b in buttons)
					tb.Add (b);
			}
		}
		void IPadContent.Initialize (IPadWindow window)
		{
			toolbar = window.GetToolbar (PositionType.Top);
			toolbar.Add (switcherCombo);
			toolbar.ShowAll ();
			switcherCombo.Changed += new EventHandler (OnContentSwitched);
			OnContentSwitched (null, null);
			
			separator = new VSeparator ();
		}
		public DockToolbarProvider (DockItemToolbar tb)
		{
			this.tb = tb;
		}
Пример #8
0
		void DisposeSortingWidgets ()
		{
			groupToggleButton.Dispose ();
			groupToggleButton = null;

			sortAlphabeticallyToggleButton.Dispose ();
			sortAlphabeticallyToggleButton = null;

			preferencesButton.Dispose ();
			preferencesButton = null;

			separator.Dispose ();
			separator = null;

			toolbar = null;
		}
Пример #9
0
		void InitializeSortingWidgets (IPadWindow window)
		{
			groupToggleButton = new ToggleButton ();
			groupToggleButton.Image = new Image (ImageService.GetPixbuf ("md-design-categorise", IconSize.Menu));
			groupToggleButton.Toggled += new EventHandler (OnButtonGroupClicked);
			groupToggleButton.TooltipText = GettextCatalog.GetString ("Group entries by type");

			sortAlphabeticallyToggleButton = new ToggleButton ();
			sortAlphabeticallyToggleButton.Image = new Image (Gtk.Stock.SortAscending, IconSize.Menu);
			sortAlphabeticallyToggleButton.Toggled += new EventHandler (OnButtonSortAlphabeticallyClicked);
			sortAlphabeticallyToggleButton.TooltipText = GettextCatalog.GetString ("Sort entries alphabetically");

			preferencesButton = new DockToolButton (Gtk.Stock.Preferences);
			preferencesButton.Image = new Image (Gtk.Stock.Preferences, IconSize.Menu);
			preferencesButton.Clicked += new EventHandler (OnButtonPreferencesClicked);
			preferencesButton.TooltipText = GettextCatalog.GetString ("Open preferences dialog");

			separator = new VSeparator ();

			toolbar = window.GetToolbar (PositionType.Top);
			toolbar.Add (groupToggleButton);
			toolbar.Add (sortAlphabeticallyToggleButton);
			toolbar.Add (separator);
			toolbar.Add (preferencesButton);
			toolbar.ShowAll ();

			toolbar.Visible = false;
		}