示例#1
0
 public static ParameterList ParseParameters(TextBoxBlock parametersText)
 {
     LanguageService ls = Get(parametersText);
     if (ls != null && ls.Parser != null)
     {
         return ls.Parser.ParseParameters(parametersText.Text);
     }
     return null;
 }
        public SetCaretPositionAction(
			RootBlock root, 
			TextBoxBlock toFocus, 
			SetFocusOptions options,
			int caretPosition)
            : base(toFocus, options)
        {
            CaretPosition = caretPosition;
            Text = toFocus;
        }
示例#3
0
        public NameValueBlock(string name, string value)
            : base()
        {
            Name = new LabelBlock(name);
            Value = new TextBoxBlock(value);

            this.Add(Name, Value);

            this.MyListControl.Focusable = true;
        }
示例#4
0
        public NameValueBlock(string name, string value)
            : base()
        {
            Name  = new LabelBlock(name);
            Value = new TextBoxBlock(value);

            this.Add(Name, Value);

            this.MyListControl.Focusable = true;
        }
示例#5
0
        public override void Click(CompletionFunctionality hostItemList)
        {
            Parent = hostItemList.HostBlock as TextBoxBlock;
            Param.CheckNotNull(Parent, "Parent");

            int toDel = NumOfCharsToDelete();
            if (toDel > 0)
            {
                Parent.MyTextBox.CaretPosition -= toDel;
                Parent.MyTextBox.InsertText(this.Text);
                return;
            }
            Parent.MyTextBox.InsertText(GetSuffixToAdd());
        }
示例#6
0
        public NodeBlock()
        {
            NameBlock = new TextBoxBlock();
            Attributes = new AttributeList();

            this.HMembers.Add(NameBlock);
            this.HMembers.Add(Attributes);

            this.VMembers.Add(new EmptyNodeBlock());
            this.VMembers.AddAcceptableBlockTypes<NodeBlock>();
            this.VMembers.AddAcceptableBlockTypes<EmptyNodeBlock>();

            this.Draggable = true;
            this.CanMoveUpDown = true;
        }
示例#7
0
        protected void CtrlEnter()
        {
            if (!CanCtrlEnter())
            {
                return;
            }

            TextBoxBlock next = ParentParent.Next as TextBoxBlock;

            if (next == null)
            {
                return;
            }

            next.SetFocus();
        }
        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);
        }
示例#9
0
        public void TestSetTextInTransaction()
        {
            TextBoxBlock name = new TextBoxBlock();
            Root.Add(name);

            name.MyTextBox.MinWidth = 30;

            name.Text = "A"; // takes effect immediately
            Assert(name.Text == "A");

            using (Transaction t = Transaction.Create(Root))
            {
                // takes effect only after
                // the transaction is committed (disposed)
                name.Text = "B";
                Assert(name.Text == "A");
            }

            // "B", because the transaction was committed
            // after exiting the using statement
            Assert(name.Text == "B");

            name.Delete();
        }
示例#10
0
 private void InitField(TextBoxBlock field)
 {
     field.MyTextBox.MinWidth = 16;
 }
示例#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;
        }
示例#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;
        }