public TextEditorEnsemble(string name) : base(name, Docking.Fill, new EmptyWidgetStyle()) { Editor = new MultiLineTextBox("editor", new MultiLineTextEditWidgetStyle()); //Tools = new TextEditorToolBar (Editor, null); RowColumn = new TextEditorRowColumn(Editor); //Children.Add (Tools); Children.Add(RowColumn); Children.Add(Editor); CommandInput = AddChild(new CommandInputBar("commandinput", Editor, "Search for > ")); CommandInput.Visible = false; CanFocus = true; }
public CommandInputBar(string name, MultiLineTextBox owner, string infoText, Docking dock = Docking.Bottom, IWidgetStyle style = null) : base(name, dock, style ?? new DarkPanelWidgetStyle()) { Owner = owner; Input = AddChild(new CommandInputTextBox("input", infoText)); CancelButton = AddChild(new Button("cancelbutton", "Cancel", ColorContexts.Default)); CancelButton.Dock = Docking.Right; CancelButton.HandlesEscapeKey = true; //CancelButton.ApplyCommandButtonPadding (); CancelButton.Margin = new Padding(4, 0, 0, 0); CancelButton.Click += delegate { if (Owner != null) { Owner.Focus(); Visible = false; } }; OkButton = AddChild(new Button("actionbutton", "Find", ColorContexts.Default)); OkButton.Dock = Docking.Right; OkButton.HandlesEnterKey = true; OkButton.ApplyCommandButtonPadding(); OkButton.MakeDefaultButton(); OkButton.Click += delegate { if (Owner != null) { Owner.Focus(); Owner.FindText(Input.Text, FindDirections.Next); Visible = false; } }; Input.Dock = Docking.Fill; BackColor = Theme.Colors.Base00; Padding = new Padding(4); CanFocus = true; Input.TextChanged += delegate { EnableWidgets(); }; EnableWidgets(); }
protected override void CleanupManagedResources() { Editor = null; base.CleanupManagedResources(); }
public TextEditorToolBar(MultiLineTextBox editor, IGuiMenu menu = null) : base("editortoolbar", menu) { Editor = editor; }