Example #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;
        }
Example #2
0
 protected override bool ProcessItemMnemonicKey(BaseItem item)
 {
     if (item != null && item.Visible && item.GetEnabled())
     {
         if (item is SuperTabItem)
         {
             SuperTabItem tab = (SuperTabItem)item;
             SuperTabControl tabControl = Parent as SuperTabControl;
             if (tabControl != null && !tabControl.ContainsFocus) return false;
             if (!tab.IsSelected)
             {
                 _TabStripItem.SelectTab((SuperTabItem)item, eEventSource.Keyboard);
                 return true;
             }
             return false;
         }
     }
     return base.ProcessItemMnemonicKey(item);
 }
Example #3
0
		public static bool IsItemEnabled(BaseItem item, ItemPaintArgs pa)
		{
            return item.GetEnabled(pa.ContainerControl);
		}
Example #4
0
        private static bool CanFocus(BaseItem objNew)
        {
            if (objNew == null) return false;
            if (!objNew.Visible || !objNew.GetEnabled())
                return false;

            if (objNew is LabelItem)
                return false;

            return true;
        }