private void Init(string label)
 {
     this.CanMoveUpDown = false;
     Keyword            = new KeywordLabel(label);
     Keyword.MyControl.Box.Margins.SetAll(2);
     this.HMembers.Children.Add(Keyword);
 }
Exemple #2
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);
        }
Exemple #3
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);
        }
 public ControlStructureBlock(string name)
     : base()
 {
     Keyword = new KeywordLabel(name);
     MyUniversalControl.Box.Margins.Left = -1;
     MyUniversalControl.Box.Margins.Top = 1;
     this.MyUniversalControl.OpenCurlyHasNegativeLowerMargin = false;
     this.HMembers.Add(Keyword);
     this.VMembers.Add(new StatementLine());
 }
Exemple #5
0
 public ControlStructureBlock(string name)
     : base()
 {
     Keyword = new KeywordLabel(name);
     MyUniversalControl.Box.Margins.Left = -1;
     MyUniversalControl.Box.Margins.Top  = 1;
     this.MyUniversalControl.OpenCurlyHasNegativeLowerMargin = false;
     this.HMembers.Add(Keyword);
     this.VMembers.Add(new StatementLine());
 }
 private void Init(string label)
 {
     this.CanMoveUpDown = false;
     Keyword = new KeywordLabel(label);
     Keyword.MyControl.Box.Margins.SetAll(2);
     this.HMembers.Children.Add(Keyword);
 }