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> /// Based on the button clicked and the current panel shown, /// invoke the proper functionality or show the proper sub panel /// </summary> /// <param name="menuCtrl"></param> /// <returns></returns> private bool triggerNextEvent(MenuLevelController menuCtrl) { bool rt = false; if (menuCtrl != null) { Button triggerBtn = menuCtrl.TriggerButton; if (triggerBtn != null) { if (triggerBtn != menuCtrl.BackButton) { string targetPanelName = menuCtrl[triggerBtn]; if (!string.IsNullOrEmpty(targetPanelName) && !targetPanelName.Equals("null")) { rt = this.initializeProperMenu(targetPanelName); } else { rt = this.initializeFunctionality( StringUtilities.removeFromString(triggerBtn.Name.ToLowerInvariant(), "button")); } } else { //We have the back button - reset the menu this.resetMenu(); return(true); } } } return(rt); }
private void PoliceMenuPanel_Load(object sender, EventArgs e) { this.buttonControllers = null; var panelInstance = (UserControl)sender; this.menuController = new MenuLevelController(panelInstance); this.buttonControllers = new ImageButtonControllerGroup(GlobalDataAccessor.Instance.DesktopSession, this.Controls); }
private void GBUtilitiesPanel_Load(object sender, EventArgs e) { this.buttonControllers = null; var panelInstance = (UserControl)sender; this.menuController = new MenuLevelController(panelInstance); this.buttonControllers = new ImageButtonControllerGroup(CashlinxPawnSupportSession.Instance, this.Controls); }
/// <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); } } }
private bool triggerNextEvent(MenuLevelController menuCtrl) { bool rt = false; if (menuCtrl != null) { Button triggerBtn = menuCtrl.TriggerButton; if (triggerBtn != null) { if (triggerBtn != menuCtrl.BackButton) { string targetPanelName = menuCtrl[triggerBtn]; if (!string.IsNullOrEmpty(targetPanelName) && !targetPanelName.Equals("null")) { UserVO currUser = ADS.LoggedInUserSecurityProfile; if (currUser == null || (string.IsNullOrEmpty(currUser.UserName))) { ADS.ClearLoggedInUser(); ADS.PerformAuthorization(); } if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName)) { rt = this.initializeProperMenu(targetPanelName); } else { this.resetMenu(); return(true); } } else { UserVO currUser = ADS.LoggedInUserSecurityProfile; if (currUser == null || (string.IsNullOrEmpty(currUser.UserName))) { ADS.ClearLoggedInUser(); ADS.PerformAuthorization(); } if (!string.IsNullOrEmpty(ADS.LoggedInUserSecurityProfile.UserName)) { rt = this.InitializeFunctionality( StringUtilities.removeFromString(triggerBtn.Name.ToLowerInvariant(), "button")); } else { this.resetMenu(); return(true); } } } else { //We have the back button - reset the menu this.resetMenu(); return(true); } } } return(rt); }