public InputLayer(string tag, int ind, String type, String name) : base(ind) // for textbox { code = new Element(tag); code.getHTML().getAttributeList().getAttributes()["type"] = type; code.getHTML().getAttributeList().getAttributes()["name"] = name; panel = new IndexedFlowLayout(ind); panel.FlowDirection = FlowDirection.LeftToRight; panel.AutoSize = true; design = new TextBox(); design.Font = new Font("Times New Roman", 16); label = new IndexedTextBox(ind); panel.Controls.Add(label); panel.Controls.Add(design); label.Text = "Label" + ind; label.BorderStyle = BorderStyle.None; label.ReadOnly = true; label.BackColor = Color.White; label.Width = 15 * label.Text.Length; label.Font = new Font("Times New Roman", 16); code.getHTML().setValue(label.Text); label.Click += (s, er) => { Form1.currentLayer = index; }; code.getHTML().getAttributeList().updateAttributeString(); design.Click += (s, er) => { Form1.currentLayer = index; MessageBox.Show(Form1.currentLayer.ToString()); }; }
override public void addLi(string tag, TableLayer Ab, System.Windows.Forms.TextBox input) { noOfLi++; currentLi = noOfLi; li[currentLi] = new TextLayer(tag, currentLi, this); li[currentLi].getDesign().Click += (s, er) => { IndexedFlowLayout f = (IndexedFlowLayout)li[currentLi].getDesign().Parent; IndexedFlowLayout parentF = (IndexedFlowLayout)f.Parent; Form1.currentLayer = parentF.getIndex(); // MessageBox.Show(f.getIndex().ToString()); setCurrentTrOfTable(Ab, f.getIndex()); input.Text = li[currentLi].getDesign().Text; // setCurrentLi(li[currentLi].getDesign().getIndex()); // MessageBox.Show(this.index.ToString()); }; /*li[currentLi].getDesign().DoubleClick += (s, er) => * { * * li[currentLi].getDesign().ReadOnly = true; * };*/ p.Controls.Add(li[currentLi].getDesign()); }
public ListLayer(int ind, string tag) : base(ind) { p = new IndexedFlowLayout(ind); code = new Element(tag); noOfLi = -1; currentLi = -1; }
public RadioBoxPanel(string name, int ind, string type) : base(ind) { this.type = type; p = new IndexedFlowLayout(ind); p.BackColor = System.Drawing.Color.White; //p.ForeColor = System.Drawing.Color.Black; // p.Dock = System.Windows.Forms.DockStyle.Top; this.name = name; }
public TableLayer(int ind, String tag) : base(ind) { p = new IndexedFlowLayout(ind); code = new Element(tag); noOfTr = -1; currentTr = -1; p.FlowDirection = FlowDirection.TopDown; p.AutoSize = true; }
override public void addLi(string tag) { noOfLi++; currentLi = noOfLi; li[currentLi] = new TextLayer(tag, currentLi); p.Controls.Add(li[currentLi].getDesign()); li[currentLi].getDesign().Click += (s, er) => { IndexedFlowLayout f = (IndexedFlowLayout)li[currentLi].getDesign().Parent; Form1.currentLayer = f.getIndex(); }; }
public override void Delete() { for (int i = 0; i < tr.Length; i++) { if (tr[i] == null) { continue; } this.tr[i].Delete(); } this.p.Dispose(); this.p = null; this.code = null; this.tr = null; }
public override void addChoice(string value) { noOfChoices++; currentChoice = noOfChoices; choice[currentChoice] = new InputLayer("input", currentChoice, type, name, value); p.Controls.Add(choice[currentChoice].getPanel()); p.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight; p.AutoSize = true; choice[currentChoice].getInputDesign().Click += (s, er) => { IndexedFlowLayout f = (IndexedFlowLayout)choice[currentChoice].getPanel().Parent; Form1.currentLayer = f.getIndex(); }; /* choice[currentChoice].getInputDesign().Click += (s, er) => * { * System.Windows.MessageBox.Show(currentChoice.ToString()); * System.Windows.MessageBox.Show(choice[currentChoice].getIndex().ToString()); * * };*/ }
public InputLayer(string tag, int ind, String type, String name, String value) : base(ind) // for boxes { code = new Element(tag); code.getHTML().getAttributeList().getAttributes()["type"] = type; code.getHTML().getAttributeList().getAttributes()["name"] = name; panel = new IndexedFlowLayout(ind); panel.FlowDirection = FlowDirection.LeftToRight; panel.AutoSize = true; if (type == "radio") { design = new IndexedRadioButton(ind); } if (type == "checkbox") { design = new IndexedCheckBox(ind); } design.Text = value; code.getHTML().getAttributeList().getAttributes()["value"] = design.Text; label = new IndexedTextBox(ind); label.Text = "Label" + ind; label.BorderStyle = BorderStyle.None; label.ReadOnly = true; label.BackColor = Color.White; panel.Controls.Add(design); code.getHTML().setValue(label.Text); code.getHTML().getAttributeList().updateAttributeString(); design.Click += (s, er) => { }; }