Example #1
0
        protected override void OnKeyDown(System.Windows.Forms.KeyEventArgs e)
        {
            base.OnKeyDown(e);
            KrentoMenuItem item = menu.FindItemByShortCut(e.KeyData);

            if (item != null)
            {
                menu.CloseUp();
                menu.Execute(item);
                return;
            }

            switch (e.KeyCode)
            {
            case Keys.Home:
                menu.SelectItem(0);
                break;

            case Keys.End:
                menu.SelectItem(menu.Items.Count - 1);
                break;

            case Keys.Space:
            case Keys.Return:
                menu.CloseUp();
                menu.Execute();
                break;

            case Keys.Up:
            {
                menu.DoArrowUp();
                break;
            }

            case Keys.Down:
            {
                menu.DoArrowDown();
                break;
            }

            case Keys.PageDown:
            {
                menu.DoPageDown();
                break;
            }

            case Keys.PageUp:
            {
                menu.DoPageUp();
                break;
            }

            case Keys.Apps:
            case Keys.Escape:
            {
                menu.CloseUp();
                break;
            }
            }
        }
Example #2
0
 protected override void Dispose(bool disposing)
 {
     this.menuItem = null;
     base.Dispose(disposing);
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KrentoMenuArgs"/> class.
 /// </summary>
 /// <param name="menuItem">The menu item.</param>
 /// <param name="itemIndex">Index of the item.</param>
 public KrentoMenuArgs(KrentoMenuItem menuItem, int itemIndex)
 {
     this.menuItem  = menuItem;
     this.itemIndex = itemIndex;
 }
 public MenuItemAccessibleObject(KrentoMenuItem item)
     : base()
 {
     this.item = item;
 }