Beispiel #1
0
        public void InitTextBoxBlockWithCompletion()
        {
            UniversalBlock u = new UniversalBlock();
            u.HMembers.Children.Add("Text completion");
            HContainerBlock h = new HContainerBlock();
            u.VMembers.Children.Add(h);
            TextBoxBlockWithCompletion t = new TextBoxBlockWithCompletion();
            h.Children.Add("Text: ");
            h.Children.Add(t);
            //t.AddTextItem("Monday");
            //t.AddTextItem("Tuesday");
            //t.AddTextItem("Wednesday");
            //t.AddTextItem("Thursday");
            //t.AddTextItem("Friday");
            //t.AddTextItem("Saturday");
            //t.AddTextItem("Sunday");
            //t.AddTextItem("Hello");
            //t.AddTextItem("World");

            System.Type typ = typeof(System.Drawing.Color);
            foreach (System.Reflection.PropertyInfo member in typ.GetProperties())
            {
                t.AddTextItem(member.Name);
            }

            t.AddTextItem("=");
            t.AddTextItem("dad");
            t.AddTextItem("Color");

            this.Children.Add(u);
        }
Beispiel #2
0
        public static string SelectFirstChild(UniversalBlock block)
        {
            Block  firstChild  = block.FindFirstFocusableChild();
            string keyForChild = "DownArrow";

            if (block.MyUniversalControl.LinearLayoutStrategy.Orientation == GuiLabs.Canvas.Controls.OrientationType.Horizontal)
            {
                keyForChild = "RightArrow";
            }
            else
            {
                firstChild = block.VMembers.FindFirstFocusableBlock();
            }

            if (firstChild != null)
            {
                return(PressKeyToSelect("the first child block", keyForChild));
            }
            else
            {
                return(PressKeyToSelect("the next block", keyForChild));
            }
        }
Beispiel #3
0
        public static string SelectFirstChild(UniversalBlock block)
        {
            Block firstChild = block.FindFirstFocusableChild();
            string keyForChild = "DownArrow";

            if (block.MyUniversalControl.LinearLayoutStrategy.Orientation == GuiLabs.Canvas.Controls.OrientationType.Horizontal)
            {
                keyForChild = "RightArrow";
            }
            else
            {
                firstChild = block.VMembers.FindFirstFocusableBlock();
            }

            if (firstChild != null)
            {
                return PressKeyToSelect("the first child block", keyForChild);
            }
            else
            {
                return PressKeyToSelect("the next block", keyForChild);
            }
        }
Beispiel #4
0
        private void InitAlignment()
        {
            AlignmentTestBlock = new UniversalBlock();
            AlignmentTestBlock.HMembers.Children.Add("Layout test");

            // configuration buttons
            Alignment = new ButtonBlock("Alignment: LeftOrTopEdge");
            OrientationButton = new ButtonBlock("Orientation: Vertical");
            Alignment.MyButton.Pushed += Alignment_Pushed;
            OrientationButton.MyButton.Pushed += Orientation_Pushed;

            // ===============================================
            // init layout and set preferred properties
            // ===============================================

            layoutTest = new LayoutTestBlock();
            layout = layoutTest.LinearLayoutStrategy;

            layout.Orientation = OrientationType.Vertical;
            layout.Alignment = AlignmentType.LeftOrTopEdge;
            layout.XSpacing = 24;
            layout.YSpacing = 24;
            layout.WrapMaxSize = 950;
            layoutTest.MyControl.Box.Padding.SetLeftAndRight(16);
            layoutTest.MyControl.Box.Padding.SetTopAndBottom(32);

            layoutTest.MyControl.Layout();

            // ===============================================

            AlignmentTestBlock.VMembers.Children.Add(Alignment);
            AlignmentTestBlock.VMembers.Children.Add(OrientationButton);
            AlignmentTestBlock.VMembers.Children.Add(layoutTest);

            this.Children.Add(AlignmentTestBlock);
        }
Beispiel #5
0
        private void InitTextLine()
        {
            UniversalBlock TextLineTest = new UniversalBlock();
            this.Children.Add(TextLineTest);

            TextLineTest.HMembers.Children.Add("labels, texts, buttons");
            HContainerBlock line = new HContainerBlock();
            TextLineTest.VMembers.Children.Add(line);

            line.Children.Add(new TextBoxBlock());

            ButtonBlock b = new ButtonBlock("focusable");
            b.MyControl.Focusable = true;
            line.Children.Add(b);

            line.Children.Add("bla");
            line.Children.Add(new TestSelectionLabelBlock("Monday"));

            TextSelectionBlock fromArray = new TextSelectionBlock(
                new string[] {
                    "Montag",
                    "Dienstag",
                    "Mittwoch",
                    "Donnerstag",
                    "Freitag",
                    "Samstag",
                    "Sonntag" });
            line.Children.Add(fromArray);

            TextSelectionBlock fromEnum = new TextSelectionBlock(
                System.Windows.Forms.Keys.A);
            line.Children.Add(fromEnum);

            line.Children.Add(new TextBoxBlock());
        }
Beispiel #6
0
        private void InitMultiline()
        {
            MultilineContainer = new UniversalBlock();
            MultilineContainer.HMembers.Children.Add("multiline test");
            this.Children.Add(MultilineContainer);

            MultilineContainer.VMembers.Children.Add(new MagicTextLine());
        }
Beispiel #7
0
        private void InitButtons()
        {
            UniversalBlock ButtonsTest = new UniversalBlock();
            HContainerBlock h = new HContainerBlock();

            ButtonsTest.HMembers.Add("Buttons");
            ButtonsTest.VMembers.Add(h);

            h.Add("Buttons: 1. text: ");
            h.Add(new ButtonBlock("caption"));
            h.Add(" 2. picture: ");
            h.Add(new ButtonBlock(PictureLibrary.Instance.Collapsed));
            h.Add(" 3. picture and text: ");
            h.Add(new ButtonBlock(PictureLibrary.Instance.Delete, "imagebutton"));
            h.Add(" 4. text and picture: ");
            h.Add(new ButtonBlock("imagebutton", PictureLibrary.Instance.Plus));

            ButtonBlock b2 = new ButtonBlock(PictureLibrary.Instance.Delete2, "under pic");
            b2.MyButton.LayoutStrategy = LayoutFactory.VerticalIndented;
            ButtonsTest.VMembers.Children.Add(b2);

            this.Children.Add(ButtonsTest);
        }