From f30dcf5ef41d54c588d7b42c48be8d941abba72e Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 8 Jan 2017 09:57:10 -0500 Subject: Initial upload --- ShiftOS.WinForms/Controls/TerminalBox.cs | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ShiftOS.WinForms/Controls/TerminalBox.cs (limited to 'ShiftOS.WinForms/Controls/TerminalBox.cs') diff --git a/ShiftOS.WinForms/Controls/TerminalBox.cs b/ShiftOS.WinForms/Controls/TerminalBox.cs new file mode 100644 index 0000000..e0745d4 --- /dev/null +++ b/ShiftOS.WinForms/Controls/TerminalBox.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ShiftOS.Engine; + +namespace ShiftOS.WinForms.Controls +{ + public class TerminalBox : RichTextBox, ITerminalWidget + { + public void SelectBottom() + { + try + { + this.Select(this.Text.Length, 0); + this.ScrollToCaret(); + } + catch { } + } + + public void Write(string text) + { + this.Text += Localization.Parse(text); + } + + public void WriteLine(string text) + { + this.Text += Localization.Parse(text) + Environment.NewLine; + } + } +} -- cgit v1.2.3