void UpdateButton(ButtonBarButton b, CommandInfo ci) { if (ci.Icon != b.Image) { b.Image = ci.Icon; QueueDraw (); } if (ci.Visible != b.Visible) { b.Visible = ci.Visible; visibleButtons = null; QueueResize (); } if (ci.Enabled != b.Enabled) { b.Enabled = ci.Enabled; QueueDraw (); } if (ci.Description != b.Tooltip) b.Tooltip = ci.Description; }
public void AddSeparator() { buttons.Add (new ButtonBarButton (null)); visibleButtons = null; QueueResize (); }
public void Clear() { buttons.Clear (); visibleButtons = null; pushedButton = null; QueueResize (); }
public void Add(string commandId) { ButtonBarButton b = new ButtonBarButton (commandId); var ci = IdeApp.CommandService.GetCommandInfo (commandId, new CommandTargetRoute (lastCommandTarget)); if (ci != null) UpdateButton (b, ci); buttons.Add (b); visibleButtons = null; QueueResize (); }