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(IdeApp.TypeSystemService.Workspace.Options), settings, outlineTreeModelSort); UpdateSorting(); } } }; return(toolbarWidgets = new Widget [] { groupToggleButton, sortAlphabeticallyToggleButton, new VSeparator(), preferencesButton, }); }
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, }); }