Exemplo n.º 1
0
        void Basic()
        {
            SuspendLayout();
            Controls.AddRange(MyLayout.Panel.GetTextBoxes(1));
            Controls.AddRange(MyLayout.Panel.GetButtons(24));
            for (int i = 0; i < 24; i++)
            {
                Controls[i + 1].Text   = names[i];
                Controls[i + 1].Click += ButtonClick;
            }
            ResumeLayout(false);

            main        = new MyLayout.VBox();
            main.rect.X = 10;
            main.rect.Y = 10;
            main.SetParam(null, 10, 5);

            main.AddPanel(0, 0);
            main.AddGrid(0, 3);
            main.SetVertical(new short[] { 120, -1 });
            main.SetID(0, 0);

            MyLayout.Panel p3 = main.children[1];
            p3.AddPanel(3, 3, 24);
            p3.SetHorizontal(MyLayout.Panel.GetDefault(4));
            p3.SetVertical(MyLayout.Panel.GetDefault(6));
            for (int i = 0; i < 24; i++)
            {
                p3.SetID((byte)i, (short)(i + 1));
            }

            Form1_Resize(null, null);
            Initialized();
        }
Exemplo n.º 2
0
        void Test5()
        {
            main = new MyLayout.VBox();
            main.SetParam(null, 5, 5);
            main.AddHBox(3, 3);
            main.AddHBox(3, 3);
            main.AddPanel(3, 3);
            main.AddHBox(3, 3);
            main.AddHBox(3, 3);
            main.AddHBox(3, 3);
            main.AddGrid(3, 3);
            main.SetVertical(new short[] { 40, 50, 120, -1, -1, 40, -7 });

            MyLayout.Panel p = main.children[0];
            p.AddPanel(0, 0);
            p.AddEmpty(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.SetHorizontal(new short[] { 100, -1, 100, 100, 100 });

            p = main.children[1];
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddEmpty(0, 0);
            p.AddPanel(0, 0);
            p.SetHorizontal(new short[] { 50, 120, -1, 50 });

            p = main.children[3];
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddEmpty(0, 0);
            p.SetHorizontal(new short[] { -1, -1, -4 });

            p = main.children[4];
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.SetHorizontal(MyLayout.Panel.GetDefault(6));

            p = main.children[5];
            p.AddPanel(0, 0);
            p.AddPanel(0, 0);
            p.AddEmpty(0, 0);
            p.SetHorizontal(new short[] { 140, 120, -1 });

            p = main.children[6];
            p.AddPanel(0, 0, 35);
            p.SetHorizontal(MyLayout.Panel.GetDefault(5));
            p.SetVertical(MyLayout.Panel.GetDefault(7));
        }
Exemplo n.º 3
0
        void Test2()
        {
            main = new MyLayout.VBox();
            main.SetParam(null, 5, 5);

            main.AddPanel(5, 5);
            main.AddEmpty(5, 5);
            main.AddPanel(5, 5);
            main.AddVBox(5, 5);
            main.AddGrid(5, 5);
            main.SetVertical(new short[] { 100, -1, -2, -1, 100 });
        }
Exemplo n.º 4
0
        void Test4()
        {
            main = new MyLayout.VBox();
            main.SetParam(null, 10, 10);

            main.AddHBox(5, 5);
            main.AddPanel(5, 5);
            main.AddGrid(5, 3);
            main.SetVertical(new short[] { 40, 120, -1 });

            MyLayout.Panel p = main.children[0];
            p.AddPanel(5, 5);
            p.AddEmpty(5, 5);
            p.AddPanel(5, 5);
            p.SetHorizontal(new short[] { 100, -1, 100 });

            MyLayout.Panel p2 = main.children[2];
            p2.AddPanel(0, 0, 24);
            p2.SetHorizontal(MyLayout.Panel.GetDefault(4));
            p2.SetVertical(MyLayout.Panel.GetDefault(6));
        }