Add menu, ugly looking for now

This commit is contained in:
Miguel de Icaza
2018-01-04 22:29:48 -05:00
parent 27a8e1ca9d
commit cf2ea67e2b
8 changed files with 439 additions and 18 deletions

19
Core.cs
View File

@@ -317,6 +317,25 @@ namespace Terminal {
Driver.Clip = savedClip;
}
/// <summary>
/// Utility function to draw strings that contain a hotkey
/// </summary>
/// <param name="s">String to display, the underscoore before a letter flags the next letter as the hotkey.</param>
/// <param name="hotColor">Hot color.</param>
/// <param name="normalColor">Normal color.</param>
public void DrawHotString (string text, Attribute hotColor, Attribute normalColor)
{
Driver.SetAttribute (normalColor);
foreach (var c in text) {
if (c == '_') {
Driver.SetAttribute (hotColor);
continue;
}
Driver.AddCh (c);
Driver.SetAttribute (normalColor);
}
}
/// <summary>
/// This moves the cursor to the specified column and row in the view.
/// </summary>