diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs index e1b9e8179..ab37832fd 100644 --- a/Terminal.Gui/Views/RadioGroup.cs +++ b/Terminal.Gui/Views/RadioGroup.cs @@ -21,6 +21,19 @@ namespace Terminal.Gui { CanFocus = true; } + /// + /// The location of the cursor in the radio group + /// + public int Cursor { + get => cursor; + set { + if (cursor < 0 || cursor >= radioLabels.Length) + return; + cursor = value; + SetNeedsDisplay (); + } + } + /// /// Initializes a new instance of the class /// setting up the initial set of radio labels and the item that should be selected. diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index ac5ad00ef..ba3114425 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -23,6 +23,11 @@ namespace Terminal.Gui { int first, point; bool used; + /// + /// Tracks whether the text field should be considered "used", that is, that the user has moved in the entry, so new input should be appended at the cursor position, rather than clearing the entry + /// + public bool Used { get => used; set { used = value; } } + /// /// Changed event, raised when the text has clicked. /// diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 855d1dc69..5aec4db4d 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -665,6 +665,18 @@ namespace Terminal.Gui { PositionCursor (); } + /// + /// Will scroll the view to display the specified row at the top + /// + /// Row that should be displayed at the top + public void ScrollTo (int row) + { + if (row < 0) + row = 0; + topRow = row > model.Count ? model.Count - 1 : row; + SetNeedsDisplay (); + } + bool lastWasKill; public override bool ProcessKey (KeyEvent kb)