Couple of user requests

This commit is contained in:
Miguel de Icaza
2019-04-29 14:56:54 -04:00
parent 4f25625ed3
commit 3329e2b345
3 changed files with 30 additions and 0 deletions

View File

@@ -21,6 +21,19 @@ namespace Terminal.Gui {
CanFocus = true;
}
/// <summary>
/// The location of the cursor in the radio group
/// </summary>
public int Cursor {
get => cursor;
set {
if (cursor < 0 || cursor >= radioLabels.Length)
return;
cursor = value;
SetNeedsDisplay ();
}
}
/// <summary>
/// Initializes a new instance of the <see cref="T:Terminal.Gui.RadioGroup"/> class
/// setting up the initial set of radio labels and the item that should be selected.

View File

@@ -23,6 +23,11 @@ namespace Terminal.Gui {
int first, point;
bool used;
/// <summary>
/// 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
/// </summary>
public bool Used { get => used; set { used = value; } }
/// <summary>
/// Changed event, raised when the text has clicked.
/// </summary>

View File

@@ -665,6 +665,18 @@ namespace Terminal.Gui {
PositionCursor ();
}
/// <summary>
/// Will scroll the view to display the specified row at the top
/// </summary>
/// <param name="row">Row that should be displayed at the top</param>
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)