public static DockToolButton CreateDockToolBarItem(this Gtk.Action action) { DockToolButton item = new DockToolButton (action.StockId); action.ConnectProxy (item); item.Show (); item.TooltipText = action.Label; item.Label = string.Empty; item.Image.Show (); return item; }
public void Initialize (IPadWindow container) { view = new ConsoleView (); view.ConsoleInput += OnViewConsoleInput; Pango.FontDescription font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont); font.Size = (font.Size * 8) / 10; view.SetFont (font); view.ShadowType = Gtk.ShadowType.None; view.ShowAll (); DockItemToolbar toolbar = container.GetToolbar (Gtk.PositionType.Right); DockToolButton buttonClear = new DockToolButton ("gtk-clear"); buttonClear.Clicked += ButtonClearClicked; buttonClear.TooltipText = GettextCatalog.GetString ("Clear"); toolbar.Add (buttonClear); toolbar.ShowAll (); }
IEnumerable<Widget> MonoDevelop.DesignerSupport.IOutlinedDocument.GetToolbarWidgets () { if (toolbarWidgets != null) return toolbarWidgets; var groupToggleButton = new ToggleButton () { Image = new Image (ImageService.GetPixbuf ("md-design-categorise", IconSize.Menu)), TooltipText = GettextCatalog.GetString ("Group entries by type"), Active = settings.IsGrouped, }; groupToggleButton.Toggled += delegate { if (groupToggleButton.Active == settings.IsGrouped) return; settings.IsGrouped = groupToggleButton.Active; UpdateSorting (); }; var sortAlphabeticallyToggleButton = new ToggleButton () { Image = new Image (Gtk.Stock.SortAscending, IconSize.Menu), TooltipText = GettextCatalog.GetString ("Sort entries alphabetically"), Active = settings.IsSorted, }; sortAlphabeticallyToggleButton.Toggled += delegate { if (sortAlphabeticallyToggleButton.Active == settings.IsSorted) return; settings.IsSorted = sortAlphabeticallyToggleButton.Active; UpdateSorting (); }; var preferencesButton = new DockToolButton (Gtk.Stock.Preferences) { Image = new Image (Gtk.Stock.Preferences, IconSize.Menu), TooltipText = GettextCatalog.GetString ("Open preferences dialog"), }; preferencesButton.Clicked += delegate { var dialog = new ClassOutlineSortingPreferencesDialog (settings); try { if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) { dialog.SaveSettings (); comparer = new ClassOutlineNodeComparer (GetAmbience (), settings, outlineTreeModelSort); UpdateSorting (); } } finally { dialog.Destroy (); } }; return toolbarWidgets = new Widget[] { groupToggleButton, sortAlphabeticallyToggleButton, new VSeparator (), preferencesButton, }; }
IEnumerable<Widget> IOutlinedDocument.GetToolbarWidgets () { if (toolbarWidgets != null) return toolbarWidgets; var groupToggleButton = new ToggleButton { Image = new ImageView (Ide.Gui.Stock.GroupByCategory, IconSize.Menu), TooltipText = GettextCatalog.GetString ("Group entries by type"), Active = settings.IsGrouped, }; groupToggleButton.Toggled += delegate { if (groupToggleButton.Active == settings.IsGrouped) return; settings.IsGrouped = groupToggleButton.Active; UpdateSorting (); }; var sortAlphabeticallyToggleButton = new ToggleButton { Image = new ImageView (Ide.Gui.Stock.SortAlphabetically, IconSize.Menu), TooltipText = GettextCatalog.GetString ("Sort entries alphabetically"), Active = settings.IsSorted, }; sortAlphabeticallyToggleButton.Toggled += delegate { if (sortAlphabeticallyToggleButton.Active == settings.IsSorted) return; settings.IsSorted = sortAlphabeticallyToggleButton.Active; UpdateSorting (); }; var preferencesButton = new DockToolButton (Ide.Gui.Stock.Options) { TooltipText = GettextCatalog.GetString ("Open preferences dialog"), }; preferencesButton.Clicked += delegate { using (var dialog = new OutlineSortingPreferencesDialog (settings)) { if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) { dialog.SaveSettings (); comparer = new OutlineNodeComparer (new AstAmbience (TypeSystemService.Workspace.Options), settings, outlineTreeModelSort); UpdateSorting (); } } }; return toolbarWidgets = new Widget[] { groupToggleButton, sortAlphabeticallyToggleButton, new VSeparator (), preferencesButton, }; }
void DisposeSortingWidgets () { groupToggleButton.Dispose (); groupToggleButton = null; sortAlphabeticallyToggleButton.Dispose (); sortAlphabeticallyToggleButton = null; preferencesButton.Dispose (); preferencesButton = null; separator.Dispose (); separator = null; toolbar = null; }
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; }