Exemplo n.º 1
0
        protected void PerformItemClick(RadMenuItemBase menuItem)
        {
            if (menuItem == null || !menuItem.Enabled)
            {
                return;
            }

            this.clickedItem = menuItem;

            if (menuItem.HasChildren)
            {
                menuItem.ShowChildItems();
                menuItem.DropDown.SelectFirstVisibleItem();
            }
            else
            {
                PopupManager.Default.CloseAllToRoot(RadPopupCloseReason.Keyboard, this);
                if (menuItem.Owner is RadMenuElement)
                {
                    if (((menuItem.Owner as RadMenuElement).ElementTree.Control is RadMenu))
                    {
                        ((menuItem.Owner as RadMenuElement).ElementTree.Control as RadMenu).SetMenuState(RadMenu.RadMenuState.NotActive);
                    }
                }
            }


            menuItem.PerformClick();
            this.clickedItem = null;
        }
Exemplo n.º 2
0
        protected virtual bool ProcessLeftRightNavigationKey(bool isLeft)
        {
            RadMenuItemBase selectedItem = this.GetSelectedItem() as RadMenuItemBase;

            if (selectedItem == null)
            {
                return(false);
            }
            if (!isLeft)
            {
                if (!selectedItem.HasChildren)
                {
                    return(false);
                }
                selectedItem.ShowChildItems();
                selectedItem.DropDown.SelectFirstVisibleItem();
                return(true);
            }
            if (selectedItem.HierarchyParent == null || selectedItem.HierarchyParent.IsRootItem && this.OwnerPopup == null)
            {
                return(false);
            }
            this.ClosePopup(RadPopupCloseReason.Keyboard);
            return(true);
        }
Exemplo n.º 3
0
        private void DoOnItemClicked(RadMenuItemBase menuItem, MouseEventArgs e)
        {
            if (!menuItem.HasChildren && menuItem.GetSite() == null)
            {
                menuItem.Select();
                PopupManager.Default.CloseAllToRoot(RadPopupCloseReason.Mouse, this);

                if (menuItem.RootItem == null ||
                    !(menuItem.RootItem.Owner is RadMenuElement))
                {
                    return;
                }

                if (menuItem.Owner is RadMenuElement)
                {
                    if ((menuItem.Owner as RadMenuElement).ElementTree.Control is RadMenu)
                    {
                        ((menuItem.Owner as RadMenuElement).ElementTree.Control as RadMenu).SetMenuState(RadMenu.RadMenuState.NotActive);
                    }
                }
            }
            else
            {
                if (!(menuItem.GetSite() != null && e.Button == MouseButtons.Right))
                {
                    menuItem.ShowChildItems();
                }
            }
        }
Exemplo n.º 4
0
        private void OnChildrenDropDown_TimeOut(object sender, EventArgs e)
        {
            RadMenuItemBase selectedItem = this.GetSelectedItem() as RadMenuItemBase;

            if (selectedItem != null)
            {
                selectedItem.ShowChildItems();
            }

            this.childDropDownTimeout.Stop();
        }
Exemplo n.º 5
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            RadMenuItemBase elementAtPoint = this.ElementTree.GetElementAtPoint(e.Location) as RadMenuItemBase;

            if (!this.CanProcessItem(elementAtPoint) || !elementAtPoint.ShouldHandleMouseInput || (elementAtPoint.DropDown == null || elementAtPoint.DropDown.IsVisible))
            {
                return;
            }
            this.childDropDownTimeout.Stop();
            elementAtPoint.ShowChildItems();
        }
Exemplo n.º 6
0
 protected void PerformItemClick(RadMenuItemBase menuItem)
 {
     if (menuItem == null || !menuItem.Enabled)
     {
         return;
     }
     if (menuItem.HasChildren)
     {
         menuItem.ShowChildItems();
         menuItem.DropDown.SelectFirstVisibleItem();
     }
     menuItem.PerformClick();
 }
Exemplo n.º 7
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            RadMenuItemBase menuItem = this.elementTree.GetElementAtPoint(e.Location) as RadMenuItemBase;

            if (!this.CanProcessItem(menuItem))
            {
                return;
            }

            if (menuItem.ShouldHandleMouseInput &&
                menuItem.DropDown != null &&
                !menuItem.DropDown.IsVisible)
            {
                this.childDropDownTimeout.Stop();
                menuItem.ShowChildItems();
            }
        }
Exemplo n.º 8
0
        private void OnChildrenDropDown_TimeOut(object sender, EventArgs e)
        {
            this.childDropDownTimeout.Stop();
            this.childDropDownTimeout.Tag = (object)null;
            RadMenuItemBase selectedItem = this.GetSelectedItem() as RadMenuItemBase;

            if (selectedItem == null)
            {
                return;
            }
            lock (this.syncObj)
            {
                while (this.itemsToClose.Count > 0)
                {
                    this.itemsToClose.Peek().HideChildItems();
                    this.itemsToClose.Pop();
                }
            }
            selectedItem.ShowChildItems();
        }