Ejemplo n.º 1
0
        public DoWhileBlock()
            : base()
        {
            DoPart = new DoBlock();
            WhilePart = new HContainerBlock();
            WhileKeyword = new KeywordLabel("while");
            Condition = new ExpressionBlock();
            Condition.MyControl.KeyDown += delegate(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Return)
                {
                    this.OnKeyDown(sender, e);
                    e.Handled = true;
                }
            };
            WhilePart.Add(WhileKeyword, Condition);
            Condition.Context = CompletionContext.BooleanExpression;
            Condition.MyControl.Box.Margins.Left = ShapeStyle.DefaultFontSize;
            Condition.MyControl.Box.SetMouseSensitivityToMargins();

            MyControl.Focusable = true;
            DoPart.MyControl.Focusable = false;
            Menu = DeleteCommand.CreateDeleteMenu(this);
            DoPart.Menu = null;
            this.CanMoveUpDown = true;
            this.Draggable = true;

            this.MyControl.Style = DoPart.MyControl.Style;
            this.MyControl.SelectedStyle = DoPart.MyControl.SelectedStyle;
            this.MyControl.ShouldDrawBackground = false;

            this.Add(DoPart, WhilePart);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public TextLikeCodeBlock()
            : base()
        {
            this.MyControl.Focusable = true;

            HMembers = new HContainerBlock();
            VMembers = new VContainerBlock();

            HMembers.CanBeSelected = false;
            VMembers.CanBeSelected = false;

            HeaderLine = new HContainerBlock();
            HeaderLine.Children.Add(new PictureBlock(CSharpPictureLibrary.Instance.Minus));
            HeaderLine.Children.Add(HMembers);

            this.Children.Add(HeaderLine);
            this.Children.Add("{");

            HContainerBlock body = new HContainerBlock();
            body.CanBeSelected = false;
            this.Children.Add(body);
            body.Children.Add("    ");
            body.Children.Add(VMembers);

            this.Children.Add("}");
        }
Ejemplo n.º 4
0
        public TutorialRootBlock2()
            : base()
        {
            HContainerBlock row = new HContainerBlock();
            row.Add(captionCelsius, value, captionFahrenheit, result);
            this.Add(row);

            value.TextChanged += value_TextChanged;
        }
Ejemplo n.º 5
0
        public TreeViewNode()
            : base()
        {
            HMembers = new HContainerBlock();
            VMembers = new VContainerBlock();

            this.Add(HMembers);
            this.Add(VMembers);

            InitControl();
        }
Ejemplo n.º 6
0
        public InterfaceAccessorsBlock()
        {
            Empty = new TextBoxBlock();
            Empty.MyTextBox.MinWidth = 1;
            Empty.MyTextBox.Box.Margins.SetLeftAndRight(ShapeStyle.DefaultFontSize / 2);
            Empty.MyTextBox.Box.SetMouseSensitivityToMargins();
            this.MyControl.Focusable = true;
            this.MyControl.Stretch = GuiLabs.Canvas.Controls.StretchMode.None;
            this.MyControl.Box.Margins.SetLeftAndRight(ShapeStyle.DefaultFontSize);
            this.MyControl.Box.SetMouseSensitivityToMargins();

            InternalContainer = new HContainerBlock();
            this.Add("{");
            this.Add(InternalContainer);
            this.Add("}");

            InternalContainer.Add(Empty);
        }
Ejemplo n.º 7
0
        protected virtual HContainerBlock CreateHMembers()
        {
            HContainerBlock result = new HContainerBlock();

            return(result);
        }
Ejemplo n.º 8
0
 protected virtual HContainerBlock CreateHMembers()
 {
     HContainerBlock result = new HContainerBlock();
     return result;
 }
Ejemplo n.º 9
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());
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
0
        public TutorialRootBlock3()
            : base()
        {
            HContainerBlock con = new HContainerBlock();
            this.Add(con);

            TextBoxBlock text = new TextBoxBlock();
            con.Add(text);
            con.Add("// here the TextBox ends");

            text.MyTextBox.MinWidth = 40;
        }
Ejemplo n.º 12
0
        public TutorialRootBlock4()
            : base()
        {
            HContainerBlock con = new HContainerBlock();
            this.Add(con);

            button = new ButtonBlock("Hide the text");
            text = new TextBoxBlock();
            con.Add(button);
            con.Add(text);

            button.Pushed += button_Pushed;
        }