Exemplo n.º 1
0
        protected virtual bool ProcessItemMnemonicKey(BaseItem item)
        {
            if (item != null && item.Visible && item.GetEnabled())
            {
                if (item is QatOverflowItem)
                    ((QatOverflowItem)item).Expanded = true;
                else if (item is ButtonItem && (item.ShowSubItems || ((ButtonItem)item).AutoExpandOnClick) && (item.SubItems.Count > 0 && item.VisibleSubItems > 0 || ((ButtonItem)item).PopupType == ePopupType.Container) && !item.Expanded)
                {
                    item.Expanded = true;
                    // If it is a menu select first menu item inside...
                    PopupItem popup = item as PopupItem;
                    if (popup.PopupType == ePopupType.Menu && popup.PopupControl is MenuPanel)
                    {
                        ((MenuPanel)popup.PopupControl).SelectFirstItem();
                    }
                    if (m_BaseItemContainer is GenericItemContainer)
                        m_BaseItemContainer.AutoExpand = true;
                }
                else if (item is ComboBoxItem)
                {
                    ((ComboBoxItem)item).ComboBoxEx.Focus();
                    ((ComboBoxItem)item).ComboBoxEx.DroppedDown = true;
                }
                else if (item is TextBoxItem)
                {
                    ((TextBoxItem)item).TextBox.Focus();
                }
                else if (item is ControlContainerItem && ((ControlContainerItem)item).Control != null)
                    ((ControlContainerItem)item).Control.Focus();
                else if (item is GalleryContainer)
                    ((GalleryContainer)item).PopupGallery();
                else
                    item.RaiseClick();
                return true;
            }

            return false;
        }