コード例 #1
0
 private void Init(string label)
 {
     this.CanMoveUpDown = false;
     Keyword            = new KeywordLabel(label);
     Keyword.MyControl.Box.Margins.SetAll(2);
     this.HMembers.Children.Add(Keyword);
 }
コード例 #2
0
ファイル: DoBlock.cs プロジェクト: Ju2ender/csharp-e
        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);
        }
コード例 #3
0
ファイル: DoBlock.cs プロジェクト: orb1t/StructuredEditor
        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);
        }
コード例 #4
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());
 }
コード例 #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());
 }
コード例 #6
0
 private void Init(string label)
 {
     this.CanMoveUpDown = false;
     Keyword = new KeywordLabel(label);
     Keyword.MyControl.Box.Margins.SetAll(2);
     this.HMembers.Children.Add(Keyword);
 }