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()); }
private void CreateTextElement(object sender, EventArgs e) { currentLayer = noOfLayers; currentLayer++; noOfLayers++; layers[currentLayer] = new TextLayer(TagType.SelectedItem.ToString(), TagType.SelectedIndex, currentLayer); DesignCanvas.Controls.Add(layers[currentLayer].getDesign()); selectLayer(); //layers[currentLayer].getDesign().BringToFront(); panel1.Controls.Add(layers[currentLayer].getLayerInfo()); layers[currentLayer].getLayerInfo().Dock = DockStyle.Bottom; layers[currentLayer].getLayerInfo().BringToFront(); HtmlCode.Text = writeCompleteHTML(); HideDialog(sender, e); layers[currentLayer].getDesign().Click += (s, er) => { Form1.currentLayer = layers[currentLayer].getDesign().getIndex(); // this.selected = design.isSelected(); }; layers[currentLayer].getDesign().DoubleClick += (s, er) => { layers[currentLayer].getDesign().ReadOnly = false; }; layers[currentLayer].getDesign().KeyDown += (s, key) => { if (key.KeyCode == Keys.Enter) { layers[currentLayer].getDesign().ReadOnly = true; this.ActiveControl = DesignCanvas; } }; layers[currentLayer].getDesign().TextChanged += (s, e3) => { layers[currentLayer].getDesign().Width = 32 * layers[currentLayer].getDesign().Text.Length; layers[currentLayer].getCode().getHTML().setValue(layers[currentLayer].getDesign().Text); HtmlCode.Text = writeCompleteHTML(); }; }
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(); }; }