コード例 #1
0
 public ToolbarToggle(ICommand cmd) : base(cmd)
 {
     _Button          = new ToggleToolButton(cmd.Properties.Icon);
     _Button.Toggled += new EventHandler(OnToggled);
     _Button.Label    = cmd.Properties.Text;
     this.Add(_Button);
     _Button.Show();
     this.ShowAll();
 }
コード例 #2
0
ファイル: BaseTool.cs プロジェクト: hsmith/Pinta
        protected virtual ToggleToolButton CreateToolButton()
        {
            Gtk.Image i2 = new Gtk.Image(PintaCore.Resources.GetIcon(Icon));
            i2.Show();

            ToggleToolButton tool_item = new ToggleToolButton();

            tool_item.IconWidget = i2;
            tool_item.Show();
            tool_item.Label = Name;

            if (ShortcutKey != (Gdk.Key) 0)
            {
                tool_item.TooltipText = string.Format("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString().ToUpperInvariant(), Catalog.GetString("Shortcut key"), StatusBarText);
            }
            else
            {
                tool_item.TooltipText = Name;
            }

            return(tool_item);
        }