Exemplo 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);
        }
Exemplo n.º 2
0
        public TutorialRootBlock2()
            : base()
        {
            HContainerBlock row = new HContainerBlock();
            row.Add(captionCelsius, value, captionFahrenheit, result);
            this.Add(row);

            value.TextChanged += value_TextChanged;
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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;
        }