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()); }
virtual public void addLi(string tag, TableLayer Ab, System.Windows.Forms.TextBox input) { }
private void CreateTableOk_Click(object sender, EventArgs e) { TextBox[,] tableInputs = new TextBox[(int)NoOfRows.Value, (int)NoOfCol.Value]; CreateTableDialog.Visible = false; FlowLayoutPanel mainPanel = new FlowLayoutPanel(); mainPanel.FlowDirection = FlowDirection.TopDown; DesignCanvas.Controls.Add(mainPanel); mainPanel.Location = new Point(100, 100); mainPanel.AutoSize = true; mainPanel.BackColor = Color.FromArgb(40, 40, 40); mainPanel.ForeColor = Color.White; FlowLayoutPanel headingsPanel = new FlowLayoutPanel(); headingsPanel.FlowDirection = FlowDirection.LeftToRight; headingsPanel.AutoSize = true; headingsPanel.AutoScroll = true; for (int i = 0; i < NoOfCol.Value; i++) { Label headings = new Label(); headings.Width = 100; headings.Text = "<td>"; headings.TextAlign = ContentAlignment.MiddleCenter; headingsPanel.Controls.Add(headings); } mainPanel.Controls.Add(headingsPanel); for (int i = 0; i < NoOfRows.Value; i++) { FlowLayoutPanel innerPanel = new FlowLayoutPanel(); innerPanel.FlowDirection = FlowDirection.LeftToRight; innerPanel.AutoSize = true; for (int j = 0; j < NoOfCol.Value; j++) { tableInputs[i, j] = new TextBox(); innerPanel.Controls.Add(tableInputs[i, j]); } mainPanel.Controls.Add(innerPanel); } FlowLayoutPanel buttons = new FlowLayoutPanel(); buttons.FlowDirection = FlowDirection.LeftToRight; buttons.AutoSize = true; Button Ok = new Button(); Ok.BackColor = Color.FromArgb(40, 40, 40); Ok.Text = "OK"; Ok.Location = new Point(50, 200); Ok.Size = new Size(116, 34); Ok.FlatStyle = FlatStyle.Flat; Ok.Click += (s, er) => { mainPanel.Visible = false; currentLayer = noOfLayers; currentLayer++; noOfLayers++; layers[currentLayer] = new TableLayer(currentLayer, "table"); for (int i = 0; i < NoOfRows.Value; i++) { layers[currentLayer].addTr(); for (int j = 0; j < NoOfCol.Value; j++) { layers[currentLayer].getTr().addLi("td", (TableLayer)layers[currentLayer], TableTextInput); layers[currentLayer].getTr().getLi().getDesign().Text = tableInputs[i, j].Text; layers[currentLayer].getTr().getLi().getCode().getHTML().setValue(tableInputs[i, j].Text); layers[currentLayer].getTr().getLi().getDesign().Font = new Font("Times New Roman", 16); layers[currentLayer].getTr().getLi().getDesign().Width = 15 * layers[currentLayer].getTr().getLi().getDesign().Text.Length; } } /*layers[currentLayer].getTr().getPanel().Click += (s4, er4) => { * * layers[currentLayer].setCurrentTr(layers[currentLayer].getPanel().getIndex()); * MessageBox.Show(layers[currentLayer].getCurrentTr().ToString()); * * };*/ DesignCanvas.Controls.Add(layers[currentLayer].getPanel()); HtmlCode.Text = writeCompleteHTML(); mainPanel.Dispose(); }; Button Back = new Button(); Back.BackColor = Color.FromArgb(40, 40, 40); Back.Text = "BACK"; //Ok.Location = new Point(150, 200); Back.Size = new Size(116, 34); Back.FlatStyle = FlatStyle.Flat; Back.Click += (s, er) => { mainPanel.Visible = false; CreateTableDialog.Visible = true; }; buttons.Controls.Add(Ok); buttons.Controls.Add(Back); mainPanel.Controls.Add(buttons); }
public void setCurrentTrOfTable(TableLayer A, int i) { A.setCurrentTr(i); }