/// <summary> /// Initializes a new instance of the <see cref="StructEditGuiForm"/> class. /// </summary> /// <param name="owner">The owner.</param> /// <param name="width">The form's width.</param> /// <param name="height">The form's height.</param> public StructEditGuiForm(StructEditGuiScript owner, int width, int height) { this.owner = owner; this.ctrlPressed = false; this.clipboard = string.Empty; this.Opened += new EventHandler(StructEditGuiForm_Opened); this.width = width; this.height = height; this.currentElementIndex = 0; this.currentStructIndex = 0; this.Size = new System.Drawing.Size(this.width, this.height); this.KeyUp += new KeyEventHandler(StructEditGuiForm_KeyUp); this.KeyDown += new KeyEventHandler(StructEditGuiForm_KeyDown); this.zapElementTextbox = new Textbox(); this.zapElementTextbox.Location = new System.Drawing.Point((int)(this.width * 0.48), (int)(this.height * 0.1)); this.zapElementTextbox.Width = (int)(this.width * 0.10); this.zapElementTextbox.Text = "XXX"; this.Controls.Add(this.zapElementTextbox); this.zapElementTextbox.GotFocus += new EventHandler(zapElementTextbox_GotFocus); this.zapStructTextbox = new Textbox(); this.zapStructTextbox.Location = new System.Drawing.Point((int)(this.width * 0.48), (int)(this.height * 0.01)); this.zapStructTextbox.Width = (int)(this.width * 0.10); this.zapStructTextbox.Text = "XXX"; this.Controls.Add(this.zapStructTextbox); this.zapStructTextbox.GotFocus += new EventHandler(zapStructTextbox_GotFocus); this.zapToElementBtn = new Button(); this.zapToElementBtn.Location = new System.Drawing.Point((int)(this.width * 0.6), (int)(this.height * 0.1)); this.zapToElementBtn.Width = (int)(this.width * 0.2); this.zapToElementBtn.Text = "Go to element"; this.Controls.Add(this.zapToElementBtn); this.zapToElementBtn.Click += new MouseEventHandler(zapToElementBtn_Click); this.zapToStructBtn = new Button(); this.zapToStructBtn.Location = new System.Drawing.Point((int)(this.width * 0.6), (int)(this.height * 0.01)); this.zapToStructBtn.Width = (int)(this.width * 0.2); this.zapToStructBtn.Text = "Go to struct"; this.Controls.Add(this.zapToStructBtn); this.zapToStructBtn.Click += new MouseEventHandler(zapToStructBtn_Click); this.newVal = new Textbox(); this.newVal.Location = new System.Drawing.Point((int)(this.width * 0.7), (int)(this.height * 0.51)); this.newVal.Width = (int)(this.width * 0.27); this.newVal.Height = (int)(this.height * 0.1); this.newVal.Text = "Enter new values here"; this.Controls.Add(this.newVal); this.newVal.GotFocus += new EventHandler(newVal_GotFocus); this.editValBtn = new Button(); this.editValBtn.Location = new System.Drawing.Point((int)(this.width * 0.7), (int)(this.height * 0.62)); this.editValBtn.Width = (int)(this.width * 0.27); this.editValBtn.Text = "Change selected param"; this.Controls.Add(this.editValBtn); this.editValBtn.Click += new MouseEventHandler(editValBtn_Click); this.structNameLbl = new Label(); this.structNameLbl.Location = new System.Drawing.Point((int)(this.width * 0.08), (int)(this.height * 0.01)); this.structNameLbl.Text = "Current structure: "; this.structNameLbl.Width = (int)(this.width * 0.3); this.structNameLbl.Height = (int)(this.height * 0.05); this.Controls.Add(this.structNameLbl); this.elementNumLbl = new Label(); this.elementNumLbl.Location = new System.Drawing.Point((int)(this.width * 0.08), (int)(this.height * 0.1)); this.elementNumLbl.Text = "Current element: "; this.elementNumLbl.Width = (int)(this.width * 0.3); this.elementNumLbl.Height = (int)(this.height * 0.05); this.Controls.Add(this.elementNumLbl); this.nextStructBtn = new Button(); this.nextStructBtn.Location = new System.Drawing.Point((int)(this.width * 0.4), (int)(this.height * 0.01)); this.nextStructBtn.Text = "Next"; this.nextStructBtn.Width = 40; this.Controls.Add(this.nextStructBtn); this.nextStructBtn.Click += new MouseEventHandler(nextStructBtn_Click); this.prevStructBtn = new Button(); this.prevStructBtn.Location = new System.Drawing.Point((int)(0), (int)(this.height * 0.01)); this.prevStructBtn.Text = "Prev"; this.prevStructBtn.Width = 40; this.Controls.Add(this.prevStructBtn); this.prevStructBtn.Click += new MouseEventHandler(prevStructBtn_Click); this.nextElementBtn = new Button(); this.nextElementBtn.Location = new System.Drawing.Point((int)(this.width * 0.4), (int)(this.height * 0.1)); this.nextElementBtn.Text = "Next"; this.nextElementBtn.Width = 40; this.Controls.Add(this.nextElementBtn); this.nextElementBtn.Click += new MouseEventHandler(nextElementBtn_Click); this.prevElementBtn = new Button(); this.prevElementBtn.Location = new System.Drawing.Point((int)(0), (int)(this.height * 0.1)); this.prevElementBtn.Text = "Prev"; this.prevElementBtn.Width = 40; this.Controls.Add(this.prevElementBtn); this.prevElementBtn.Click += new MouseEventHandler(prevElementBtn_Click); this.listBox = new Listbox(); this.listBox.Location = new System.Drawing.Point((int)(0), (int)(this.height * 0.2)); this.listBox.Size = new System.Drawing.Size((int)(this.width * 0.3), (int)(this.height * 0.7)); this.listBox.SelectedIndexChanged += new EventHandler(listBox_SelectedIndexChanged); this.Controls.Add(this.listBox); this.listBox_values = new Listbox(); this.listBox_values.Location = new System.Drawing.Point((int)(this.width * 0.3), (int)(this.height * 0.2)); this.listBox_values.Size = new System.Drawing.Size((int)(this.width * 0.3), (int)(this.height * 0.7)); this.listBox_values.SelectedIndexChanged += new EventHandler(listBox_values_SelectedIndexChanged); this.Controls.Add(this.listBox_values); }