Exemplo n.º 1
0
        private void Down_Click(object sender, EventArgs e)
        {
            Button                       btn  = (Button)sender;
            TableLayoutPanel             pani = (TableLayoutPanel)btn.Parent.Parent;
            TableLayoutPanelCellPosition a    = STB4.GetCellPosition(pani);

            if (a.Row + 1 >= STB4.RowCount)
            {
                return;
            }
            TableLayoutPanel pani2 = (TableLayoutPanel)STB4.GetControlFromPosition(a.Column, a.Row + 1);

            STB4.SetCellPosition(pani, new TableLayoutPanelCellPosition(a.Column, a.Row + 1));
            STB4.SetCellPosition(pani2, a);
            UpdateActionsListByTabCells();
        }
Exemplo n.º 2
0
        private void UpdateActionsListByTabCells()
        {
            JArray ar = null;

            try { ar = (JArray)Data["actions"]; } catch (Exception error) { ar = new JArray(); }
            ar.Clear();
            foreach (Control line in STB4.Controls)
            {
                TableLayoutPanelCellPosition pos = STB4.GetCellPosition(line);
                while (pos.Row >= ar.Count)
                {
                    ar.Add(null);
                }
                ar[pos.Row] = (JToken)line.Tag;
            }
            Data["actions"] = ar;
            //Debug.WriteLine(JsonConvert.SerializeObject(Data));
        }
Exemplo n.º 3
0
        private void Btn2_Click(object sender, EventArgs e)
        {
            Button           btn  = (Button)sender;
            TableLayoutPanel pani = (TableLayoutPanel)btn.Parent;
            int max = STB4.Controls.Count;
            TableLayoutPanelCellPosition pos = STB4.GetCellPosition(pani);
            TableLayoutPanelCellPosition pos2;

            TableLayoutPanel[] poss = new TableLayoutPanel[STB4.Controls.Count];
            foreach (Control line in STB4.Controls)
            {
                pos2           = STB4.GetCellPosition(line);
                poss[pos2.Row] = (TableLayoutPanel)line;
            }
            STB4.Controls.Remove(pani);
            for (int i = pos.Row; i < STB4.Controls.Count; i++)
            {
                STB4.SetCellPosition(poss[i + 1], new TableLayoutPanelCellPosition(0, i));
            }
            UpdateActionsListByTabCells();
            Debug.WriteLine(JsonConvert.SerializeObject(Data["actions"]));
        }