示例#1
0
        /// <summary>
        /// Gets the array of group level key tips.
        /// </summary>
        /// <param name="keyTipList">List to add new entries into.</param>
        public void GetGroupKeyTips(KeyTipInfoList keyTipList)
        {
            int visibleIndex = 0;
            int lineHint     = (_currentSize == GroupItemSize.Small ? 1 : 4);

            // Scan all the children, which must be containers or items
            foreach (ViewBase child in this)
            {
                // Only interested in visible children!
                if (child.Visible)
                {
                    // Is this a container item
                    if (child is IRibbonViewGroupContainerView)
                    {
                        IRibbonViewGroupContainerView container = (IRibbonViewGroupContainerView)child;
                        container.GetGroupKeyTips(keyTipList);
                    }
                    else if (child is IRibbonViewGroupItemView)
                    {
                        IRibbonViewGroupItemView item = (IRibbonViewGroupItemView)child;
                        item.GetGroupKeyTips(keyTipList, lineHint);

                        // Depending on size we check to adjust the lint hint
                        switch (_currentSize)
                        {
                        case GroupItemSize.Large:
                            if (visibleIndex == _split1Large)
                            {
                                lineHint = 5;
                            }
                            break;

                        case GroupItemSize.Medium:
                            if (visibleIndex == _split1Medium)
                            {
                                lineHint = 5;
                            }
                            break;

                        case GroupItemSize.Small:
                            if (visibleIndex == _split1Small)
                            {
                                lineHint = 2;
                            }
                            else if (visibleIndex == _split2Small)
                            {
                                lineHint = 3;
                            }
                            break;
                        }
                    }

                    // Track number of visible items, as the split indexes are based on
                    // visible items and not on the total number of child view items
                    visibleIndex++;
                }
            }
        }
示例#2
0
 /// <summary>
 /// Gets the array of group level key tips.
 /// </summary>
 /// <param name="keyTipList">List to add new entries into.</param>
 public void GetGroupKeyTips(KeyTipInfoList keyTipList)
 {
     // Scan all the children, which must be items
     foreach (ViewBase child in this)
     {
         // Only interested in visible children!
         if (child.Visible)
         {
             if (child is IRibbonViewGroupItemView)
             {
                 IRibbonViewGroupItemView item = (IRibbonViewGroupItemView)child;
                 item.GetGroupKeyTips(keyTipList, this.IndexOf(child) + 1);
             }
         }
     }
 }