Exemple #1
0
        //Gets the Accessibility object of the child CurveLegend idetified by index.
        public override AccessibleObject GetChild(int index)
        {
            if (index == 0)
            {
                return(new RadApplicationMenuButtonElementAccessibleObject(this.ribbonBar.RibbonBarElement.ApplicationButtonElement));
            }

            index--;

            AccessibleObject quickAccessAccessible = this.GetQuickAccessBarAccesibleObject(index);

            if (quickAccessAccessible != null)
            {
                return(quickAccessAccessible);
            }

            index = index - this.ribbonBar.QuickAccessToolBarItems.Count;
            int count = 0;

            for (int i = 0; i < this.ribbonBar.CommandTabs.Count; i++)
            {
                RibbonTab ribbonTab = this.ribbonBar.CommandTabs[i] as RibbonTab;

                for (int j = 0; j < ribbonTab.Items.Count; j++)
                {
                    RadRibbonBarGroup ribbonBarGroup = ribbonTab.Items[j] as RadRibbonBarGroup;

                    for (int k = 0; k < ribbonBarGroup.Items.Count; k++)
                    {
                        RadItem currentItem = this.GetRibbonBarGroupChildren(ribbonBarGroup.Items[k], ref count, index);

                        if (currentItem != null)
                        {
                            return(new RadRibbonBarItemAccessibleObject(currentItem, this));
                        }
                    }
                }
            }

            return(null);
        }
Exemple #2
0
            protected internal override List <RadItem> GetKeyFocusChildren(RadItem currentKeyMapItem)
            {
                if (currentKeyMapItem == null)
                {
                    return(GetRootItems());
                }

                List <RadItem> children = new List <RadItem>();

                if ((currentKeyMapItem is RadPageViewItem) &&
                    (this.owner.SelectedCommandTab.Tab == currentKeyMapItem))
                {
                    for (int i = 0; i < this.owner.SelectedCommandTab.Items.Count; ++i)
                    {
                        RadRibbonBarGroup chunk = this.owner.SelectedCommandTab.Items[i] as RadRibbonBarGroup;
                        if (chunk == null)
                        {
                            continue;
                        }

                        if (chunk.VisibilityState == ChunkVisibilityState.Collapsed)
                        {
                            children.Add(chunk);
                        }
                        else
                        {
                            List <RadItem> subChildren = GetKeyFocusChildren(chunk);
                            children.AddRange(subChildren);
                        }
                    }
                }
                else if (currentKeyMapItem is RadRibbonBarGroup)
                {
                    RadRibbonBarGroup chunk = currentKeyMapItem as RadRibbonBarGroup;
                    if (chunk != null)
                    {
                        if (chunk.VisibilityState == ChunkVisibilityState.Collapsed)
                        {
                            children.AddRange(chunk.DropDownElement.Items);
                        }
                        else
                        {
                            foreach (RadItem item in chunk.Items)
                            {
                                if (!(item is RadRibbonBarButtonGroup))
                                {
                                    if (item.Enabled)
                                    {
                                        children.Add(item);
                                    }
                                }
                                else
                                {
                                    List <RadItem> subChildren = GetKeyFocusChildren(item);
                                    children.AddRange(subChildren);
                                }
                            }
                        }
                    }
                }
                else if (currentKeyMapItem is RadDropDownButtonElement)
                {
                    return(children);
                }
                else if (currentKeyMapItem is RadComboBoxElement)
                {
                    children.AddRange((currentKeyMapItem as RadComboBoxElement).Items);
                }
                else if (currentKeyMapItem is RadRibbonBarButtonGroup)
                {
                    foreach (RadItem item in (currentKeyMapItem as RadRibbonBarButtonGroup).Items)
                    {
                        if (!(item is RadRibbonBarButtonGroup) && !(item is RibbonBarGroupSeparator))
                        {
                            children.Add(item);
                        }
                        else
                        {
                            List <RadItem> subChildren = GetKeyFocusChildren(item);
                            children.AddRange(subChildren);
                        }
                    }
                }
                else
                {
                    foreach (RadElement item in currentKeyMapItem.Children)
                    {
                        if (item is RadItem)
                        {
                            if (item.Enabled)
                            {
                                children.Add(item as RadItem);
                            }
                        }
                    }
                }

                return(children);
            }