void Initialize(ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode) { this.frontend = frontend; this.singleGroupMode = singleGroupMode; IconSize = Gtk.IconSize.SmallToolbar; Orientation = Gtk.Orientation.Horizontal; ToolbarStyle = Gtk.ToolbarStyle.BothHoriz; combo = Gtk.ComboBox.NewText(); if (!singleGroupMode) { combo.Changed += OnActiveChanged; Gtk.ToolItem comboItem = new Gtk.ToolItem(); Gtk.HBox cbox = new Gtk.HBox(); cbox.PackStart(new Gtk.Label(Catalog.GetString("Action Group:") + " "), false, false, 3); cbox.PackStart(combo, true, true, 3); comboItem.Add(cbox); comboItem.ShowAll(); Insert(comboItem, -1); internalButtons.Add(comboItem); addButton = new Gtk.ToolButton(Gtk.Stock.Add); addButton.Clicked += OnAddGroup; Insert(addButton, -1); internalButtons.Add(addButton); removeButton = new Gtk.ToolButton(Gtk.Stock.Remove); removeButton.Clicked += OnRemoveGroup; Insert(removeButton, -1); internalButtons.Add(removeButton); ActionGroups = actionGroups; if (actionGroups != null && actionGroups.Count > 0) { combo.Active = 0; } } else { UpdateActionCommands(null); } ShowAll(); }
void Initialize (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode) { this.frontend = frontend; this.singleGroupMode = singleGroupMode; IconSize = Gtk.IconSize.SmallToolbar; Orientation = Gtk.Orientation.Horizontal; ToolbarStyle = Gtk.ToolbarStyle.BothHoriz; combo = Gtk.ComboBox.NewText (); if (!singleGroupMode) { combo.Changed += OnActiveChanged; Gtk.ToolItem comboItem = new Gtk.ToolItem (); Gtk.HBox cbox = new Gtk.HBox (); cbox.PackStart (new Gtk.Label (Catalog.GetString ("Action Group:") + " "), false, false, 3); cbox.PackStart (combo, true, true, 3); comboItem.Add (cbox); comboItem.ShowAll (); Insert (comboItem, -1); internalButtons.Add (comboItem); addButton = new Gtk.ToolButton (Gtk.Stock.Add); addButton.Clicked += OnAddGroup; Insert (addButton, -1); internalButtons.Add (addButton); removeButton = new Gtk.ToolButton (Gtk.Stock.Remove); removeButton.Clicked += OnRemoveGroup; Insert (removeButton, -1); internalButtons.Add (removeButton); ActionGroups = actionGroups; if (actionGroups != null && actionGroups.Count > 0) combo.Active = 0; } else { UpdateActionCommands (null); } ShowAll (); }
void AddCreateItemLabel () { HideSpacerItem (); Gtk.EventBox ebox = new Gtk.EventBox (); ebox.VisibleWindow = false; Gtk.Label emptyLabel = new Gtk.Label (); emptyLabel.Xalign = 0; if (this.Orientation == Gtk.Orientation.Vertical) emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("New\nbutton") + "</span></i>"; else emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString ("New button") + "</span></i>"; ebox.BorderWidth = 3; ebox.Add (emptyLabel); Gtk.ToolItem mit = new Gtk.ToolItem (); mit.Child = ebox; ebox.ButtonPressEvent += OnNewItemPress; Insert (mit, -1); mit.ShowAll (); addLabel = mit; }
void AddCreateItemLabel() { HideSpacerItem(); Gtk.EventBox ebox = new Gtk.EventBox(); ebox.VisibleWindow = false; Gtk.Label emptyLabel = new Gtk.Label(); emptyLabel.Xalign = 0; if (this.Orientation == Gtk.Orientation.Vertical) { emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("New\nbutton") + "</span></i>"; } else { emptyLabel.Markup = "<i><span foreground='darkgrey'>" + Catalog.GetString("New button") + "</span></i>"; } ebox.BorderWidth = 3; ebox.Add(emptyLabel); Gtk.ToolItem mit = new Gtk.ToolItem(); mit.Child = ebox; ebox.ButtonPressEvent += OnNewItemPress; Insert(mit, -1); mit.ShowAll(); addLabel = mit; }