using System; using System.Windows.Forms; using RokettoLaunch.Models.SaveFile; using RyzStudio.Windows.Forms; using RyzStudio.Windows.ThemedForms.ButtonTextBox; using RyzStudio.Windows.ThemedForms.PickerBox; namespace RokettoLaunch { public class EditGroupForm : Form { private Label label2; private Label label1; private ThYesNoPickerBox pickerBox1; private ThClearableTextBox textBox1; private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1; private App4Options.Group result = null; public EditGroupForm(App4Options.Group model = null) { InitializeComponent(); UISetup.Dialog(this, true); this.Text = (result == null) ? "Add Group" : "Edit Group"; result = model; pickerBox1.Setup([ "No", "Yes" ], 0); } protected override void OnShown(EventArgs e) { base.OnShown(e); textBox1.Text = result?.Title?.Trim() ?? "New Group"; pickerBox1.Value = result?.IsOpen ?? true; } private void InitializeComponent() { textBox1 = new ThClearableTextBox(); label2 = new Label(); label1 = new Label(); pickerBox1 = new ThYesNoPickerBox(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); SuspendLayout(); // // textBox1 // textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; textBox1.BackColor = System.Drawing.Color.Transparent; textBox1.ClearedValue = ""; textBox1.EnableMovable = false; textBox1.Icon = "O"; textBox1.IconSize = 13F; textBox1.Location = new System.Drawing.Point(115, 20); textBox1.Name = "textBox1"; textBox1.Size = new System.Drawing.Size(260, 32); textBox1.TabIndex = 152; textBox1.TabStop = false; textBox1.UseSystemPasswordChar = false; // // label2 // label2.AutoSize = true; label2.BackColor = System.Drawing.Color.Transparent; label2.ForeColor = System.Drawing.SystemColors.ControlText; label2.Location = new System.Drawing.Point(10, 62); label2.Margin = new Padding(0); label2.Name = "label2"; label2.Padding = new Padding(0, 9, 0, 0); label2.Size = new System.Drawing.Size(91, 24); label2.TabIndex = 155; label2.Text = "Show Expanded"; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label1 // label1.AutoSize = true; label1.BackColor = System.Drawing.Color.Transparent; label1.ForeColor = System.Drawing.SystemColors.ControlText; label1.Location = new System.Drawing.Point(10, 20); label1.Margin = new Padding(0); label1.Name = "label1"; label1.Padding = new Padding(0, 9, 0, 0); label1.Size = new System.Drawing.Size(29, 24); label1.TabIndex = 153; label1.Text = "Title"; label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // pickerBox1 // pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; pickerBox1.BackColor = System.Drawing.Color.Transparent; pickerBox1.EnableMovable = false; pickerBox1.Location = new System.Drawing.Point(295, 62); pickerBox1.Name = "pickerBox1"; pickerBox1.SelectedIndex = 0; pickerBox1.Size = new System.Drawing.Size(80, 32); pickerBox1.TabIndex = 174; pickerBox1.TabStop = false; pickerBox1.Value = false; // // dialogFooter1 // dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); dialogFooter1.Dock = DockStyle.Bottom; dialogFooter1.EnableMovable = false; dialogFooter1.IsBusy = false; dialogFooter1.Location = new System.Drawing.Point(0, 451); dialogFooter1.Name = "dialogFooter1"; dialogFooter1.Size = new System.Drawing.Size(384, 70); dialogFooter1.TabIndex = 0; dialogFooter1.TabStop = false; // // EditGroupForm // BackColor = System.Drawing.Color.White; ClientSize = new System.Drawing.Size(384, 521); Controls.Add(dialogFooter1); Controls.Add(pickerBox1); Controls.Add(label2); Controls.Add(label1); Controls.Add(textBox1); MinimumSize = new System.Drawing.Size(400, 560); Name = "EditGroupForm"; Text = "Edit Section"; ResumeLayout(false); PerformLayout(); } public App4Options.Group Result { get { if (result == null) { result = new App4Options.Group(); } result.Title = textBox1.Text?.Trim() ?? string.Empty; result.IsOpen = pickerBox1.Value; return result; } } } }