public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication app = commandData.Application; List <RibbonPanel> panels = app.GetRibbonPanels(); foreach (RibbonPanel panel in panels) { Debug.Print(panel.Name); IList <RibbonItem> items = panel.GetItems(); foreach (RibbonItem item in items) { RibbonItemType t = item.ItemType; if (RibbonItemType.PushButton == t) { PushButton b = item as PushButton; Debug.Print(" {0} : {1}", item.ItemText, b.Name); } else { Debug.Assert(RibbonItemType.PulldownButton == t, "expected pulldown button"); PulldownButton b = item as PulldownButton; Debug.Print(" {0} : {1}", item.ItemText, b.Name); foreach (RibbonItem item2 in b.GetItems()) { Debug.Assert(RibbonItemType.PushButton == item2.ItemType, "expected push button in pulldown menu"); Debug.Print(" {0} : {1}", item2.ItemText, ((PushButton)item2).Name); } } } } return(Result.Failed); }
protected YutaiCommand() { _itemType = RibbonItemType.Tool; _textImageRelationYt = TextImageRelationYT.ImageAboveText; _displayStyleYt = DisplayStyleYT.ImageAndText; _toolStripItemImageScalingYt = ToolStripItemImageScalingYT.None; ToolStripLayoutStyleYT = ToolStripLayoutStyleYT.Flow; _panelRowCount = 1; _needUpdateEvent = false; }
public YutaiMenuCommand(RibbonItemType itemType, string category, string key, string name, string caption, string tooltip, string message) { this.m_name = name; this.m_message = message; this.m_caption = caption; this.m_category = category; this.m_toolTip = tooltip; this._key = key; this._itemType = itemType; }
public RibbonItem(YutaiCommand command) { IRibbonItem source = (IRibbonItem)command; this._name = source.Name; this._key = source.Key; this._caption = source.Caption; this._image = source.Image; this._tooltip = source.Tooltip; this._category = source.Category; this._checked = source.Checked; this._enabled = source.Enabled; this._itemType = source.ItemType; _pluginIdentity = source.PluginIdentity; }
public RibbonItem(IRibbonItem source, string newName) { this._name = newName; this._key = source.Key; this._caption = source.Caption; this._image = source.Image; this._tooltip = source.Tooltip; this._category = source.Category; //this._checked = source.Checked; //this._enabled = source.Enabled; this._itemType = source.ItemType; _pluginIdentity = source.PluginIdentity; _parentName = source.ParentName; _position = source.Position; }
protected YutaiCommand(string category, string key, string name, string caption, string tooltip, string message) { this.m_name = name; this.m_message = message; this.m_caption = caption; this.m_category = category; this.m_toolTip = tooltip; this._key = key; _itemType = RibbonItemType.Tool; _textImageRelationYt = TextImageRelationYT.ImageAboveText; _displayStyleYt = DisplayStyleYT.ImageAndText; _toolStripItemImageScalingYt = ToolStripItemImageScalingYT.None; ToolStripLayoutStyleYT = ToolStripLayoutStyleYT.Flow; _panelRowCount = 1; _needUpdateEvent = false; }
public void InitType() { int dotNum = m_name.Count(c => c == '.'); if (dotNum < 1) { _itemType = RibbonItemType.Page; } else if (dotNum == 1) { _itemType = RibbonItemType.PageGroup; } else { _itemType = RibbonItemType.Button; } }
protected YutaiCommand(System.Drawing.Bitmap bitmap, string caption, string category, int helpContextId, string helpFile, string message, string name, string toolTip) { this.m_bitmap = bitmap; this.m_name = name; this.m_message = message; this.m_caption = caption; this.m_category = category; this.m_toolTip = toolTip; this.m_helpID = helpContextId; this.m_helpFile = helpFile; _textImageRelationYt = TextImageRelationYT.ImageAboveText; _displayStyleYt = DisplayStyleYT.ImageAndText; _toolStripItemImageScalingYt = ToolStripItemImageScalingYT.None; ToolStripLayoutStyleYT = ToolStripLayoutStyleYT.Flow; _panelRowCount = 1; this._itemType = RibbonItemType.Tool; _needUpdateEvent = false; }
public RibbonTabItem(RibbonItemType itemType, string category, string key, string name, string caption, string tooltip, string message) : base(itemType, category, key, name, caption, tooltip, message) { }