private void CheckUpdate_Load(object sender, EventArgs e) { this.Size = new Size(229, 144); Cancel_Button.Location = new Point((panel1.Size.Width - Cancel_Button.Size.Width) / 2, 75); Cancel_Button.Select(); CheckVersionThread = new Thread(new ThreadStart(Compare)); CheckVersionThread.Start(); }
private void TextBoxes_KeyDown(object sender, KeyEventArgs e) { if (((e.Key >= Key.D0 && e.Key <= Key.D9) || (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9) || e.Key == Key.OemMinus)) { if (e.Key == Key.OemMinus && sender.Equals(Xmin_TB)) { if (Xmin_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } if (e.Key == Key.OemMinus && sender.Equals(Xmax_TB)) { if (Xmax_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } if (e.Key == Key.OemMinus && sender.Equals(Ymin_TB)) { if (Ymin_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } if (e.Key == Key.OemMinus && sender.Equals(Ymax_TB)) { if (Ymax_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } if (e.Key == Key.OemMinus && sender.Equals(Zmin_TB)) { if (Zmin_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } if (e.Key == Key.OemMinus && sender.Equals(Zmax_TB)) { if (Zmax_TB.Text.Contains("-")) { Cancel_Button.Focus(); } } } else { Cancel_Button.Focus(); } }
private void Localize() { Text = LText.Importing.ImportFromDarkLoader_TitleText; ImportControls.Localize(); ImportFMDataCheckBox.Text = LText.Importing.DarkLoader_ImportFMData; ImportSavesCheckBox.Text = LText.Importing.DarkLoader_ImportSaves; ImportTitleCheckBox.Text = LText.Importing.ImportData_Title; ImportReleaseDateCheckBox.Text = LText.Importing.ImportData_ReleaseDate; ImportLastPlayedCheckBox.Text = LText.Importing.ImportData_LastPlayed; ImportFinishedOnCheckBox.Text = LText.Importing.ImportData_Finished; ImportCommentCheckBox.Text = LText.Importing.ImportData_Comment; ImportSizeCheckBox.Text = LText.Importing.ImportData_Size; OKButton.SetTextAutoSize(LText.Global.OK, OKButton.Width); Cancel_Button.SetTextAutoSize(LText.Global.Cancel, Cancel_Button.Width); }
private void Localize() { Text = LText.ScanAllFMsBox.TitleText; ScanAllFMsForLabel.Text = LText.ScanAllFMsBox.ScanAllFMsFor; TitleCheckBox.Text = LText.ScanAllFMsBox.Title; AuthorCheckBox.Text = LText.ScanAllFMsBox.Author; GameCheckBox.Text = LText.ScanAllFMsBox.Game; CustomResourcesCheckBox.Text = LText.ScanAllFMsBox.CustomResources; SizeCheckBox.Text = LText.ScanAllFMsBox.Size; ReleaseDateCheckBox.Text = LText.ScanAllFMsBox.ReleaseDate; TagsCheckBox.Text = LText.ScanAllFMsBox.Tags; SelectAllButton.SetTextAutoSize(LText.Global.SelectAll); SelectNoneButton.SetTextAutoSize(LText.Global.SelectNone); ScanButton.SetTextAutoSize(LText.ScanAllFMsBox.Scan, ScanButton.Width); Cancel_Button.SetTextAutoSize(LText.Global.Cancel, Cancel_Button.Width); }
private void Localize() { Text = ImportType == ImportType.NewDarkLoader ? LText.Importing.ImportFromNewDarkLoader_TitleText : LText.Importing.ImportFromFMSel_TitleText; ImportTitleCheckBox.Text = LText.Importing.ImportData_Title; ImportReleaseDateCheckBox.Text = LText.Importing.ImportData_ReleaseDate; ImportLastPlayedCheckBox.Text = LText.Importing.ImportData_LastPlayed; ImportFinishedOnCheckBox.Text = LText.Importing.ImportData_Finished; ImportCommentCheckBox.Text = LText.Importing.ImportData_Comment; ImportRatingCheckBox.Text = LText.Importing.ImportData_Rating; ImportDisabledModsCheckBox.Text = LText.Importing.ImportData_DisabledMods; ImportTagsCheckBox.Text = LText.Importing.ImportData_Tags; ImportSelectedReadmeCheckBox.Text = LText.Importing.ImportData_SelectedReadme; ImportSizeCheckBox.Text = LText.Importing.ImportData_Size; OKButton.SetTextAutoSize(LText.Global.OK, OKButton.Width); Cancel_Button.SetTextAutoSize(LText.Global.Cancel, Cancel_Button.Width); }
private void Localize() { Text = LText.TagsFilterBox.TitleText; IncludeAllLabel.Text = LText.TagsFilterBox.IncludeAll; IncludeAnyLabel.Text = LText.TagsFilterBox.IncludeAny; ExcludeLabel.Text = LText.TagsFilterBox.Exclude; for (int i = 0; i < 3; i++) { #region Set i-dependent values Button c1b = i switch { 0 => RemoveSelectedAndButton, 1 => RemoveSelectedOrButton, _ => RemoveSelectedNotButton }; Button cab = i switch { 0 => RemoveAllAndButton, 1 => RemoveAllOrButton, _ => RemoveAllNotButton }; #endregion MainToolTip.SetToolTip(c1b, LText.TagsFilterBox.ClearSelectedToolTip); MainToolTip.SetToolTip(cab, LText.TagsFilterBox.ClearAllToolTip); } // PERF_TODO: Lots of wasted time and duplicate sizing here AndButton.SetTextAutoSize(LText.TagsFilterBox.MoveToAll, AndButton.Width); OrButton.SetTextAutoSize(LText.TagsFilterBox.MoveToAny, OrButton.Width); NotButton.SetTextAutoSize(LText.TagsFilterBox.MoveToExclude, NotButton.Width); int newWidthAll = Math.Max(Math.Max(AndButton.Width, OrButton.Width), NotButton.Width); for (int i = 0; i < 3; i++) { Button button = i switch { 0 => AndButton, 1 => OrButton, _ => NotButton }; button.Width = newWidthAll; button.CenterH(MoveButtonsPanel); } ResetButton.SetTextAutoSize(LText.TagsFilterBox.Reset, ResetButton.Width); OKButton.SetTextAutoSize(LText.Global.OK, OKButton.Width); Cancel_Button.SetTextAutoSize(LText.Global.Cancel, Cancel_Button.Width); }
private void Cancel_Button_MouseLeave(object sender, MouseEventArgs e) => Cancel_Button.BeginAnimation(OpacityProperty, fadeOut);
public MessageBoxCustomForm(string messageTop, string messageBottom, string title, MessageBoxIcon icon, string okText, string cancelText, bool okIsDangerous, string[]?choiceStrings = null) { InitializeComponent(); _multiChoice = choiceStrings?.Length > 0; #region Set fonts // Set these after InitializeComponent() in case that sets other fonts, but before anything else MessageTopLabel.Font = SystemFonts.MessageBoxFont; MessageBottomLabel.Font = SystemFonts.MessageBoxFont; SelectAllButton.Font = SystemFonts.MessageBoxFont; OKButton.Font = SystemFonts.MessageBoxFont; Cancel_Button.Font = SystemFonts.MessageBoxFont; ChoiceListBox.Font = SystemFonts.DefaultFont; #endregion #region Set passed-in values if (icon != MessageBoxIcon.None) { SetMessageBoxIcon(icon); } Text = title; MessageTopLabel.Text = messageTop; MessageBottomLabel.Text = messageBottom; if (_multiChoice) { // Set this first: the list is now populated for (int i = 0; i < choiceStrings !.Length; i++) { ChoiceListBox.Items.Add(choiceStrings[i]); } } else { ChoiceListBox.Hide(); SelectButtonsFLP.Hide(); MessageBottomLabel.Hide(); } #endregion #region Autosize controls int innerControlWidth = MainFLP.Width - 10; MessageTopLabel.MaximumSize = new Size(innerControlWidth, MessageTopLabel.MaximumSize.Height); MessageBottomLabel.MaximumSize = new Size(innerControlWidth, MessageBottomLabel.MaximumSize.Height); // Set this second: the list is now sized based on its content if (_multiChoice) { ChoiceListBox.Height = (ChoiceListBox.ItemHeight * ChoiceListBox.Items.Count.Clamp(5, 20)) + ((SystemInformation.BorderSize.Height * 4) + 3); } // Set these before window autosizing if (_multiChoice) { ChoiceListBox.Width = innerControlWidth; SelectButtonsFLP.Width = innerControlWidth + 1; } // Set these before setting button text if (okIsDangerous) { OKButton.TextImageRelation = TextImageRelation.ImageBeforeText; OKButton.ImageAlign = ContentAlignment.MiddleCenter; OKButton.Image = Resources.ExclMarkCircleRed_14; } OKButton.SetTextAutoSize(okText, OKButton.Width); Cancel_Button.SetTextAutoSize(cancelText, Cancel_Button.Width); #endregion Localize(); SelectButtonsFLP.Height = SelectAllButton.Height;