Exemplo n.º 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;
 }
Exemplo n.º 2
0
        public SetCaretPositionAction(
			RootBlock root, 
			TextBoxBlock toFocus, 
			SetFocusOptions options,
			int caretPosition)
            : base(toFocus, options)
        {
            CaretPosition = caretPosition;
            Text = toFocus;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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());
        }
Exemplo n.º 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;
        }
Exemplo n.º 7
0
        protected void CtrlEnter()
        {
            if (!CanCtrlEnter())
            {
                return;
            }

            TextBoxBlock next = ParentParent.Next as TextBoxBlock;

            if (next == null)
            {
                return;
            }

            next.SetFocus();
        }
Exemplo n.º 8
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.º 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();
        }
Exemplo n.º 10
0
 private void InitField(TextBoxBlock field)
 {
     field.MyTextBox.MinWidth = 16;
 }
Exemplo 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;
        }
Exemplo 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;
        }