예제 #1
0
        private void MainDesktop_KeyDown(object sender, KeyEventArgs e)
        {
            if (this.resetFlag == true)
            {
                return;
            }
            int formsInTreeCnt = ADS.HistorySession.FormsInTree();

            if (formsInTreeCnt > 1)
            {
                ADS.HistorySession.ResetFocus();
                return;
            }

            //Only use menu hot key logic when a portion of the menu
            //is actually in focus
            if ((this.mainMenuPanel.Visible && this.mainMenuPanel.Enabled))
            {
                MenuLevelController curMenuLevel = null;
                if (this.mainMenuPanel.Enabled)
                {
                    curMenuLevel = this.mainMenuPanel.MenuController;
                }

                if (curMenuLevel == null)
                {
                    return;
                }

                curMenuLevel.buttonTriggerHotKey(e.KeyCode);
            }
        }
        /// <summary>
        /// Key down event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NewDesktop_KeyDown(object sender, KeyEventArgs e)
        {
            if (this.resetFlag)
            {
                return;
            }
            int formsInTreeCnt = CashlinxPawnSupportSession.Instance.HistorySession.FormsInTree();

            if (formsInTreeCnt > 1)
            {
                CashlinxPawnSupportSession.Instance.HistorySession.ResetFocus();
                return;
            }

            //Only use menu hot key logic when a portion of the menu
            //is actually in focus
            if ((this.mainMenuPanel.Visible && this.mainMenuPanel.Enabled) ||
                (this.CustomerServiceMenuPanel.Visible && this.CustomerServiceMenuPanel.Enabled) ||
                (this.userAdminMenuPanel.Visible && this.userAdminMenuPanel.Enabled))

            {
                MenuLevelController curMenuLevel = null;
                if (this.mainMenuPanel.Enabled)
                {
                    curMenuLevel = this.mainMenuPanel.MenuController;
                }
                else if (this.CustomerServiceMenuPanel.Enabled)
                {
                    curMenuLevel = this.CustomerServiceMenuPanel.MenuController;
                }
                else if (this.userAdminMenuPanel.Enabled)
                {
                    curMenuLevel = this.userAdminMenuPanel.MenuController;
                }

                if (curMenuLevel == null)
                {
                    return;
                }
                if (e.Shift)
                {
                    if (e.KeyCode == Keys.R)
                    {
                        //Execute resetting the menu
                        this.resetMenu();
                    }
                }
                else
                {
                    curMenuLevel.buttonTriggerHotKey(e.KeyCode);
                }
            }
        }