private void TextInput_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { ButtonSave.Focus(FocusState.Programmatic); } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/>Instance containing the event data.</param> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintRoverWeb.Administration.ApplicationRegistration.Page_Load.jpg"/> /// </remarks> protected void Page_Load(object sender, EventArgs e) { if (Request.Params["mc"] == "421") { ImageHome.Visible = true; } //if (string.IsNullOrEmpty(HttpContext.Current.Session["UserRole"] as string)) //if (string.IsNullOrEmpty(Session["UserRole"] as string)) //{ // Response.Redirect("../Web/LogOn.aspx", true); // return; //} //else if (Session["UserRole"] as string != "admin") //{ // Response.Redirect("~/Administration/UnAuthorisedAccess.aspx"); //} if (!IsPostBack) { ProvideRegistrationInfo(); DisplayRegistrationDetails(); } ButtonSave.Focus(); LocalizeThisPage(); }
private void Window_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Tab) { ButtonSave.Focus(); e.Handled = true; } if (e.Key == Key.Enter && ButtonSave.IsFocused == false) { TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next); UIElement keyboardFocus = Keyboard.FocusedElement as UIElement; if (keyboardFocus != null) { keyboardFocus.MoveFocus(tRequest); } e.Handled = true; } else if (e.Key == Key.Enter && ButtonSave.IsFocused == true) { MessageBox.Show("The product has been saved"); Close(); } }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { // Clicking button doesn't take focus away from TextBasedTimePicker, so their edited value doesn't get committed... // Therefore we have to take focus away, and wait for the focus to actually switch if (ButtonSave.FocusState == FocusState.Unfocused) { RoutedEventHandler gotFocus = null; gotFocus = delegate { ButtonSave.GotFocus -= gotFocus; ViewModel.Save(); }; ButtonSave.GotFocus += gotFocus; ButtonSave.Focus(FocusState.Programmatic); return; } ViewModel.Save(); }
/// <summary> /// Handles the Click event of the IBAdd control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.ImageClickEventArgs"/>Instance containing the event data.</param> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintRoverWeb.Administration.ManageDepartments.IBAdd_Click.jpg"/> /// </remarks> protected void IBAdd_Click(object sender, ImageClickEventArgs e) { departmentSelectedValue = "ADD"; TextBoxDepartmentName.Text = TextBoxDescription.Text = ""; CheckBoxDepartmentActive.Checked = false; ButtonSave.Visible = true; ButtonUpdate.Visible = false; TextBoxDepartmentName.ReadOnly = false; divEditUsers.Visible = false; divRequired.Visible = true; PanelAddDepartment.Visible = true; TableDepartments.Visible = false; CheckBoxDepartmentActive.Enabled = true; LabelDepartmentName.Visible = false; TextBoxDepartmentName.Visible = true; Image1.Visible = true; HiddenFieldAddEdit.Value = "1"; ButtonSave.Focus(); GetDepartments(); }
/// <summary> /// Handles the Click event of the IBAdd control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.ImageClickEventArgs"/>Instance containing the event data.</param> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintRoverWeb.Administration.ManageLanguage.IBAdd_Click.jpg" /> /// </remarks> protected void IBAdd_Click(object sender, ImageClickEventArgs e) { DropDownListLanguage.Enabled = true; PanelAddDepartment.Visible = true; ButtonUpdate.Visible = false; ButtonSave.Visible = true; ProvideLanguageData(); ProvideLanguages(); ImageMenuSplitBar.Visible = true; IBAdd.Visible = false; IBEdit.Visible = false; ImageButtonBack.Visible = true; ImageButtonSave.Visible = true; TableCellresetSpilt.Visible = true; TableCellReset.Visible = true; //Disable lock and un-lock cells tdImageLock.Visible = false; tdImageLockButton.Visible = false; tdImageUnLock.Visible = false; tdImageUnLockButton.Visible = false; HiddenFieldAddEdit.Value = "1"; ButtonSave.Focus(); }
private void ComboBoxStatus_SelectedIndexChanged(object sender, EventArgs e) { ButtonSave.Focus(); }
private void ButtonImport_Click(object sender, EventArgs e) { OpenFileDialog iDialog = new OpenFileDialog(); iDialog.Title = "Select a file to import:"; iDialog.CheckFileExists = true; iDialog.Filter = "Importable Sprite|*.nslx;*.bmp;*.png*"; if (iDialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK & iDialog.FileName != "") { string extension = Path.GetExtension(iDialog.FileName).Substring(1).ToLower(); LibraryTree.Nodes.Clear(); LibraryTree.Nodes.Add("No Sprite Library loaded"); Library = null; Sprite = null; if (extension == "png" || extension == "bmp") { try { Sprite = NSE_Framework.IO.Import.ImportImage(iDialog.FileName); this.Text = "Import - " + Path.GetFileName(iDialog.FileName); previewBitmap = new Bitmap(Sprite.Width * 8, Sprite.Height * 8, System.Drawing.Imaging.PixelFormat.Format32bppArgb); NSE_Framework.Draw.uDrawSprite(ref previewBitmap, Sprite); Preview.Image = previewBitmap; DrawPalette(); LabelSize.Text = "Size: ( " + Sprite.Width.ToString() + ", " + Sprite.Height.ToString() + ")"; if (Sprite.Palette.Type == NSE_Framework.Data.SpritePalette.PaletteType.Color16) { LabelColors.Text = "Colors: 16"; } else if (Sprite.Palette.Type == NSE_Framework.Data.SpritePalette.PaletteType.Color256) { LabelColors.Text = "Colors: 256"; } ButtonSave.Enabled = true; ComboBoxMode.Enabled = true; ComboBoxMode.SelectedIndex = 0; ButtonSave.Focus(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (extension == "nslx") { LibraryTree.Nodes.Clear(); Library = NSE_Framework.IO.Import.ImportSpriteLibrary(iDialog.FileName); this.Text = "Import - " + this.Library.Origin; foreach (NSE_Framework.IO.SpriteSet sSet in Library.Sprites) { TreeNode node = new TreeNode(sSet.Name); foreach (NSE_Framework.IO.SpriteData sDat in sSet.SpriteData) { node.Nodes.Add(new TreeNode(sDat.Name)); } LibraryTree.Nodes.Add(node); } LibraryTree.SelectedNode = LibraryTree.Nodes[0].Nodes[0]; ButtonSave.Enabled = true; ComboBoxMode.Enabled = true; ComboBoxMode.SelectedIndex = 0; ButtonSave.Focus(); } } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/>Instance containing the event data.</param> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintRoverWeb.Administration.CardConfiguration.Page_Load.jpg"/> /// </remarks> protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(Session["UserRole"] as string)) { Response.Redirect("../Web/LogOn.aspx", true); return; } else if (Session["UserRole"] as string != "admin") { Response.Redirect("~/Administration/UnAuthorisedAccess.aspx"); } ButtonSave.Attributes.Add("onClick", "return CheckDDR()"); ImageButtonSave.Attributes.Add("onClick", "return CheckDDR()"); LocalizeThisPage(); if (!IsPostBack) { BinddropdownValues(); if (Session["SelectedCardType"] != null) { DropDownListCardType.SelectedIndex = DropDownListCardType.Items.IndexOf(DropDownListCardType.Items.FindByValue(Convert.ToString(Session["SelectedCardType"], CultureInfo.CurrentCulture))); } DisplayCardSettings(); } string displayCardTestingPanel = ConfigurationManager.AppSettings["DisplayCardTestingPanel"]; if (displayCardTestingPanel.ToLower() == "true") { PanelTestCardConfiguration.Visible = true; } else { PanelTestCardConfiguration.Visible = false; } CheckBoxEnableFsc.Attributes.Add("onclick", "javascript:EnableandDisableCheckBox()"); string queryID = Request.Params["cid"]; if (!string.IsNullOrEmpty(queryID)) { if (queryID == "mdv") { Tablecellback.Visible = true; Tablecellimage.Visible = true; pageResponse = true; } else { pageResponse = false; } } ButtonSave.Focus(); LinkButton CardConfiguration = (LinkButton)Master.FindControl("LinkButtonCardConfiguration"); if (CardConfiguration != null) { CardConfiguration.CssClass = "linkButtonSelect_Selected"; } string labelResourceIDs = "PROXIMITY_CARD"; Hashtable localizedResources = AppLibrary.Localization.Resources("", Session["selectedCulture"] as string, labelResourceIDs, "", ""); if (!DropDownListCardType.Items.Contains(new ListItem(localizedResources["L_PROXIMITY_CARD"].ToString(), "PC"))) { BinddropdownValues(); } }