private void cbCustom_CheckedChanged(object sender, EventArgs e) { FirefoxCheckBox cb = sender as FirefoxCheckBox; Properties.Settings.Default.BackupCustom = cb.Checked; Properties.Settings.Default.Save(); }
public void Classes_Load(object sender, EventArgs e) { // 3,4+n*33 // 3,37 // 3,70 var cbNum = 1; foreach (var tag in _classTags) { var cb = new FirefoxCheckBox { Size = new Size { Height = 27, Width = 121 }, Tag = $"iatag_ui_{tag.Name.ToLowerInvariant()}", Text = tag.Name, Location = new Point { X = 3, Y = 3 + cbNum * 33 } }; _classes[tag.Tag] = cb; classesPanelBox.Controls.Add(cb); cbNum++; } classesPanelBox.Size = new Size { Height = 10 + cbNum * 33, Width = classesPanelBox.Size.Width }; }
public void Classes_Load(object sender, EventArgs e) { // 3,4+n*33 // 3,37 // 3,70 var cbNum = 1; // Handle hardcoded classes foreach (var c in classesPanelBox.Controls) { if (c is FirefoxCheckBox cb) { cbNum++; } } _classes["class01"] = cbSoldier; _classes["class02"] = cbDemolitionist; _classes["class03"] = cbOccultist; _classes["class04"] = cbNightblade; _classes["class05"] = cbArcanist; _classes["class06"] = cbShaman; _classes["class07"] = cbInquisitor; _classes["class08"] = cbNecromancer; _classes["class09"] = cbOathkeeper; // Hardcoded classes from the base game -- Helps a bit with 4k scaling to not create these dynamically. var prefilled = new[] { "iatag_ui_soldier", "iatag_ui_demolitionist", "iatag_ui_occultist", "iatag_ui_nightblade", "iatag_ui_arcanist", "iatag_ui_shaman", "iatag_ui_inquisitor", "iatag_ui_necromancer", "iatag_ui_oathkeeper" }; int yOffsetHeight = cbDemolitionist.Location.Y - cbSoldier.Location.Y; int cbHeight = cbDemolitionist.Height; foreach (var tag in _classTags) { var translationTag = $"iatag_ui_{tag.Name.ToLowerInvariant()}"; if (!prefilled.Contains(translationTag)) { var cb = new FirefoxCheckBox { Size = new Size { Height = cbHeight, Width = 121 }, Tag = translationTag, Text = tag.Name, Location = new Point { X = 3, Y = 3 + cbNum * yOffsetHeight } }; _classes[tag.Tag] = cb; classesPanelBox.Controls.Add(cb); cbNum++; } } classesPanelBox.Size = new Size { Height = 10 + cbNum * yOffsetHeight, Width = classesPanelBox.Size.Width }; }
private void HandleControl(Control control, Dictionary <Type, ColorSet> colorSet) { FirefoxButton button = control as FirefoxButton; PanelBox pb = control as PanelBox; LinkLabel linkLabel = control as LinkLabel; FirefoxCheckBox cb = control as FirefoxCheckBox; if (button != null && colorSet.ContainsKey(button.GetType())) { var colorset = colorSet[button.GetType()]; button.BackColor = colorset.BackColor.Value; button.BackColorOverride = colorset.BackColor.Value; button.ForeColor = colorset.ForeColor.Value; button.HoverColor = colorset.HoverColor.Value; button.HoverForeColor = colorset.HoverForeColor.Value; } else if (pb != null && colorSet.ContainsKey(pb.GetType())) { var colorset = colorSet[pb.GetType()]; pb.BackColor = colorset.BackColor.Value; pb.ForeColor = colorset.ForeColor.Value; pb.HeaderColor = colorset.HeaderColor.Value; } else if (linkLabel != null && colorSet.ContainsKey(linkLabel.GetType())) { var colorset = colorSet[linkLabel.GetType()]; linkLabel.BackColor = colorset.BackColor.Value; linkLabel.ForeColor = colorset.ForeColor.Value; linkLabel.LinkColor = colorset.LinkColor.Value; } else { if (colorSet.ContainsKey(control.GetType())) { var colorset = colorSet[control.GetType()]; control.BackColor = colorset.BackColor ?? control.BackColor; control.ForeColor = colorset.ForeColor ?? control.ForeColor; } else { var colorset = colorSet[typeof(Control)]; control.BackColor = colorset.BackColor ?? control.BackColor; control.ForeColor = colorset.ForeColor ?? control.ForeColor; } } if (cb != null) { cb.IsDarkMode = !_isLightMode; } control.Invalidate(); control.Update(); }
private void ClearFilters(System.Windows.Forms.Control.ControlCollection coll) { foreach (Control c in coll) { FirefoxCheckBox cb = c as FirefoxCheckBox; if (cb != null) { cb.Checked = false; } ClearFilters(c.Controls); } }
private void DesiredSkills_Load(object sender, EventArgs e) { this.Dock = DockStyle.Fill; // 3,4+n*33 // 3,37 // 3,70 int cbNum = 1; var classtags = _itemTagDao.GetValidClassItemTags(); foreach (var tag in classtags) { // Filter out 4 digit classes (combos) var cleanTag = Regex.Replace(tag.Tag, @"[^\d]", ""); if (cleanTag.Length > 3) { continue; } var cb = new FirefoxCheckBox { Size = new Size { Height = 27, Width = 121 }, Tag = $"iatag_ui_{tag.Name.ToLower()}", Text = tag.Name, Location = new Point { X = 3, Y = 3 + cbNum * 33 } }; _classes[tag.Tag] = cb; classesPanelBox.Controls.Add(cb); cbNum++; } classesPanelBox.Size = new Size { Height = 10 + cbNum * 33, Width = 163 }; initControlsRecursive(this.Controls); }
private static void It(System.Windows.Forms.Control.ControlCollection collection) { foreach (Control control in collection) { It(control.Controls); TextBox tb = control as TextBox; FirefoxCheckBox cb = control as FirefoxCheckBox; FirefoxRadioButton rb = control as FirefoxRadioButton; GroupBox gb = control as GroupBox; FirefoxButton button = control as FirefoxButton; PanelBox pb = control as PanelBox; Label label = control as Label; if (tb != null) { tb.Text = Reverse(tb.Text); } if (cb != null) { cb.Text = Reverse(cb.Text); } if (rb != null) { rb.Text = Reverse(rb.Text); } if (gb != null) { gb.Text = Reverse(gb.Text); } if (button != null) { button.Text = Reverse(button.Text); } if (pb != null) { pb.Text = Reverse(pb.Text); } if (label != null) { label.Text = Reverse(label.Text); } } }
void initControlsRecursive(System.Windows.Forms.Control.ControlCollection coll) { foreach (Control c in coll) { FirefoxCheckBox cb = c as FirefoxCheckBox; if (cb != null) { cb.CheckedChanged += (sender, e) => { var handler = OnChanged; // Only search if the user desires auto search (probably 99%) if (handler != null && Properties.Settings.Default.AutoSearch) { handler(this, Filters); } }; } initControlsRecursive(c.Controls); } }
private void DesiredSkills_Load(object sender, EventArgs e) { Dock = DockStyle.Fill; // 3,4+n*33 // 3,37 // 3,70 var cbNum = 1; var classTags = _itemTagDao.GetValidClassItemTags() .Where(entry => Regex.Replace(entry.Tag, @"[^\d]", "").Length <= 3) // Filter out 4 digit classes (combo classes) .ToList(); foreach (var tag in classTags) { var cb = new FirefoxCheckBox { Size = new Size { Height = 27, Width = 121 }, Tag = $"iatag_ui_{tag.Name.ToLowerInvariant()}", Text = tag.Name, Location = new Point { X = 3, Y = 3 + cbNum * 33 } }; _classes[tag.Tag] = cb; classesPanelBox.Controls.Add(cb); cbNum++; } classesPanelBox.Size = new Size { Height = 10 + cbNum * 33, Width = classesPanelBox.Size.Width }; InitControlsRecursive(Controls); }
public void BindCheckbox(FirefoxCheckBox control) { string name = StripPrefix(control.Name); control.DataBindings.Add(new Binding("Checked", this, name, false, DataSourceUpdateMode.OnPropertyChanged)); }