コード例 #1
0
        private void MenuItemEnter(object c, GLMouseEventArgs e)
        {
            GLBaseControl b = c as GLBaseControl;

            mousehovered = ControlsIZ.IndexOf(b);       // when we move the mouse, the selected is discarded, and mousehover takes over
            SetSelected(-1);

            GLMenuItem mi = ControlsIZ[mousehovered] as GLMenuItem; // if its a menu item, lets do a timer to autoopen

            if (mi != null && AutoOpenDelay > 0)
            {
                timer.Start(AutoOpenDelay);
            }
        }
コード例 #2
0
        private void MenuItemClicked(GLBaseControl c)
        {
            System.Diagnostics.Debug.Assert(Parent != null);        // double check we are not on a zombie control, due to the add/remove stuff

            var mi = c as GLMenuItem;

            if (mi != null)                             // menu items are handled by us
            {
                if (mi.SubMenuItems != null)
                {
                    Select(ControlsIZ.IndexOf(mi), FlowDirection == ControlFlowDirection.Right);
                }
                else
                {
                    GetTopLevelMenu().CloseMenus();
                }
            }
        }