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; }
public NameValueBlock(string name, string value) : base() { Name = new LabelBlock(name); Value = new TextBoxBlock(value); this.Add(Name, Value); this.MyListControl.Focusable = true; }
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()); }
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; }
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); }
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(); }
private void InitField(TextBoxBlock field) { field.MyTextBox.MinWidth = 16; }
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; }
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; }