void RibbonSubGroupAddItemsRecursive( EditorRibbonDefaultConfiguration.Group subGroup, KryptonContextMenuCollection contextMenuItems ) { var items = new List<KryptonContextMenuItemBase>(); foreach( var child in subGroup.Children ) { //!!!!impl ////sub group //var subGroup = child as EditorRibbonDefaultConfiguration.Group; //if( subGroup != null ) //{ // var tripple = new KryptonRibbonGroupTriple(); // ribbonGroup.Items.Add( tripple ); // var button = new KryptonRibbonGroupButton(); // //button.Tag = action; // button.TextLine1 = subGroup.DropDownGroupText.Item1; // button.TextLine2 = subGroup.DropDownGroupText.Item2; // //button.ImageSmall = action.imageSmall; // button.ImageLarge = subGroup.DropDownGroupImage; // button.ToolTipBody = subGroup.Name; // button.ButtonType = GroupButtonType.DropDown; // button.KryptonContextMenu = new KryptonContextMenu(); // RibbonSubGroupAddItemsRecursive( subGroup, button.KryptonContextMenu.Items ); // tripple.Items.Add( button ); //} //action var action = child as EditorAction; if( action != null ) { EventHandler clickHandler = delegate ( object s, EventArgs e2 ) { var item2 = (KryptonContextMenuItem)s; var action2 = item2.Tag as EditorAction; if( action2 != null ) EditorAPI.EditorActionClick( EditorAction.HolderEnum.RibbonQAT, action2.Name ); }; var item = new KryptonContextMenuItem( action.GetContextMenuText(), null, clickHandler ); //var item = new KryptonContextMenuItem( action.GetContextMenuText(), action.imageSmall, clickHandler ); item.Tag = action; items.Add( item ); } //separator else if( child == null ) items.Add( new KryptonContextMenuSeparator() ); } if( items.Count != 0 ) contextMenuItems.Add( new KryptonContextMenuItems( items.ToArray() ) ); }
private void CreateContextMenuView(RibbonAppButton appButton) { // Ask the top level collection to generate the child view elements KryptonContextMenuCollection topCollection = new KryptonContextMenuCollection(); KryptonContextMenuItems topItems = new KryptonContextMenuItems(); topItems.ImageColumn = false; topCollection.Add(topItems); foreach (KryptonContextMenuItemBase item in appButton.AppButtonMenuItems) { topItems.Items.Add(item); } topCollection.GenerateView(_provider, this, _viewColumns, true, true); }
private void CreateContextMenuView(RibbonAppButton appButton) { // Ask the top level collection to generate the child view elements KryptonContextMenuCollection topCollection = new KryptonContextMenuCollection(); KryptonContextMenuItems topItems = new KryptonContextMenuItems(); topItems.ImageColumn = false; topCollection.Add(topItems); foreach (KryptonContextMenuItemBase item in appButton.AppButtonMenuItems) topItems.Items.Add(item); topCollection.GenerateView(_provider, this, _viewColumns, true, true); }