diff --git a/Terminal.Gui/Configuration/AttributeJsonConverter.cs b/Terminal.Gui/Configuration/AttributeJsonConverter.cs index 5ef2c001e..6add9b8df 100644 --- a/Terminal.Gui/Configuration/AttributeJsonConverter.cs +++ b/Terminal.Gui/Configuration/AttributeJsonConverter.cs @@ -7,7 +7,7 @@ namespace Terminal.Gui { /// /// Json converter fro the class. /// - public class AttributeJsonConverter : JsonConverter { + class AttributeJsonConverter : JsonConverter { private static AttributeJsonConverter instance; /// @@ -23,7 +23,6 @@ namespace Terminal.Gui { } } - /// public override Attribute Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType != JsonTokenType.StartObject) { @@ -74,7 +73,6 @@ namespace Terminal.Gui { throw new JsonException (); } - /// public override void Write (Utf8JsonWriter writer, Attribute value, JsonSerializerOptions options) { writer.WriteStartObject (); diff --git a/Terminal.Gui/Configuration/ColorJsonConverter.cs b/Terminal.Gui/Configuration/ColorJsonConverter.cs index 93ae8317e..0a417ac42 100644 --- a/Terminal.Gui/Configuration/ColorJsonConverter.cs +++ b/Terminal.Gui/Configuration/ColorJsonConverter.cs @@ -7,7 +7,7 @@ namespace Terminal.Gui { /// /// Json converter for the class. /// - public class ColorJsonConverter : JsonConverter { + internal class ColorJsonConverter : JsonConverter { private static ColorJsonConverter instance; /// @@ -23,7 +23,6 @@ namespace Terminal.Gui { } } - /// public override Color Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { // Check if the value is a string @@ -52,7 +51,6 @@ namespace Terminal.Gui { } } - /// public override void Write (Utf8JsonWriter writer, Color value, JsonSerializerOptions options) { // Try to get the human readable color name from the map diff --git a/Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs b/Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs index 0c036bd65..6a57de14d 100644 --- a/Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs +++ b/Terminal.Gui/Configuration/ColorSchemeJsonConverter.cs @@ -6,7 +6,7 @@ namespace Terminal.Gui { /// /// Implements a JSON converter for . /// - public class ColorSchemeJsonConverter : JsonConverter { + class ColorSchemeJsonConverter : JsonConverter { private static ColorSchemeJsonConverter instance; /// diff --git a/Terminal.Gui/Configuration/ConfigurationManager.cs b/Terminal.Gui/Configuration/ConfigurationManager.cs index a0cabdf51..455697ffc 100644 --- a/Terminal.Gui/Configuration/ConfigurationManager.cs +++ b/Terminal.Gui/Configuration/ConfigurationManager.cs @@ -1,4 +1,6 @@ -using System; +global using CM = Terminal.Gui.ConfigurationManager; + +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -8,8 +10,6 @@ using System.Reflection; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using System.Threading.Tasks; -using static Terminal.Gui.ConfigurationManager; #nullable enable @@ -57,14 +57,15 @@ namespace Terminal.Gui { private static readonly string _configFilename = "config.json"; - private static readonly JsonSerializerOptions serializerOptions = new JsonSerializerOptions { + private static readonly JsonSerializerOptions _serializerOptions = new JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip, PropertyNameCaseInsensitive = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, WriteIndented = true, Converters = { - // No need to set converters - the ConfigRootConverter uses property attributes apply the correct - // Converter. + // We override the standard Rune converter to support specifying Glyphs in + // a flexible way + new RuneJsonConverter(), }, }; @@ -228,6 +229,13 @@ namespace Terminal.Gui { [SerializableConfigurationProperty (Scope = typeof (SettingsScope), OmitClassName = true), JsonPropertyName ("AppSettings")] public static AppScope? AppSettings { get; set; } + /// + /// The set of glyphs used to draw checkboxes, lines, borders, etc...See also . + /// + [SerializableConfigurationProperty (Scope = typeof (SettingsScope), OmitClassName = true), + JsonPropertyName ("Glyphs")] + public static GlyphDefinitions Glyphs { get; set; } = new GlyphDefinitions (); + /// /// Initializes the internal state of ConfigurationManager. Nominally called once as part of application /// startup to initialize global state. Also called from some Unit Tests to ensure correctness (e.g. Reset()). @@ -249,7 +257,7 @@ namespace Terminal.Gui { classesWithConfigProps.Add (classWithConfig.Name, classWithConfig); } - Debug.WriteLine ($"ConfigManager.getConfigProperties found {classesWithConfigProps.Count} clases:"); + Debug.WriteLine ($"ConfigManager.getConfigProperties found {classesWithConfigProps.Count} classes:"); classesWithConfigProps.ToList ().ForEach (x => Debug.WriteLine ($" Class: {x.Key}")); foreach (var p in from c in classesWithConfigProps @@ -274,7 +282,7 @@ namespace Terminal.Gui { _allConfigProperties = _allConfigProperties!.OrderBy (x => x.Key).ToDictionary (x => x.Key, x => x.Value, StringComparer.InvariantCultureIgnoreCase); Debug.WriteLine ($"ConfigManager.Initialize found {_allConfigProperties.Count} properties:"); - _allConfigProperties.ToList ().ForEach (x => Debug.WriteLine ($" Property: {x.Key}")); + //_allConfigProperties.ToList ().ForEach (x => Debug.WriteLine ($" Property: {x.Key}")); AppSettings = new AppScope (); } @@ -286,12 +294,12 @@ namespace Terminal.Gui { internal static string ToJson () { Debug.WriteLine ($"ConfigurationManager.ToJson()"); - return JsonSerializer.Serialize (Settings!, serializerOptions); + return JsonSerializer.Serialize (Settings!, _serializerOptions); } internal static Stream ToStream () { - var json = JsonSerializer.Serialize (Settings!, serializerOptions); + var json = JsonSerializer.Serialize (Settings!, _serializerOptions); // turn it into a stream var stream = new MemoryStream (); var writer = new StreamWriter (stream); @@ -371,8 +379,9 @@ namespace Terminal.Gui { AppSettings = new AppScope (); // To enable some unit tests, we only load from resources if the flag is set - if (Locations.HasFlag (ConfigLocations.DefaultOnly)) Settings.UpdateFromResource (typeof (ConfigurationManager).Assembly, $"Terminal.Gui.Resources.{_configFilename}"); - + if (Locations.HasFlag (ConfigLocations.DefaultOnly)) { + Settings.UpdateFromResource (typeof (ConfigurationManager).Assembly, $"Terminal.Gui.Resources.{_configFilename}"); + } Apply (); ThemeManager.Themes? [ThemeManager.SelectedTheme]?.Apply (); AppSettings?.Apply (); @@ -413,7 +422,7 @@ namespace Terminal.Gui { public static void Apply () { bool settings = Settings?.Apply () ?? false; - bool themes = ThemeManager.Themes? [ThemeManager.SelectedTheme]?.Apply () ?? false; + bool themes = !string.IsNullOrEmpty(ThemeManager.SelectedTheme) && (ThemeManager.Themes? [ThemeManager.SelectedTheme]?.Apply () ?? false); bool appsettings = AppSettings?.Apply () ?? false; if (settings || themes || appsettings) { OnApplied (); @@ -520,7 +529,7 @@ namespace Terminal.Gui { { var emptyScope = new SettingsScope (); emptyScope.Clear (); - return JsonSerializer.Serialize (emptyScope, serializerOptions); + return JsonSerializer.Serialize (emptyScope, _serializerOptions); } /// diff --git a/Terminal.Gui/Configuration/DictionaryJsonConverter.cs b/Terminal.Gui/Configuration/DictionaryJsonConverter.cs index 5027e22cb..d6187fc14 100644 --- a/Terminal.Gui/Configuration/DictionaryJsonConverter.cs +++ b/Terminal.Gui/Configuration/DictionaryJsonConverter.cs @@ -4,7 +4,6 @@ using System.Text.Json.Serialization; using System.Text.Json; namespace Terminal.Gui { - class DictionaryJsonConverter : JsonConverter> { public override Dictionary Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { diff --git a/Terminal.Gui/Configuration/KeyJsonConverter.cs b/Terminal.Gui/Configuration/KeyJsonConverter.cs index 216689d18..3474c16d6 100644 --- a/Terminal.Gui/Configuration/KeyJsonConverter.cs +++ b/Terminal.Gui/Configuration/KeyJsonConverter.cs @@ -4,11 +4,7 @@ using System.Text.Json; using System.Text.Json.Serialization; namespace Terminal.Gui { - /// - /// Json converter for the class. - /// - public class KeyJsonConverter : JsonConverter { - /// + class KeyJsonConverter : JsonConverter { public override Key Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType == JsonTokenType.StartObject) { @@ -91,7 +87,6 @@ namespace Terminal.Gui { throw new JsonException ($"Unexpected StartObject token when parsing Key: {reader.TokenType}."); } - /// public override void Write (Utf8JsonWriter writer, Key value, JsonSerializerOptions options) { writer.WriteStartObject (); diff --git a/Terminal.Gui/Configuration/RuneJsonConverter.cs b/Terminal.Gui/Configuration/RuneJsonConverter.cs new file mode 100644 index 000000000..725b1aa20 --- /dev/null +++ b/Terminal.Gui/Configuration/RuneJsonConverter.cs @@ -0,0 +1,49 @@ +using System; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; +//using Rune = System.Rune; + +namespace Terminal.Gui { + /// + /// Json converter for . Supports + /// A string as one of: + /// - unicode char (e.g. "☑") + /// - U+hex format (e.g. "U+2611") + /// - \u format (e.g. "\\u2611") + /// A number + /// - The unicode code in decimal + /// + internal class RuneJsonConverter : JsonConverter { + public override System.Rune Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.String) { + var value = reader.GetString (); + if (value.ToUpper ().StartsWith ("U+") || value.StartsWith ("\\u")) { + try { + uint result = uint.Parse (value [2..^0], System.Globalization.NumberStyles.HexNumber); + return new System.Rune (result); + } catch (FormatException e) { + throw new JsonException ($"Invalid Rune format: {value}.", e); + } + } else { + return new System.Rune (value [0]); + } + throw new JsonException ($"Invalid Rune format: {value}."); + } else if (reader.TokenType == JsonTokenType.Number) { + return new System.Rune (reader.GetUInt32 ()); + } + throw new JsonException ($"Unexpected StartObject token when parsing Rune: {reader.TokenType}."); + } + + public override void Write (Utf8JsonWriter writer, System.Rune value, JsonSerializerOptions options) + { + // HACK: Writes a JSON comment in addition to the glyph to ease debugging. + // Technically, JSON comments are not valid, but we use relaxed decoding + // (ReadCommentHandling = JsonCommentHandling.Skip) + writer.WriteCommentValue ($"(U+{value.Value:X4})"); + writer.WriteRawValue ($"\"{value}\""); + } + } +#pragma warning restore 1591 +} diff --git a/Terminal.Gui/Configuration/Scope.cs b/Terminal.Gui/Configuration/Scope.cs index c69aae46e..d950405ed 100644 --- a/Terminal.Gui/Configuration/Scope.cs +++ b/Terminal.Gui/Configuration/Scope.cs @@ -82,7 +82,7 @@ namespace Terminal.Gui { /// config data to/from JSON documents. /// /// - public class ScopeJsonConverter : JsonConverter where scopeT : Scope { + class ScopeJsonConverter : JsonConverter where scopeT : Scope { // See: https://stackoverflow.com/questions/60830084/how-to-pass-an-argument-by-reference-using-reflection internal abstract class ReadHelper { public abstract object? Read (ref Utf8JsonReader reader, Type type, JsonSerializerOptions options); @@ -97,7 +97,6 @@ namespace Terminal.Gui { => _readDelegate.Invoke (ref reader, type, options); } - /// public override scopeT Read (ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (reader.TokenType != JsonTokenType.StartObject) { @@ -170,7 +169,6 @@ namespace Terminal.Gui { throw new JsonException (); } - /// public override void Write (Utf8JsonWriter writer, scopeT scope, JsonSerializerOptions options) { writer.WriteStartObject (); diff --git a/Terminal.Gui/Configuration/SettingsScope.cs b/Terminal.Gui/Configuration/SettingsScope.cs index cc91eb0e2..2bf7288c3 100644 --- a/Terminal.Gui/Configuration/SettingsScope.cs +++ b/Terminal.Gui/Configuration/SettingsScope.cs @@ -47,7 +47,7 @@ namespace Terminal.Gui { { // Update the existing settings with the new settings. try { - Update (JsonSerializer.Deserialize (stream, serializerOptions)!); + Update (JsonSerializer.Deserialize (stream, _serializerOptions)!); OnUpdated (); Debug.WriteLine ($"ConfigurationManager: Read configuration from \"{source}\""); Sources.Add (source); diff --git a/Terminal.Gui/Configuration/ThemeScope.cs b/Terminal.Gui/Configuration/ThemeScope.cs index 3bab13810..04adf94a5 100644 --- a/Terminal.Gui/Configuration/ThemeScope.cs +++ b/Terminal.Gui/Configuration/ThemeScope.cs @@ -203,62 +203,49 @@ namespace Terminal.Gui { } #region IDictionary - /// +#pragma warning disable 1591 + public ICollection Keys => ((IDictionary)Themes!).Keys; - /// public ICollection Values => ((IDictionary)Themes!).Values; - /// public int Count => ((ICollection>)Themes!).Count; - /// public bool IsReadOnly => ((ICollection>)Themes!).IsReadOnly; - /// public ThemeScope this [string key] { get => ((IDictionary)Themes!) [key]; set => ((IDictionary)Themes!) [key] = value; } - /// public void Add (string key, ThemeScope value) { ((IDictionary)Themes!).Add (key, value); } - /// public bool ContainsKey (string key) { return ((IDictionary)Themes!).ContainsKey (key); } - /// public bool Remove (string key) { return ((IDictionary)Themes!).Remove (key); } - /// public bool TryGetValue (string key, out ThemeScope value) { return ((IDictionary)Themes!).TryGetValue (key, out value!); } - /// public void Add (KeyValuePair item) { ((ICollection>)Themes!).Add (item); } - /// public void Clear () { ((ICollection>)Themes!).Clear (); } - /// public bool Contains (KeyValuePair item) { return ((ICollection>)Themes!).Contains (item); } - /// public void CopyTo (KeyValuePair [] array, int arrayIndex) { ((ICollection>)Themes!).CopyTo (array, arrayIndex); } - /// public bool Remove (KeyValuePair item) { return ((ICollection>)Themes!).Remove (item); } - /// public IEnumerator> GetEnumerator () { return ((IEnumerable>)Themes!).GetEnumerator (); @@ -268,6 +255,8 @@ namespace Terminal.Gui { { return ((IEnumerable)Themes!).GetEnumerator (); } +#pragma warning restore 1591 + #endregion } } diff --git a/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs b/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs index 2449a45c5..597e85c01 100644 --- a/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs +++ b/Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs @@ -1000,341 +1000,6 @@ namespace Terminal.Gui { /// public abstract void CookMouse (); - /// - /// Horizontal line character. - /// - public Rune HLine = '\u2500'; - - /// - /// Vertical line character. - /// - public Rune VLine = '\u2502'; - - /// - /// Stipple pattern - /// - public Rune Stipple = '\u2591'; - - /// - /// Diamond character - /// - public Rune Diamond = '\u25ca'; - - /// - /// Upper left corner - /// - public Rune ULCorner = '\u250C'; - - /// - /// Lower left corner - /// - public Rune LLCorner = '\u2514'; - - /// - /// Upper right corner - /// - public Rune URCorner = '\u2510'; - - /// - /// Lower right corner - /// - public Rune LRCorner = '\u2518'; - - /// - /// Left tee - /// - public Rune LeftTee = '\u251c'; - - /// - /// Right tee - /// - public Rune RightTee = '\u2524'; - - /// - /// Top tee - /// - public Rune TopTee = '\u252c'; - - /// - /// The bottom tee. - /// - public Rune BottomTee = '\u2534'; - - /// - /// Checkmark. - /// - public Rune Checked = '\u221a'; - - /// - /// Un-checked checkmark. - /// - public Rune UnChecked = '\u2574'; - - /// - /// Null-checked checkmark. - /// - public Rune NullChecked = '\u2370'; - - /// - /// Selected mark. - /// - public Rune Selected = '\u25cf'; - - /// - /// Un-selected selected mark. - /// - public Rune UnSelected = '\u25cc'; - - /// - /// Right Arrow. - /// - public Rune RightArrow = '\u25ba'; - - /// - /// Left Arrow. - /// - public Rune LeftArrow = '\u25c4'; - - /// - /// Down Arrow. - /// - public Rune DownArrow = '\u25bc'; - - /// - /// Up Arrow. - /// - public Rune UpArrow = '\u25b2'; - - /// - /// Left indicator for default action (e.g. for ). - /// - public Rune LeftDefaultIndicator = '\u25e6'; - - /// - /// Right indicator for default action (e.g. for ). - /// - public Rune RightDefaultIndicator = '\u25e6'; - - /// - /// Left frame/bracket (e.g. '[' for ). - /// - public Rune LeftBracket = '['; - - /// - /// Right frame/bracket (e.g. ']' for ). - /// - public Rune RightBracket = ']'; - - /// - /// Blocks Segment indicator for meter views (e.g. . - /// - public Rune BlocksMeterSegment = '\u258c'; - - /// - /// Continuous Segment indicator for meter views (e.g. . - /// - public Rune ContinuousMeterSegment = '\u2588'; - - /// - /// Horizontal double line character. - /// - public Rune HDbLine = '\u2550'; - - /// - /// Vertical double line character. - /// - public Rune VDbLine = '\u2551'; - - /// - /// Upper left double corner - /// - public Rune ULDbCorner = '\u2554'; - - /// - /// Lower left double corner - /// - public Rune LLDbCorner = '\u255a'; - - /// - /// Upper right double corner - /// - public Rune URDbCorner = '\u2557'; - - /// - /// Lower right double corner - /// - public Rune LRDbCorner = '\u255d'; - - /// - /// Upper left rounded corner - /// - public Rune ULRCorner = '\u256d'; - - /// - /// Lower left rounded corner - /// - public Rune LLRCorner = '\u2570'; - - /// - /// Upper right rounded corner - /// - public Rune URRCorner = '\u256e'; - - /// - /// Lower right rounded corner - /// - public Rune LRRCorner = '\u256f'; - - /// - /// Horizontal double dashed line character. - /// - public Rune HDsLine = '\u254c'; - - /// - /// Vertical triple dashed line character. - /// - public Rune VDsLine = '\u2506'; - - /// - /// Horizontal triple dashed line character. - /// - public Rune HDtLine = '\u2504'; - - /// - /// Horizontal quadruple dashed line character. - /// - public Rune HD4Line = '\u2508'; - - /// - /// Vertical double dashed line character. - /// - public Rune VD2Line = '\u254e'; - - /// - /// Vertical quadruple dashed line character. - /// - public Rune VDtLine = '\u250a'; - - /// - /// Horizontal heavy line character. - /// - public Rune HThLine = '\u2501'; - - /// - /// Vertical heavy line character. - /// - public Rune VThLine = '\u2503'; - - /// - /// Upper left heavy corner - /// - public Rune ULThCorner = '\u250f'; - - /// - /// Lower left heavy corner - /// - public Rune LLThCorner = '\u2517'; - - /// - /// Upper right heavy corner - /// - public Rune URThCorner = '\u2513'; - - /// - /// Lower right heavy corner - /// - public Rune LRThCorner = '\u251b'; - - /// - /// Horizontal heavy double dashed line character. - /// - public Rune HThDsLine = '\u254d'; - - /// - /// Vertical heavy triple dashed line character. - /// - public Rune VThDsLine = '\u2507'; - - /// - /// Horizontal heavy triple dashed line character. - /// - public Rune HThDtLine = '\u2505'; - - /// - /// Horizontal heavy quadruple dashed line character. - /// - public Rune HThD4Line = '\u2509'; - - /// - /// Vertical heavy double dashed line character. - /// - public Rune VThD2Line = '\u254f'; - - /// - /// Vertical heavy quadruple dashed line character. - /// - public Rune VThDtLine = '\u250b'; - - /// - /// The left half line. - /// - public Rune HalfLeftLine = '\u2574'; - - /// - /// The up half line. - /// - public Rune HalfTopLine = '\u2575'; - - /// - /// The right half line. - /// - public Rune HalfRightLine = '\u2576'; - - /// - /// The down half line. - /// - public Rune HalfBottomLine = '\u2577'; - - /// - /// The heavy left half line. - /// - public Rune ThHalfLeftLine = '\u2578'; - - /// - /// The heavy up half line. - /// - public Rune ThHalfTopLine = '\u2579'; - - /// - /// The heavy right half line. - /// - public Rune ThHalfRightLine = '\u257a'; - - /// - /// The heavy light down half line. - /// - public Rune ThHalfBottomLine = '\u257b'; - - /// - /// The light left and heavy right line. - /// - public Rune ThRightSideLine = '\u257c'; - - /// - /// The light up and heavy down line. - /// - public Rune ThBottomSideLine = '\u257d'; - - /// - /// The heavy left and light right line. - /// - public Rune ThLeftSideLine = '\u257e'; - - /// - /// The heavy up and light down line. - /// - public Rune ThTopSideLine = '\u257f'; - private Attribute currentAttribute; /// diff --git a/Terminal.Gui/Drawing/Glyphs.cs b/Terminal.Gui/Drawing/Glyphs.cs new file mode 100644 index 000000000..6d042d216 --- /dev/null +++ b/Terminal.Gui/Drawing/Glyphs.cs @@ -0,0 +1,647 @@ +using static Terminal.Gui.ConfigurationManager; +using System.Text.Json.Serialization; +using Rune = System.Rune; + +namespace Terminal.Gui { + /// + /// Defines the standard set of glyphs used to draw checkboxes, lines, borders, etc... + /// + /// + /// + /// The default glyphs can be changed via the . Within a config.json file + /// The JSon property name is the property prefixed with "CM.Glyphs.". + /// + /// + /// The JSon property can be either a decimal number or a string. The string may be one of: + /// - A unicode char (e.g. "☑") + /// - A hex value in U+ format (e.g. "U+2611") + /// - A hex value in UTF-16 format (e.g. "\\u2611") + /// + /// + public class GlyphDefinitions { + #region ----------------- Single Glyphs ----------------- + + /// + /// Checked indicator (e.g. for and ). + /// + public Rune Checked { get; set; } = '☑'; + + /// + /// Not Checked indicator (e.g. for and ). + /// + public Rune UnChecked { get; set; } = '☐'; + + /// + /// Null Checked indicator (e.g. for and ). + /// + public Rune NullChecked { get; set; } = '☒'; + + /// + /// Selected indicator (e.g. for and ). + /// + public Rune Selected { get; set; } = '◉'; + + /// + /// Not Selected indicator (e.g. for and ). + /// + public Rune UnSelected { get; set; } = '○'; + + /// + /// Horizontal arrow. + /// + public Rune RightArrow { get; set; } = '►'; + + /// + /// Left arrow. + /// + public Rune LeftArrow { get; set; } = '◄'; + + /// + /// Down arrow. + /// + public Rune DownArrow { get; set; } = '▼'; + + /// + /// Vertical arrow. + /// + public Rune UpArrow { get; set; } = '▲'; + + /// + /// Left default indicator (e.g. for . + /// + public Rune LeftDefaultIndicator { get; set; } = '►'; + + /// + /// Horizontal default indicator (e.g. for . + /// + public Rune RightDefaultIndicator { get; set; } = '◄'; + + /// + /// Left Bracket (e.g. for . Default is (U+005B) - [. + /// + public Rune LeftBracket { get; set; } = '⟦'; + + /// + /// Horizontal Bracket (e.g. for . Default is (U+005D) - ]. + /// + public Rune RightBracket { get; set; } = '⟧'; + + /// + /// Half block meter segment (e.g. for ). + /// + public Rune BlocksMeterSegment { get; set; } = '▌'; + + /// + /// Continuous block meter segment (e.g. for ). + /// + public Rune ContinuousMeterSegment { get; set; } = '█'; + + /// + /// Stipple pattern (e.g. for ). Default is Light Shade (U+2591) - ░. + /// + public Rune Stipple { get; set; } = '░'; + + /// + /// Diamond (e.g. for . Default is Lozenge (U+25CA) - ◊. + /// + public Rune Diamond { get; set; } = '◊'; + + /// + /// Close. Default is Heavy Ballot X (U+2718) - ✘. + /// + public Rune Close { get; set; } = '✘'; + + /// + /// Minimize. Default is Lower Horizontal Shadowed White Circle (U+274F) - ❏. + /// + public Rune Minimize { get; set; } = '❏'; + + /// + /// Maximize. Default is Upper Horizontal Shadowed White Circle (U+273D) - ✽. + /// + public Rune Maximize { get; set; } = '✽'; + + /// + /// Dot. Default is (U+2219) - ∙. + /// + public Rune Dot { get; set; } = '∙'; + + /// + /// Expand (e.g. for . + /// + public Rune Expand { get; set; } = '+'; + + /// + /// Expand (e.g. for . + /// + public Rune Collapse { get; set; } = '-'; + + /// + /// Apple. Because snek. + /// + public Rune Apple { get; set; } = '❦' ; // BUGBUG: "🍎"[0] should work, but doesn't + + #endregion + + #region ----------------- Lines ----------------- + /// + /// Box Drawings Horizontal Line - Light (U+2500) - ─ + /// + public Rune HLine { get; set; } = '─'; + + /// + /// Box Drawings Vertical Line - Light (U+2502) - │ + /// + public Rune VLine { get; set; } = '│'; + + /// + /// Box Drawings Double Horizontal (U+2550) - ═ + /// + public Rune HLineDbl { get; set; } = '═'; + + /// + /// Box Drawings Double Vertical (U+2551) - ║ + /// + public Rune VLineDbl { get; set; } = '║'; + + /// + /// Box Drawings Heavy Double Dash Horizontal (U+254D) - ╍ + /// + public Rune HLineHvDa2 { get; set; } = '╍'; + + /// + /// Box Drawings Heavy Triple Dash Vertical (U+2507) - ┇ + /// + public Rune VLineHvDa3 { get; set; } = '┇'; + + /// + /// Box Drawings Heavy Triple Dash Horizontal (U+2505) - ┅ + /// + public Rune HLineHvDa3 { get; set; } = '┅'; + + /// + /// Box Drawings Heavy Quadruple Dash Horizontal (U+2509) - ┉ + /// + public Rune HLineHvDa4 { get; set; } = '┉'; + + /// + /// Box Drawings Heavy Double Dash Vertical (U+254F) - ╏ + /// + public Rune VLineHvDa2 { get; set; } = '╏'; + + /// + /// Box Drawings Heavy Quadruple Dash Vertical (U+250B) - ┋ + /// + public Rune VLineHvDa4 { get; set; } = '┋'; + + /// + /// Box Drawings Light Double Dash Horizontal (U+254C) - ╌ + /// + public Rune HLineDa2 { get; set; } = '╌'; + + /// + /// Box Drawings Light Triple Dash Vertical (U+2506) - ┆ + /// + public Rune VLineDa3 { get; set; } = '┆'; + + /// + /// Box Drawings Light Triple Dash Horizontal (U+2504) - ┄ + /// + public Rune HLineDa3 { get; set; } = '┄'; + + /// + /// Box Drawings Light Quadruple Dash Horizontal (U+2508) - ┈ + /// + public Rune HLineDa4 { get; set; } = '┈'; + + /// + /// Box Drawings Light Double Dash Vertical (U+254E) - ╎ + /// + public Rune VLineDa2 { get; set; } = '╎'; + + /// + /// Box Drawings Light Quadruple Dash Vertical (U+250A) - ┊ + /// + public Rune VLineDa4 { get; set; } = '┊'; + + /// + /// Box Drawings Heavy Horizontal (U+2501) - ━ + /// + public Rune HLineHv { get; set; } = '━'; + + /// + /// Box Drawings Heavy Vertical (U+2503) - ┃ + /// + public Rune VLineHv { get; set; } = '┃'; + + /// + /// Box Drawings Light Left (U+2574) - ╴ + /// + public Rune HalfLeftLine { get; set; } = '╴'; + + /// + /// Box Drawings Light Vertical (U+2575) - ╵ + /// + public Rune HalfTopLine { get; set; } = '╵'; + + /// + /// Box Drawings Light Horizontal (U+2576) - ╶ + /// + public Rune HalfRightLine { get; set; } = '╶'; + + /// + /// Box Drawings Light Down (U+2577) - ╷ + /// + public Rune HalfBottomLine { get; set; } = '╷'; + + /// + /// Box Drawings Heavy Left (U+2578) - ╸ + /// + public Rune HalfLeftLineHv { get; set; } = '╸'; + + /// + /// Box Drawings Heavy Vertical (U+2579) - ╹ + /// + public Rune HalfTopLineHv { get; set; } = '╹'; + + /// + /// Box Drawings Heavy Horizontal (U+257A) - ╺ + /// + public Rune HalfRightLineHv { get; set; } = '╺'; + + /// + /// Box Drawings Light Vertical and Horizontal (U+257B) - ╻ + /// + public Rune HalfBottomLineLt { get; set; } = '╻'; + + /// + /// Box Drawings Light Horizontal and Heavy Horizontal (U+257C) - ╼ + /// + public Rune RightSideLineLtHv { get; set; } = '╼'; + + /// + /// Box Drawings Light Vertical and Heavy Horizontal (U+257D) - ╽ + /// + public Rune BottomSideLineLtHv { get; set; } = '╽'; + + /// + /// Box Drawings Heavy Left and Light Horizontal (U+257E) - ╾ + /// + public Rune LeftSideLineHvLt { get; set; } = '╾'; + + /// + /// Box Drawings Heavy Vertical and Light Horizontal (U+257F) - ╿ + /// + public Rune TopSideLineHvLt { get; set; } = '╿'; + #endregion + + #region ----------------- Upper Left Corners ----------------- + /// + /// Box Drawings Upper Left Corner - Light Vertical and Light Horizontal (U+250C) - ┌ + /// + public Rune ULCorner { get; set; } = '┌'; + + /// + /// Box Drawings Upper Left Corner - Double (U+2554) - ╔ + /// + public Rune ULCornerDbl { get; set; } = '╔'; + + /// + /// Box Drawings Upper Left Corner - Light Arc Down and Horizontal (U+256D) - ╭ + /// + public Rune ULCornerR { get; set; } = '╭'; + + /// + /// Box Drawings Heavy Down and Horizontal (U+250F) - ┏ + /// + public Rune ULCornerHv { get; set; } = '┏'; + + /// + /// Box Drawings Down Heavy and Horizontal Light (U+251E) - ┎ + /// + public Rune ULCornerHvLt { get; set; } = '┎'; + + /// + /// Box Drawings Down Light and Horizontal Heavy (U+250D) - ┎ + /// + public Rune ULCornerLtHv { get; set; } = '┍'; + + /// + /// Box Drawings Double Down and Single Horizontal (U+2553) - ╓ + /// + public Rune ULCornerDblSingle { get; set; } = '╓'; + + /// + /// Box Drawings Single Down and Double Horizontal (U+2552) - ╒ + /// + public Rune ULCornerSingleDbl { get; set; } = '╒'; + #endregion + + #region ----------------- Lower Left Corners ----------------- + /// + /// Box Drawings Lower Left Corner - Light Vertical and Light Horizontal (U+2514) - └ + /// + public Rune LLCorner { get; set; } = '└'; + + /// + /// Box Drawings Heavy Vertical and Horizontal (U+2517) - ┗ + /// + public Rune LLCornerHv { get; set; } = '┗'; + + /// + /// Box Drawings Heavy Vertical and Horizontal Light (U+2516) - ┖ + /// + public Rune LLCornerHvLt { get; set; } = '┖'; + + /// + /// Box Drawings Vertical Light and Horizontal Heavy (U+2511) - ┕ + /// + public Rune LLCornerLtHv { get; set; } = '┕'; + + /// + /// Box Drawings Double Vertical and Double Left (U+255A) - ╚ + /// + public Rune LLCornerDbl { get; set; } = '╚'; + + /// + /// Box Drawings Single Vertical and Double Left (U+2558) - ╘ + /// + public Rune LLCornerSingleDbl { get; set; } = '╘'; + + /// + /// Box Drawings Double Down and Single Left (U+2559) - ╙ + /// + public Rune LLCornerDblSingle { get; set; } = '╙'; + + /// + /// Box Drawings Upper Left Corner - Light Arc Down and Left (U+2570) - ╰ + /// + public Rune LLCornerR { get; set; } = '╰'; + + #endregion + + #region ----------------- Upper Right Corners ----------------- + /// + /// Box Drawings Upper Horizontal Corner - Light Vertical and Light Horizontal (U+2510) - ┐ + /// + public Rune URCorner { get; set; } = '┐'; + + /// + /// Box Drawings Upper Horizontal Corner - Double Vertical and Double Horizontal (U+2557) - ╗ + /// + public Rune URCornerDbl { get; set; } = '╗'; + + /// + /// Box Drawings Upper Horizontal Corner - Light Arc Vertical and Horizontal (U+256E) - ╮ + /// + public Rune URCornerR { get; set; } = '╮'; + + /// + /// Box Drawings Heavy Down and Left (U+2513) - ┓ + /// + public Rune URCornerHv { get; set; } = '┓'; + + /// + /// Box Drawings Heavy Vertical and Left Down Light (U+2511) - ┑ + /// + public Rune URCornerHvLt { get; set; } = '┑'; + + /// + /// Box Drawings Down Light and Horizontal Heavy (U+2514) - ┒ + /// + public Rune URCornerLtHv { get; set; } = '┒'; + + /// + /// Box Drawings Double Vertical and Single Left (U+2556) - ╖ + /// + public Rune URCornerDblSingle { get; set; } = '╖'; + + /// + /// Box Drawings Single Vertical and Double Left (U+2555) - ╕ + /// + public Rune URCornerSingleDbl { get; set; } = '╕'; + #endregion + + #region ----------------- Lower Right Corners ----------------- + /// + /// Box Drawings Lower Right Corner - Light (U+2518) - ┘ + /// + public Rune LRCorner { get; set; } = '┘'; + + /// + /// Box Drawings Lower Right Corner - Double (U+255D) - ╝ + /// + public Rune LRCornerDbl { get; set; } = '╝'; + + /// + /// Box Drawings Lower Right Corner - Rounded (U+256F) - ╯ + /// + public Rune LRCornerR { get; set; } = '╯'; + + /// + /// Box Drawings Lower Right Corner - Heavy (U+251B) - ┛ + /// + public Rune LRCornerHv { get; set; } = '┛'; + + /// + /// Box Drawings Lower Right Corner - Double Vertical and Single Horizontal (U+255C) - ╜ + /// + public Rune LRCornerDblSingle { get; set; } = '╜'; + + /// + /// Box Drawings Lower Right Corner - Single Vertical and Double Horizontal (U+255B) - ╛ + /// + public Rune LRCornerSingleDbl { get; set; } = '╛'; + + /// + /// Box Drawings Lower Right Corner - Light Vertical and Heavy Horizontal (U+2519) - ┙ + /// + public Rune LRCornerLtHv { get; set; } = '┙'; + + /// + /// Box Drawings Lower Right Corner - Heavy Vertical and Light Horizontal (U+251A) - ┚ + /// + public Rune LRCornerHvLt { get; set; } = '┚'; + #endregion + + #region ----------------- Tees ----------------- + /// + /// Box Drawings Left Tee - Single Vertical and Single Horizontal (U+251C) - ├ + /// + public Rune LeftTee { get; set; } = '├'; + + /// + /// Box Drawings Left Tee - Single Vertical and Double Horizontal (U+255E) - ╞ + /// + public Rune LeftTeeDblH { get; set; } = '╞'; + + /// + /// Box Drawings Left Tee - Double Vertical and Single Horizontal (U+255F) - ╟ + /// + public Rune LeftTeeDblV { get; set; } = '╟'; + + /// + /// Box Drawings Left Tee - Double Vertical and Double Horizontal (U+2560) - ╠ + /// + public Rune LeftTeeDbl { get; set; } = '╠'; + + /// + /// Box Drawings Left Tee - Heavy Horizontal and Light Vertical (U+2523) - ┝ + /// + public Rune LeftTeeHvH { get; set; } = '┝'; + + /// + /// Box Drawings Left Tee - Light Horizontal and Heavy Vertical (U+252B) - ┠ + /// + public Rune LeftTeeHvV { get; set; } = '┠'; + + /// + /// Box Drawings Left Tee - Heavy Vertical and Heavy Horizontal (U+2527) - ┣ + /// + public Rune LeftTeeHvDblH { get; set; } = '┣'; + + /// + /// Box Drawings Righ Tee - Single Vertical and Single Horizontal (U+2524) - ┤ + /// + public Rune RightTee { get; set; } = '┤'; + + /// + /// Box Drawings Right Tee - Single Vertical and Double Horizontal (U+2561) - ╡ + /// + public Rune RightTeeDblH { get; set; } = '╡'; + + /// + /// Box Drawings Right Tee - Double Vertical and Single Horizontal (U+2562) - ╢ + /// + public Rune RightTeeDblV { get; set; } = '╢'; + + /// + /// Box Drawings Right Tee - Double Vertical and Double Horizontal (U+2563) - ╣ + /// + public Rune RightTeeDbl { get; set; } = '╣'; + + /// + /// Box Drawings Right Tee - Heavy Horizontal and Light Vertical (U+2528) - ┥ + /// + public Rune RightTeeHvH { get; set; } = '┥'; + + /// + /// Box Drawings Right Tee - Light Horizontal and Heavy Vertical (U+2530) - ┨ + /// + public Rune RightTeeHvV { get; set; } = '┨'; + + /// + /// Box Drawings Right Tee - Heavy Vertical and Heavy Horizontal (U+252C) - ┫ + /// + public Rune RightTeeHvDblH { get; set; } = '┫'; + + /// + /// Box Drawings Top Tee - Single Vertical and Single Horizontal (U+252C) - ┬ + /// + public Rune TopTee { get; set; } = '┬'; + + /// + /// Box Drawings Top Tee - Single Vertical and Double Horizontal (U+2564) - ╤ + /// + public Rune TopTeeDblH { get; set; } = '╤'; + + /// + /// Box Drawings Top Tee - Double Vertical and Single Horizontal (U+2565) - ╥ + /// + public Rune TopTeeDblV { get; set; } = '╥'; + + /// + /// Box Drawings Top Tee - Double Vertical and Double Horizontal (U+2566) - ╦ + /// + public Rune TopTeeDbl { get; set; } = '╦'; + + /// + /// Box Drawings Top Tee - Heavy Horizontal and Light Vertical (U+252F) - ┯ + /// + public Rune TopTeeHvH { get; set; } = '┯'; + + /// + /// Box Drawings Top Tee - Light Horizontal and Heavy Vertical (U+2537) - ┰ + /// + public Rune TopTeeHvV { get; set; } = '┰'; + + /// + /// Box Drawings Top Tee - Heavy Vertical and Heavy Horizontal (U+2533) - ┳ + /// + public Rune TopTeeHvDblH { get; set; } = '┳'; + + /// + /// Box Drawings Bottom Tee - Single Vertical and Single Horizontal (U+2534) - ┴ + /// + public Rune BottomTee { get; set; } = '┴'; + + /// + /// Box Drawings Bottom Tee - Single Vertical and Double Horizontal (U+2567) - ╧ + /// + public Rune BottomTeeDblH { get; set; } = '╧'; + + /// + /// Box Drawings Bottom Tee - Double Vertical and Single Horizontal (U+2568) - ╨ + /// + public Rune BottomTeeDblV { get; set; } = '╨'; + + /// + /// Box Drawings Bottom Tee - Double Vertical and Double Horizontal (U+2569) - ╩ + /// + public Rune BottomTeeDbl { get; set; } = '╩'; + + /// + /// Box Drawings Bottom Tee - Heavy Horizontal and Light Vertical (U+2535) - ┷ + /// + public Rune BottomTeeHvH { get; set; } = '┷'; + + /// + /// Box Drawings Bottom Tee - Light Horizontal and Heavy Vertical (U+253D) - ┸ + /// + public Rune BottomTeeHvV { get; set; } = '┸'; + + /// + /// Box Drawings Bottom Tee - Heavy Vertical and Heavy Horizontal (U+2539) - ┻ + /// + public Rune BottomTeeHvDblH { get; set; } = '┻'; + + #endregion + + #region ----------------- Crosses ----------------- + /// + /// Box Drawings Cross - Single Vertical and Single Horizontal (U+253C) - ┼ + /// + public Rune Cross { get; set; } = '┼'; + + /// + /// Box Drawings Cross - Single Vertical and Double Horizontal (U+256A) - ╪ + /// + public Rune CrossDblH { get; set; } = '╪'; + + /// + /// Box Drawings Cross - Double Vertical and Single Horizontal (U+256B) - ╫ + /// + public Rune CrossDblV { get; set; } = '╫'; + + /// + /// Box Drawings Cross - Double Vertical and Double Horizontal (U+256C) - ╬ + /// + public Rune CrossDbl { get; set; } = '╬'; + + /// + /// Box Drawings Cross - Heavy Horizontal and Light Vertical (U+253F) - ┿ + /// + public Rune CrossHvH { get; set; } = '┿'; + + /// + /// Box Drawings Cross - Light Horizontal and Heavy Vertical (U+2541) - ╂ + /// + public Rune CrossHvV { get; set; } = '╂'; + + /// + /// Box Drawings Cross - Heavy Vertical and Heavy Horizontal (U+254B) - ╋ + /// + public Rune CrossHv { get; set; } = '╋'; + #endregion + } +} diff --git a/Terminal.Gui/Drawing/LineCanvas.cs b/Terminal.Gui/Drawing/LineCanvas.cs index 81c20650c..6aff2a319 100644 --- a/Terminal.Gui/Drawing/LineCanvas.cs +++ b/Terminal.Gui/Drawing/LineCanvas.cs @@ -16,7 +16,7 @@ namespace Terminal.Gui { /// None, /// - /// The border is drawn using thin line glyphs. + /// The border is drawn using thin line CM.Glyphs. /// Single, /// @@ -28,11 +28,11 @@ namespace Terminal.Gui { /// Dotted, /// - /// The border is drawn using thin double line glyphs. + /// The border is drawn using thin double line CM.Glyphs. /// Double, /// - /// The border is drawn using heavy line glyphs. + /// The border is drawn using heavy line CM.Glyphs. /// Heavy, /// @@ -67,6 +67,21 @@ namespace Terminal.Gui { /// and rendering. Does not support diagonal lines. /// public class LineCanvas { + /// + /// Creates a new instance. + /// + public LineCanvas() + { + ConfigurationManager.Applied += ConfigurationManager_Applied; + } + + private void ConfigurationManager_Applied (object sender, ConfigurationManagerEventArgs e) + { + foreach (var irr in runeResolvers) { + irr.Value.SetGlyphs (); + } + } + private List _lines = new List (); Dictionary runeResolvers = new Dictionary { @@ -80,7 +95,7 @@ namespace Terminal.Gui { {IntersectionRuneType.RightTee,new RightTeeIntersectionRuneResolver()}, {IntersectionRuneType.BottomTee,new BottomTeeIntersectionRuneResolver()}, - {IntersectionRuneType.Crosshair,new CrosshairIntersectionRuneResolver()}, + {IntersectionRuneType.Cross,new CrossIntersectionRuneResolver()}, // TODO: Add other resolvers }; @@ -272,26 +287,25 @@ namespace Terminal.Gui { } private abstract class IntersectionRuneResolver { - readonly Rune round; - readonly Rune doubleH; - readonly Rune doubleV; - readonly Rune doubleBoth; - readonly Rune thickH; - readonly Rune thickV; - readonly Rune thickBoth; - readonly Rune normal; + internal Rune _round; + internal Rune _doubleH; + internal Rune _doubleV; + internal Rune _doubleBoth; + internal Rune _thickH; + internal Rune _thickV; + internal Rune _thickBoth; + internal Rune _normal; - public IntersectionRuneResolver (Rune round, Rune doubleH, Rune doubleV, Rune doubleBoth, Rune thickH, Rune thickV, Rune thickBoth, Rune normal) + public IntersectionRuneResolver() { - this.round = round; - this.doubleH = doubleH; - this.doubleV = doubleV; - this.doubleBoth = doubleBoth; - this.thickH = thickH; - this.thickV = thickV; - this.thickBoth = thickBoth; - this.normal = normal; + SetGlyphs (); } + + /// + /// Sets the glyphs used. Call this method after construction and any time + /// ConfigurationManager has updated the settings. + /// + public abstract void SetGlyphs (); public Rune? GetRuneForIntersects (ConsoleDriver driver, IntersectionDefinition [] intersects) { @@ -309,87 +323,140 @@ namespace Terminal.Gui { l.Line.Style == LineStyle.Heavy || l.Line.Style == LineStyle.HeavyDashed || l.Line.Style == LineStyle.HeavyDotted)); if (doubleHorizontal) { - return doubleVertical ? doubleBoth : doubleH; + return doubleVertical ? _doubleBoth : _doubleH; } if (doubleVertical) { - return doubleV; + return _doubleV; } if (thickHorizontal) { - return thickVertical ? thickBoth : thickH; + return thickVertical ? _thickBoth : _thickH; } if (thickVertical) { - return thickV; + return _thickV; } - return useRounded ? round : normal; + return useRounded ? _round : _normal; } } private class ULIntersectionRuneResolver : IntersectionRuneResolver { - public ULIntersectionRuneResolver () : - base ('╭', '╒', '╓', '╔', '┍', '┎', '┏', '┌') + public override void SetGlyphs () { - + _round = CM.Glyphs.ULCornerR; + _doubleH = CM.Glyphs.ULCornerSingleDbl; + _doubleV = CM.Glyphs.ULCornerDblSingle; + _doubleBoth = CM.Glyphs.ULCornerDbl; + _thickH = CM.Glyphs.ULCornerLtHv; + _thickV = CM.Glyphs.ULCornerHvLt; + _thickBoth = CM.Glyphs.ULCornerHv; + _normal = CM.Glyphs.ULCorner; } } private class URIntersectionRuneResolver : IntersectionRuneResolver { - - public URIntersectionRuneResolver () : - base ('╮', '╕', '╖', '╗', '┑', '┒', '┓', '┐') + public override void SetGlyphs () { - + _round = CM.Glyphs.URCornerR; + _doubleH = CM.Glyphs.URCornerSingleDbl; + _doubleV = CM.Glyphs.URCornerDblSingle; + _doubleBoth = CM.Glyphs.URCornerDbl; + _thickH = CM.Glyphs.URCornerHvLt; + _thickV = CM.Glyphs.URCornerLtHv; + _thickBoth = CM.Glyphs.URCornerHv; + _normal = CM.Glyphs.URCorner; } } private class LLIntersectionRuneResolver : IntersectionRuneResolver { - - public LLIntersectionRuneResolver () : - base ('╰', '╘', '╙', '╚', '┕', '┖', '┗', '└') + public override void SetGlyphs () { - + _round = CM.Glyphs.LLCornerR; + _doubleH = CM.Glyphs.LLCornerSingleDbl; + _doubleV = CM.Glyphs.LLCornerDblSingle; + _doubleBoth = CM.Glyphs.LLCornerDbl; + _thickH = CM.Glyphs.LLCornerLtHv; + _thickV = CM.Glyphs.LLCornerHvLt; + _thickBoth = CM.Glyphs.LLCornerHv; + _normal = CM.Glyphs.LLCorner; } + } private class LRIntersectionRuneResolver : IntersectionRuneResolver { - public LRIntersectionRuneResolver () : - base ('╯', '╛', '╜', '╝', '┙', '┚', '┛', '┘') + public override void SetGlyphs () { - + _round = CM.Glyphs.LRCornerR; + _doubleH = CM.Glyphs.LRCornerSingleDbl; + _doubleV = CM.Glyphs.LRCornerDblSingle; + _doubleBoth = CM.Glyphs.LRCornerDbl; + _thickH = CM.Glyphs.LRCornerLtHv; + _thickV = CM.Glyphs.LRCornerHvLt; + _thickBoth = CM.Glyphs.LRCornerHv; + _normal = CM.Glyphs.LRCorner; } } private class TopTeeIntersectionRuneResolver : IntersectionRuneResolver { - public TopTeeIntersectionRuneResolver () : - base ('┬', '╤', '╥', '╦', '┯', '┰', '┳', '┬') + public override void SetGlyphs () { - + _round = CM.Glyphs.TopTee; + _doubleH = CM.Glyphs.TopTeeDblH; + _doubleV = CM.Glyphs.TopTeeDblV; + _doubleBoth = CM.Glyphs.TopTeeDbl; + _thickH = CM.Glyphs.TopTeeHvH; + _thickV = CM.Glyphs.TopTeeHvV; + _thickBoth = CM.Glyphs.TopTeeHvDblH; + _normal = CM.Glyphs.TopTee; } } private class LeftTeeIntersectionRuneResolver : IntersectionRuneResolver { - public LeftTeeIntersectionRuneResolver () : - base ('├', '╞', '╟', '╠', '┝', '┠', '┣', '├') + public override void SetGlyphs () { - + _round = CM.Glyphs.LeftTee; + _doubleH = CM.Glyphs.LeftTeeDblH; + _doubleV = CM.Glyphs.LeftTeeDblV; + _doubleBoth = CM.Glyphs.LeftTeeDbl; + _thickH = CM.Glyphs.LeftTeeHvH; + _thickV = CM.Glyphs.LeftTeeHvV; + _thickBoth = CM.Glyphs.LeftTeeHvDblH; + _normal = CM.Glyphs.LeftTee; } } private class RightTeeIntersectionRuneResolver : IntersectionRuneResolver { - public RightTeeIntersectionRuneResolver () : - base ('┤', '╡', '╢', '╣', '┥', '┨', '┫', '┤') + public override void SetGlyphs () { - + _round = CM.Glyphs.RightTee; + _doubleH = CM.Glyphs.RightTeeDblH; + _doubleV = CM.Glyphs.RightTeeDblV; + _doubleBoth = CM.Glyphs.RightTeeDbl; + _thickH = CM.Glyphs.RightTeeHvH; + _thickV = CM.Glyphs.RightTeeHvV; + _thickBoth = CM.Glyphs.RightTeeHvDblH; + _normal = CM.Glyphs.RightTee; } } private class BottomTeeIntersectionRuneResolver : IntersectionRuneResolver { - public BottomTeeIntersectionRuneResolver () : - base ('┴', '╧', '╨', '╩', '┷', '┸', '┻', '┴') + public override void SetGlyphs () { - + _round = CM.Glyphs.BottomTee; + _doubleH = CM.Glyphs.BottomTeeDblH; + _doubleV = CM.Glyphs.BottomTeeDblV; + _doubleBoth = CM.Glyphs.BottomTeeDbl; + _thickH = CM.Glyphs.BottomTeeHvH; + _thickV = CM.Glyphs.BottomTeeHvV; + _thickBoth = CM.Glyphs.BottomTeeHvDblH; + _normal = CM.Glyphs.BottomTee; } } - private class CrosshairIntersectionRuneResolver : IntersectionRuneResolver { - public CrosshairIntersectionRuneResolver () : - base ('┼', '╪', '╫', '╬', '┿', '╂', '╋', '┼') + private class CrossIntersectionRuneResolver : IntersectionRuneResolver { + public override void SetGlyphs () { - + _round = CM.Glyphs.Cross; + _doubleH = CM.Glyphs.CrossDblH; + _doubleV = CM.Glyphs.CrossDblV; + _doubleBoth = CM.Glyphs.CrossDbl; + _thickH = CM.Glyphs.CrossHvH; + _thickV = CM.Glyphs.CrossHvV; + _thickBoth = CM.Glyphs.CrossHv; + _normal = CM.Glyphs.Cross; } } @@ -421,29 +488,29 @@ namespace Terminal.Gui { case IntersectionRuneType.None: return null; case IntersectionRuneType.Dot: - return (Rune)'.'; + return (Rune)CM.Glyphs.Dot; case IntersectionRuneType.HLine: if (useDouble) { - return driver.HDbLine; + return CM.Glyphs.HLineDbl; } if (useDashed) { - return driver.HDsLine; + return CM.Glyphs.HLineDa2; } if (useDotted) { - return driver.HDtLine; + return CM.Glyphs.HLineDa3; } - return useThick ? driver.HThLine : (useThickDashed ? driver.HThDsLine : (useThickDotted ? driver.HThDtLine : driver.HLine)); + return useThick ? CM.Glyphs.HLineHv : (useThickDashed ? CM.Glyphs.HLineHvDa2 : (useThickDotted ? CM.Glyphs.HLineHvDa3 : CM.Glyphs.HLine)); case IntersectionRuneType.VLine: if (useDouble) { - return driver.VDbLine; + return CM.Glyphs.VLineDbl; } if (useDashed) { - return driver.VDsLine; + return CM.Glyphs.VLineDa3; } if (useDotted) { - return driver.VDtLine; + return CM.Glyphs.VLineDa3; } - return useThick ? driver.VThLine : (useThickDashed ? driver.VThDsLine : (useThickDotted ? driver.VThDtLine : driver.VLine)); + return useThick ? CM.Glyphs.VLineHv : (useThickDashed ? CM.Glyphs.VLineHvDa3 : (useThickDotted ? CM.Glyphs.VLineHvDa4 : CM.Glyphs.VLine)); default: throw new Exception ("Could not find resolver or switch case for " + nameof (runeType) + ":" + runeType); } @@ -464,8 +531,7 @@ namespace Terminal.Gui { /// /// Represents a single row/column within the . Includes the glyph and the foreground/background colors. /// - public class Cell - { + public class Cell { /// /// The glyph to draw. /// @@ -494,12 +560,12 @@ namespace Terminal.Gui { { var set = new HashSet (intersects.Select (i => i.Type)); - #region Crosshair Conditions + #region Cross Conditions if (Has (set, IntersectionType.PassOverHorizontal, IntersectionType.PassOverVertical )) { - return IntersectionRuneType.Crosshair; + return IntersectionRuneType.Cross; } if (Has (set, @@ -507,7 +573,7 @@ namespace Terminal.Gui { IntersectionType.StartLeft, IntersectionType.StartRight )) { - return IntersectionRuneType.Crosshair; + return IntersectionRuneType.Cross; } if (Has (set, @@ -515,7 +581,7 @@ namespace Terminal.Gui { IntersectionType.StartUp, IntersectionType.StartDown )) { - return IntersectionRuneType.Crosshair; + return IntersectionRuneType.Cross; } if (Has (set, @@ -523,7 +589,7 @@ namespace Terminal.Gui { IntersectionType.StartRight, IntersectionType.StartUp, IntersectionType.StartDown)) { - return IntersectionRuneType.Crosshair; + return IntersectionRuneType.Cross; } #endregion @@ -694,7 +760,7 @@ namespace Terminal.Gui { BottomTee, RightTee, LeftTee, - Crosshair, + Cross, HLine, VLine, } diff --git a/Terminal.Gui/Drawing/Thickness.cs b/Terminal.Gui/Drawing/Thickness.cs index fdb16200d..176db55c8 100644 --- a/Terminal.Gui/Drawing/Thickness.cs +++ b/Terminal.Gui/Drawing/Thickness.cs @@ -82,7 +82,7 @@ namespace Terminal.Gui { } /// - /// Gets the total width of the left and right sides of the rectangle. Sets the height of the left and right sides of the rectangle to half the specified value. + /// Gets the total height of the top and bottom sides of the rectangle. Sets the height of the top and bottom sides of the rectangle to half the specified value. /// public int Vertical { get { @@ -94,7 +94,7 @@ namespace Terminal.Gui { } /// - /// Gets the total width of the top and bottom sides of the rectangle. Sets the width of the top and bottom sides of the rectangle to half the specified value. + /// Gets the total width of the left and right sides of the rectangle. Sets the width of the left and rigth sides of the rectangle to half the specified value. /// public int Horizontal { get { @@ -224,7 +224,9 @@ namespace Terminal.Gui { /// public static Thickness Empty => new Thickness (0); - /// + /// Determines whether the specified object is equal to the current object. + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. public override bool Equals (object obj) { //Check for null and compare run-time types. @@ -243,7 +245,11 @@ namespace Terminal.Gui { } // IEquitable - /// + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// + /// true if the current object is equal to the other parameter; otherwise, false. public bool Equals (Thickness other) { return other is not null && diff --git a/Terminal.Gui/FileServices/AllowedType.cs b/Terminal.Gui/FileServices/AllowedType.cs index bcf44490c..36b1823a0 100644 --- a/Terminal.Gui/FileServices/AllowedType.cs +++ b/Terminal.Gui/FileServices/AllowedType.cs @@ -33,7 +33,10 @@ namespace Terminal.Gui { return true; } - /// + /// + /// Returns a string representation of this . + /// + /// public override string ToString () { return Strings.fdAnyFiles + "(*.*)"; diff --git a/Terminal.Gui/FileServices/FileDialogRootTreeNode.cs b/Terminal.Gui/FileServices/FileDialogRootTreeNode.cs index 0355ae4ed..e8bf1b32a 100644 --- a/Terminal.Gui/FileServices/FileDialogRootTreeNode.cs +++ b/Terminal.Gui/FileServices/FileDialogRootTreeNode.cs @@ -39,7 +39,10 @@ namespace Terminal.Gui { /// public DirectoryInfo Path { get; } - /// + /// + /// Returns a string representation of this instance (). + /// + /// public override string ToString () { return this.DisplayName; diff --git a/Terminal.Gui/Input/KeystrokeNavigatorEventArgs.cs b/Terminal.Gui/Input/KeystrokeNavigatorEventArgs.cs index 454f5a1e2..01ecd4b47 100644 --- a/Terminal.Gui/Input/KeystrokeNavigatorEventArgs.cs +++ b/Terminal.Gui/Input/KeystrokeNavigatorEventArgs.cs @@ -2,7 +2,7 @@ namespace Terminal.Gui { /// - /// Event arguments for the event. + /// Event arguments for the event. /// public class KeystrokeNavigatorEventArgs : EventArgs { /// diff --git a/Terminal.Gui/Resources/config.json b/Terminal.Gui/Resources/config.json index 63238ae1c..af1932937 100644 --- a/Terminal.Gui/Resources/config.json +++ b/Terminal.Gui/Resources/config.json @@ -1,14 +1,14 @@ { - // This document specifies the "source of truth" for default values for all Terminal.GUi settings managed by + // Specifies the "source of truth" for default values for all Terminal.Gui settings managed by // ConfigurationManager. It is automatically loaded, and applied, each time Application.Init // is run (via the ConfiguraitonManager.Reset method). // // In otherwords, initial values set in the the codebase are always overwritten by the contents of this - // file. + // resource embedded in the Terminal.Gui.dll assembly. // - // The Unit Test method "TestConfigurationManagerSaveDefaults" can be used to re-create the base of this file, but + // The Unit Test method "ConfigurationManagerTests.SaveDefaults" can be used to re-create the base of this file, but // note that not all values here will be recreated (e.g. the Light and Dark themes and any property initialized - // null. + // null). // "$schema": "https://gui-cs.github.io/Terminal.Gui/schemas/tui-config-schema.json", "Application.AlternateBackwardKey": { diff --git a/Terminal.Gui/Terminal.Gui.csproj b/Terminal.Gui/Terminal.Gui.csproj index e9f2903d8..d70fbb6b3 100644 --- a/Terminal.Gui/Terminal.Gui.csproj +++ b/Terminal.Gui/Terminal.Gui.csproj @@ -63,7 +63,7 @@ net7.0 - 9.0 + 10.0 Terminal.Gui Terminal.Gui bin\Release\Terminal.Gui.xml diff --git a/Terminal.Gui/Views/Button.cs b/Terminal.Gui/Views/Button.cs index 6a62ed15d..68d92275d 100644 --- a/Terminal.Gui/Views/Button.cs +++ b/Terminal.Gui/Views/Button.cs @@ -107,10 +107,10 @@ namespace Terminal.Gui { HotKeySpecifier = new Rune ('_'); - _leftBracket = new Rune (Driver != null ? Driver.LeftBracket : '['); - _rightBracket = new Rune (Driver != null ? Driver.RightBracket : ']'); - _leftDefault = new Rune (Driver != null ? Driver.LeftDefaultIndicator : '<'); - _rightDefault = new Rune (Driver != null ? Driver.RightDefaultIndicator : '>'); + _leftBracket = CM.Glyphs.LeftBracket; + _rightBracket = CM.Glyphs.RightBracket; + _leftDefault = CM.Glyphs.LeftDefaultIndicator; + _rightDefault = CM.Glyphs.RightDefaultIndicator; CanFocus = true; AutoSize = true; @@ -166,35 +166,29 @@ namespace Terminal.Gui { /// /// /// - public bool NoDecorations {get;set;} + public bool NoDecorations { get; set; } /// /// /// - public bool NoPadding {get;set;} + public bool NoPadding { get; set; } /// protected override void UpdateTextFormatterText () { - if(NoDecorations) - { + if (NoDecorations) { TextFormatter.Text = Text; - } - else + } else if (IsDefault) TextFormatter.Text = ustring.Make (_leftBracket) + ustring.Make (_leftDefault) + " " + Text + " " + ustring.Make (_rightDefault) + ustring.Make (_rightBracket); - else - { - if(NoPadding) - { + else { + if (NoPadding) { TextFormatter.Text = ustring.Make (_leftBracket) + Text + ustring.Make (_rightBracket); - } - else - { + } else { TextFormatter.Text = ustring.Make (_leftBracket) + " " + Text + " " + ustring.Make (_rightBracket); } } - + } /// diff --git a/Terminal.Gui/Views/CheckBox.cs b/Terminal.Gui/Views/CheckBox.cs index 1e7d22576..5195c0221 100644 --- a/Terminal.Gui/Views/CheckBox.cs +++ b/Terminal.Gui/Views/CheckBox.cs @@ -83,11 +83,11 @@ namespace Terminal.Gui { /// void SetInitialProperties (ustring s, bool is_checked) { - charNullChecked = new Rune (Driver != null ? Driver.NullChecked : '?'); - charChecked = new Rune (Driver != null ? Driver.Checked : '√'); - charUnChecked = new Rune (Driver != null ? Driver.UnChecked : '╴'); + charNullChecked = CM.Glyphs.NullChecked; + charChecked = CM.Glyphs.Checked; + charUnChecked = CM.Glyphs.UnChecked; Checked = is_checked; - HotKeySpecifier = new Rune ('_'); + HotKeySpecifier = '_'; CanFocus = true; AutoSize = true; Text = s; diff --git a/Terminal.Gui/Views/ColorPicker.cs b/Terminal.Gui/Views/ColorPicker.cs index 1ae910d6c..4aaeddf86 100644 --- a/Terminal.Gui/Views/ColorPicker.cs +++ b/Terminal.Gui/Views/ColorPicker.cs @@ -280,5 +280,13 @@ namespace Terminal.Gui { return true; } + + /// + public override bool OnEnter (View view) + { + Application.Driver.SetCursorVisibility (CursorVisibility.Invisible); + + return base.OnEnter (view); + } } } diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index fe14badd6..e63ebdbaf 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -131,7 +131,7 @@ namespace Terminal.Gui { Driver.SetAttribute (current); } if (AllowsMarking) { - Driver.AddRune (Source.IsMarked (item) ? (AllowsMultipleSelection ? Driver.Checked : Driver.Selected) : (AllowsMultipleSelection ? Driver.UnChecked : Driver.UnSelected)); + Driver.AddRune (Source.IsMarked (item) ? (AllowsMultipleSelection ? CM.Glyphs.Checked : CM.Glyphs.Selected) : (AllowsMultipleSelection ? CM.Glyphs.UnChecked : CM.Glyphs.UnSelected)); Driver.AddRune (' '); } Source.Render (this, Driver, isSelected, item, col, row, f.Width - col, start); @@ -544,7 +544,7 @@ namespace Terminal.Gui { Driver.SetAttribute (ColorScheme.Focus); Move (Bounds.Right - 1, 0); - Driver.AddRune (Driver.DownArrow); + Driver.AddRune (CM.Glyphs.DownArrow); } /// diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index 2522fc9cc..801419ea8 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -106,7 +106,9 @@ namespace Terminal.Gui { buttons.Add (button); Add (button); SetNeedsDisplay (); - LayoutSubviews (); + if (IsInitialized) { + LayoutSubviews (); + } } // Get the width of all buttons, not including any Margin. diff --git a/Terminal.Gui/Views/FileDialog.cs b/Terminal.Gui/Views/FileDialog.cs index 7f42ec418..cb980e3fa 100644 --- a/Terminal.Gui/Views/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialog.cs @@ -395,12 +395,12 @@ namespace Terminal.Gui { private string GetForwardButtonText () { - return "-" + Driver.RightArrow; + return "-" + CM.Glyphs.RightArrow; } private string GetBackButtonText () { - return Driver.LeftArrow + "-"; + return CM.Glyphs.LeftArrow + "-"; } private string GetUpButtonText () @@ -411,8 +411,8 @@ namespace Terminal.Gui { private string GetToggleSplitterText (bool isExpanded) { return isExpanded ? - new string ((char)Driver.LeftArrow, 2) : - new string ((char)Driver.RightArrow, 2); + new string ((char)CM.Glyphs.LeftArrow, 2) : + new string ((char)CM.Glyphs.RightArrow, 2); } private void Delete () @@ -672,7 +672,7 @@ namespace Terminal.Gui { allowedTypeMenuBar.DrawContentComplete += (s, e) => { allowedTypeMenuBar.Move (e.Rect.Width - 1, 0); - Driver.AddRune (Driver.DownArrow); + Driver.AddRune (CM.Glyphs.DownArrow); }; diff --git a/Terminal.Gui/Views/GraphView/Axis.cs b/Terminal.Gui/Views/GraphView/Axis.cs index 516cbee97..e1f197710 100644 --- a/Terminal.Gui/Views/GraphView/Axis.cs +++ b/Terminal.Gui/Views/GraphView/Axis.cs @@ -167,7 +167,7 @@ namespace Terminal.Gui { protected override void DrawAxisLine (GraphView graph, int x, int y) { graph.Move (x, y); - Application.Driver.AddRune (Application.Driver.HLine); + Application.Driver.AddRune (CM.Glyphs.HLine); } /// @@ -217,7 +217,7 @@ namespace Terminal.Gui { graph.Move (screenPosition, y); // draw the tick on the axis - driver.AddRune (driver.TopTee); + Application.Driver.AddRune (CM.Glyphs.TopTee); // and the label text if (!string.IsNullOrWhiteSpace (text)) { @@ -352,7 +352,7 @@ namespace Terminal.Gui { protected override void DrawAxisLine (GraphView graph, int x, int y) { graph.Move (x, y); - Application.Driver.AddRune (Application.Driver.VLine); + Application.Driver.AddRune (CM.Glyphs.VLine); } private int GetAxisYEnd (GraphView graph) @@ -470,7 +470,7 @@ namespace Terminal.Gui { graph.Move (x, screenPosition); // draw the tick on the axis - Application.Driver.AddRune (Application.Driver.RightTee); + Application.Driver.AddRune (CM.Glyphs.RightTee); // and the label text if (!string.IsNullOrWhiteSpace (text)) { diff --git a/Terminal.Gui/Views/GraphView/Series.cs b/Terminal.Gui/Views/GraphView/Series.cs index 19215d1a4..3715dd2fa 100644 --- a/Terminal.Gui/Views/GraphView/Series.cs +++ b/Terminal.Gui/Views/GraphView/Series.cs @@ -32,9 +32,9 @@ namespace Terminal.Gui { /// /// The color and character that will be rendered in the console /// when there are point(s) in the corresponding graph space. - /// Defaults to uncolored 'x' + /// Defaults to uncolored 'dot' /// - public GraphCellToRender Fill { get; set; } = new GraphCellToRender ('x'); + public GraphCellToRender Fill { get; set; } = new GraphCellToRender (CM.Glyphs.Dot); /// /// Draws all points directly onto the graph diff --git a/Terminal.Gui/Views/LineView.cs b/Terminal.Gui/Views/LineView.cs index cfe22e529..8dcb834a2 100644 --- a/Terminal.Gui/Views/LineView.cs +++ b/Terminal.Gui/Views/LineView.cs @@ -49,13 +49,13 @@ namespace Terminal.Gui { case Orientation.Horizontal: Height = 1; Width = Dim.Fill (); - LineRune = Driver.HLine; + LineRune = CM.Glyphs.HLine; break; case Orientation.Vertical: Height = Dim.Fill (); Width = 1; - LineRune = Driver.VLine; + LineRune = CM.Glyphs.VLine; break; default: throw new ArgumentException ($"Unknown Orientation {orientation}"); @@ -73,7 +73,7 @@ namespace Terminal.Gui { Move (0, 0); Driver.SetAttribute (GetNormalColor ()); - var hLineWidth = Math.Max (1, Rune.ColumnWidth (Driver.HLine)); + var hLineWidth = Math.Max (1, Rune.ColumnWidth (CM.Glyphs.HLine)); var dEnd = Orientation == Orientation.Horizontal ? Bounds.Width : diff --git a/Terminal.Gui/Views/ListView.cs b/Terminal.Gui/Views/ListView.cs index 5e7fc76c2..da2627b28 100644 --- a/Terminal.Gui/Views/ListView.cs +++ b/Terminal.Gui/Views/ListView.cs @@ -385,8 +385,8 @@ namespace Terminal.Gui { Driver.SetAttribute (current); } if (allowsMarking) { - Driver.AddRune (source.IsMarked (item) ? (AllowsMultipleSelection ? Driver.Checked : Driver.Selected) : - (AllowsMultipleSelection ? Driver.UnChecked : Driver.UnSelected)); + Driver.AddRune (source.IsMarked (item) ? (AllowsMultipleSelection ? CM.Glyphs.Checked : CM.Glyphs.Selected) : + (AllowsMultipleSelection ? CM.Glyphs.UnChecked : CM.Glyphs.UnSelected)); Driver.AddRune (' '); } Source.Render (this, Driver, isSelected, item, col, row, f.Width - col, start); diff --git a/Terminal.Gui/Views/Menu.cs b/Terminal.Gui/Views/Menu.cs index b0cc4101d..02bb86475 100644 --- a/Terminal.Gui/Views/Menu.cs +++ b/Terminal.Gui/Views/Menu.cs @@ -591,7 +591,7 @@ namespace Terminal.Gui { : i == current ? ColorScheme.Focus : GetNormalColor ()); if (item == null && BorderStyle != LineStyle.None) { Move (-1, i); - Driver.AddRune (Driver.LeftTee); + Driver.AddRune (CM.Glyphs.LeftTee); } else if (Frame.X < Driver.Cols) { Move (0, i); } @@ -605,12 +605,12 @@ namespace Terminal.Gui { break; } if (item == null) - Driver.AddRune (Driver.HLine); + Driver.AddRune (CM.Glyphs.HLine); else if (i == 0 && p == 0 && host.UseSubMenusSingleFrame && item.Parent.Parent != null) - Driver.AddRune (Driver.LeftArrow); + Driver.AddRune (CM.Glyphs.LeftArrow); // This `- 3` is left border + right border + one row in from right else if (p == Frame.Width - 3 && barItems.SubMenu (barItems.Children [i]) != null) - Driver.AddRune (Driver.RightArrow); + Driver.AddRune (CM.Glyphs.RightArrow); else Driver.AddRune (' '); } @@ -618,19 +618,19 @@ namespace Terminal.Gui { if (item == null) { if (BorderStyle != LineStyle.None && SuperView?.Frame.Right - Frame.X > Frame.Width) { Move (Frame.Width - 2, i); - Driver.AddRune (Driver.RightTee); + Driver.AddRune (CM.Glyphs.RightTee); } continue; } ustring textToDraw; - var nullCheckedChar = Driver.NullChecked; - var checkChar = Driver.Selected; - var uncheckedChar = Driver.UnSelected; + var nullCheckedChar = CM.Glyphs.NullChecked; + var checkChar = CM.Glyphs.Selected; + var uncheckedChar = CM.Glyphs.UnSelected; if (item.CheckType.HasFlag (MenuItemCheckStyle.Checked)) { - checkChar = Driver.Checked; - uncheckedChar = Driver.UnChecked; + checkChar = CM.Glyphs.Checked; + uncheckedChar = CM.Glyphs.UnChecked; } // Support Checked even though CheckType wasn't set diff --git a/Terminal.Gui/Views/ProgressBar.cs b/Terminal.Gui/Views/ProgressBar.cs index cc386da77..78cd28d92 100644 --- a/Terminal.Gui/Views/ProgressBar.cs +++ b/Terminal.Gui/Views/ProgressBar.cs @@ -124,16 +124,16 @@ namespace Terminal.Gui { progressBarStyle = value; switch (value) { case ProgressBarStyle.Blocks: - SegmentCharacter = Driver.BlocksMeterSegment; + SegmentCharacter = CM.Glyphs.BlocksMeterSegment; break; case ProgressBarStyle.Continuous: - SegmentCharacter = Driver.ContinuousMeterSegment; + SegmentCharacter = CM.Glyphs.ContinuousMeterSegment; break; case ProgressBarStyle.MarqueeBlocks: - SegmentCharacter = Driver.BlocksMeterSegment; + SegmentCharacter = CM.Glyphs.BlocksMeterSegment; break; case ProgressBarStyle.MarqueeContinuous: - SegmentCharacter = Driver.ContinuousMeterSegment; + SegmentCharacter = CM.Glyphs.ContinuousMeterSegment; break; } SetNeedsDisplay (); @@ -170,7 +170,7 @@ namespace Terminal.Gui { } } - private Rune segmentCharacter = Driver.BlocksMeterSegment; + private Rune segmentCharacter = CM.Glyphs.BlocksMeterSegment; /// /// Segment indicator for meter views. diff --git a/Terminal.Gui/Views/RadioGroup.cs b/Terminal.Gui/Views/RadioGroup.cs index c92511ece..62888880c 100644 --- a/Terminal.Gui/Views/RadioGroup.cs +++ b/Terminal.Gui/Views/RadioGroup.cs @@ -206,7 +206,7 @@ namespace Terminal.Gui { } var rl = radioLabels [i]; Driver.SetAttribute (GetNormalColor ()); - Driver.AddStr (ustring.Make (new Rune [] { i == selected ? Driver.Selected : Driver.UnSelected, ' ' })); + Driver.AddStr (ustring.Make (new Rune [] { i == selected ? CM.Glyphs.Selected : CM.Glyphs.UnSelected, ' ' })); TextFormatter.FindHotKey (rl, HotKeySpecifier, true, out int hotPos, out Key hotKey); if (hotPos != -1 && (hotKey != Key.Null || hotKey != Key.Unknown)) { var rlRunes = rl.ToRunes (); diff --git a/Terminal.Gui/Views/ScrollBarView.cs b/Terminal.Gui/Views/ScrollBarView.cs index 13b741c17..988f7f74d 100644 --- a/Terminal.Gui/Views/ScrollBarView.cs +++ b/Terminal.Gui/Views/ScrollBarView.cs @@ -538,17 +538,17 @@ namespace Terminal.Gui { Move (col, 0); if (Bounds.Height == 1) { - Driver.AddRune (Driver.Diamond); + Driver.AddRune (CM.Glyphs.Diamond); } else { - Driver.AddRune (Driver.UpArrow); + Driver.AddRune (CM.Glyphs.UpArrow); } if (Bounds.Height == 3) { Move (col, 1); - Driver.AddRune (Driver.Diamond); + Driver.AddRune (CM.Glyphs.Diamond); } if (Bounds.Height > 1) { Move (col, Bounds.Height - 1); - Driver.AddRune (Driver.DownArrow); + Driver.AddRune (CM.Glyphs.DownArrow); } } else { bh -= 2; @@ -559,7 +559,7 @@ namespace Terminal.Gui { } Move (col, 0); - Driver.AddRune (Driver.UpArrow); + Driver.AddRune (CM.Glyphs.UpArrow); bool hasTopTee = false; bool hasDiamond = false; @@ -567,22 +567,22 @@ namespace Terminal.Gui { for (int y = 0; y < bh; y++) { Move (col, y + 1); if ((y < by1 || y > by2) && ((position > 0 && !hasTopTee) || (hasTopTee && hasBottomTee))) { - special = Driver.Stipple; + special = CM.Glyphs.Stipple; } else { if (y != by2 && y > 1 && by2 - by1 == 0 && by1 < bh - 1 && hasTopTee && !hasDiamond) { hasDiamond = true; - special = Driver.Diamond; + special = CM.Glyphs.Diamond; } else { if (y == by1 && !hasTopTee) { hasTopTee = true; posTopTee = y; - special = Driver.TopTee; + special = CM.Glyphs.TopTee; } else if ((position == 0 && y == bh - 1 || y >= by2 || by2 == 0) && !hasBottomTee) { hasBottomTee = true; posBottomTee = y; - special = Driver.BottomTee; + special = CM.Glyphs.BottomTee; } else { - special = Driver.VLine; + special = CM.Glyphs.VLine; } } } @@ -590,10 +590,10 @@ namespace Terminal.Gui { } if (!hasTopTee) { Move (col, Bounds.Height - 2); - Driver.AddRune (Driver.TopTee); + Driver.AddRune (CM.Glyphs.TopTee); } Move (col, Bounds.Height - 1); - Driver.AddRune (Driver.DownArrow); + Driver.AddRune (CM.Glyphs.DownArrow); } } else { if (Bounds.Bottom < Bounds.Height - 1) { @@ -609,8 +609,8 @@ namespace Terminal.Gui { var bx2 = (position + bw) * bw / Size; Move (0, row); - Driver.AddRune (Driver.LeftArrow); - Driver.AddRune (Driver.RightArrow); + Driver.AddRune (CM.Glyphs.LeftArrow); + Driver.AddRune (CM.Glyphs.RightArrow); } else { bw -= 2; var bx1 = KeepContentAlwaysInViewport ? position * bw / Size : position * bw / (Size + bw); @@ -620,29 +620,29 @@ namespace Terminal.Gui { } Move (0, row); - Driver.AddRune (Driver.LeftArrow); + Driver.AddRune (CM.Glyphs.LeftArrow); bool hasLeftTee = false; bool hasDiamond = false; bool hasRightTee = false; for (int x = 0; x < bw; x++) { if ((x < bx1 || x >= bx2 + 1) && ((position > 0 && !hasLeftTee) || (hasLeftTee && hasRightTee))) { - special = Driver.Stipple; + special = CM.Glyphs.Stipple; } else { if (x != bx2 && x > 1 && bx2 - bx1 == 0 && bx1 < bw - 1 && hasLeftTee && !hasDiamond) { hasDiamond = true; - special = Driver.Diamond; + special = CM.Glyphs.Diamond; } else { if (x == bx1 && !hasLeftTee) { hasLeftTee = true; posLeftTee = x; - special = Driver.LeftTee; + special = CM.Glyphs.LeftTee; } else if ((position == 0 && x == bw - 1 || x >= bx2 || bx2 == 0) && !hasRightTee) { hasRightTee = true; posRightTee = x; - special = Driver.RightTee; + special = CM.Glyphs.RightTee; } else { - special = Driver.HLine; + special = CM.Glyphs.HLine; } } } @@ -650,10 +650,10 @@ namespace Terminal.Gui { } if (!hasLeftTee) { Move (Bounds.Width - 2, row); - Driver.AddRune (Driver.LeftTee); + Driver.AddRune (CM.Glyphs.LeftTee); } - Driver.AddRune (Driver.RightArrow); + Driver.AddRune (CM.Glyphs.RightArrow); } } diff --git a/Terminal.Gui/Views/StatusBar.cs b/Terminal.Gui/Views/StatusBar.cs index 7ea3766df..9cf90e274 100644 --- a/Terminal.Gui/Views/StatusBar.cs +++ b/Terminal.Gui/Views/StatusBar.cs @@ -138,7 +138,7 @@ namespace Terminal.Gui { } if (i + 1 < Items.Length) { Driver.AddRune (' '); - Driver.AddRune (Driver.VLine); + Driver.AddRune (CM.Glyphs.VLine); Driver.AddRune (' '); } } diff --git a/Terminal.Gui/Views/TabView.cs b/Terminal.Gui/Views/TabView.cs index c74e7ddac..7bb2bf335 100644 --- a/Terminal.Gui/Views/TabView.cs +++ b/Terminal.Gui/Views/TabView.cs @@ -507,7 +507,7 @@ namespace Terminal.Gui { } Move (selected.X - 1, y); - Driver.AddRune (host.Style.TabsOnBottom ? Driver.LLCorner : Driver.ULCorner); + Driver.AddRune (host.Style.TabsOnBottom ? CM.Glyphs.LLCorner : CM.Glyphs.ULCorner); for (int i = 0; i < selected.Width; i++) { @@ -516,11 +516,11 @@ namespace Terminal.Gui { return; } - Driver.AddRune (Driver.HLine); + Driver.AddRune (CM.Glyphs.HLine); } // Add the end of the selected tab - Driver.AddRune (host.Style.TabsOnBottom ? Driver.LRCorner : Driver.URCorner); + Driver.AddRune (host.Style.TabsOnBottom ? CM.Glyphs.LRCorner : CM.Glyphs.URCorner); } @@ -549,7 +549,7 @@ namespace Terminal.Gui { if (toRender.IsSelected) { Move (toRender.X - 1, y); - Driver.AddRune (Driver.VLine); + Driver.AddRune (CM.Glyphs.VLine); } Move (toRender.X, y); @@ -573,7 +573,7 @@ namespace Terminal.Gui { Driver.SetAttribute (GetNormalColor ()); if (toRender.IsSelected) { - Driver.AddRune (Driver.VLine); + Driver.AddRune (CM.Glyphs.VLine); } } } @@ -593,7 +593,7 @@ namespace Terminal.Gui { if (!host.Style.ShowBorder) { for (int x = 0; x < width; x++) { - Driver.AddRune (Driver.HLine); + Driver.AddRune (CM.Glyphs.HLine); } } @@ -605,14 +605,14 @@ namespace Terminal.Gui { Move (selected.X - 1, y); - Driver.AddRune (selected.X == 1 ? Driver.VLine : - (host.Style.TabsOnBottom ? Driver.URCorner : Driver.LRCorner)); + Driver.AddRune (selected.X == 1 ? CM.Glyphs.VLine : + (host.Style.TabsOnBottom ? CM.Glyphs.URCorner : CM.Glyphs.LRCorner)); Driver.AddStr (new string (' ', selected.Width)); Driver.AddRune (selected.X + selected.Width == width - 1 ? - Driver.VLine : - (host.Style.TabsOnBottom ? Driver.ULCorner : Driver.LLCorner)); + CM.Glyphs.VLine : + (host.Style.TabsOnBottom ? CM.Glyphs.ULCorner : CM.Glyphs.LLCorner)); // draw scroll indicators @@ -621,7 +621,7 @@ namespace Terminal.Gui { Move (0, y); // indicate that - Driver.AddRune (Driver.LeftArrow); + Driver.AddRune (CM.Glyphs.LeftArrow); } // if there are more tabs to the right not visible @@ -629,7 +629,7 @@ namespace Terminal.Gui { Move (width - 1, y); // indicate that - Driver.AddRune (Driver.RightArrow); + Driver.AddRune (CM.Glyphs.RightArrow); } } diff --git a/Terminal.Gui/Views/TableView/TableView.cs b/Terminal.Gui/Views/TableView/TableView.cs index 03b7db565..66f812f4f 100644 --- a/Terminal.Gui/Views/TableView/TableView.cs +++ b/Terminal.Gui/Views/TableView/TableView.cs @@ -358,23 +358,23 @@ namespace Terminal.Gui { for (int c = 0; c < availableWidth; c++) { - var rune = Driver.HLine; + var rune = CM.Glyphs.HLine; if (Style.ShowVerticalHeaderLines) { if (c == 0) { - rune = Driver.ULCorner; + rune = CM.Glyphs.ULCorner; } // if the next column is the start of a header else if (columnsToRender.Any (r => r.X == c + 1)) { - rune = Driver.TopTee; + rune = CM.Glyphs.TopTee; } else if (c == availableWidth - 1) { - rune = Driver.URCorner; + rune = CM.Glyphs.URCorner; } // if the next console column is the lastcolumns end else if (Style.ExpandLastColumn == false && columnsToRender.Any (r => r.IsVeryLast && r.X + r.Width - 1 == c)) { - rune = Driver.TopTee; + rune = CM.Glyphs.TopTee; } } @@ -391,7 +391,7 @@ namespace Terminal.Gui { //render start of line if (style.ShowVerticalHeaderLines) - AddRune (0, row, Driver.VLine); + AddRune (0, row, CM.Glyphs.VLine); for (int i = 0; i < columnsToRender.Length; i++) { @@ -413,7 +413,7 @@ namespace Terminal.Gui { //render end of line if (style.ShowVerticalHeaderLines) - AddRune (Bounds.Width - 1, row, Driver.VLine); + AddRune (Bounds.Width - 1, row, CM.Glyphs.VLine); } private void RenderHeaderUnderline (int row, int availableWidth, ColumnToRender [] columnsToRender) @@ -456,18 +456,18 @@ namespace Terminal.Gui { // Start by assuming we just draw a straight line the // whole way but update to instead draw a header indicator // or scroll arrow etc - var rune = Driver.HLine; + var rune = CM.Glyphs.HLine; if (Style.ShowVerticalHeaderLines) { if (c == 0) { // for first character render line - rune = Style.ShowVerticalCellLines ? Driver.LeftTee : Driver.LLCorner; + rune = Style.ShowVerticalCellLines ? CM.Glyphs.LeftTee : CM.Glyphs.LLCorner; // unless we have horizontally scrolled along // in which case render an arrow, to indicate user // can scroll left if (Style.ShowHorizontalScrollIndicators && moreColumnsToLeft) { - rune = Driver.LeftArrow; + rune = CM.Glyphs.LeftArrow; scrollLeftPoint = new Point (c, row); } @@ -476,17 +476,17 @@ namespace Terminal.Gui { else if (columnsToRender.Any (r => r.X == c + 1)) { /*TODO: is ┼ symbol in Driver?*/ - rune = Style.ShowVerticalCellLines ? '┼' : Driver.BottomTee; + rune = Style.ShowVerticalCellLines ? CM.Glyphs.Cross : CM.Glyphs.BottomTee; } else if (c == availableWidth - 1) { // for the last character in the table - rune = Style.ShowVerticalCellLines ? Driver.RightTee : Driver.LRCorner; + rune = Style.ShowVerticalCellLines ? CM.Glyphs.RightTee : CM.Glyphs.LRCorner; // unless there is more of the table we could horizontally // scroll along to see. In which case render an arrow, // to indicate user can scroll right if (Style.ShowHorizontalScrollIndicators && moreColumnsToRight) { - rune = Driver.RightArrow; + rune = CM.Glyphs.RightArrow; scrollRightPoint = new Point (c, row); } @@ -494,7 +494,7 @@ namespace Terminal.Gui { // if the next console column is the lastcolumns end else if (Style.ExpandLastColumn == false && columnsToRender.Any (r => r.IsVeryLast && r.X + r.Width - 1 == c)) { - rune = Style.ShowVerticalCellLines ? '┼' : Driver.BottomTee; + rune = Style.ShowVerticalCellLines ? CM.Glyphs.Cross : CM.Glyphs.BottomTee; } } @@ -512,24 +512,24 @@ namespace Terminal.Gui { // Start by assuming we just draw a straight line the // whole way but update to instead draw BottomTee / Corner etc - var rune = Driver.HLine; + var rune = CM.Glyphs.HLine; if (Style.ShowVerticalCellLines) { if (c == 0) { // for first character render line - rune = Driver.LLCorner; + rune = CM.Glyphs.LLCorner; } else if (columnsToRender.Any (r => r.X == c + 1)) { // if the next column is the start of a header - rune = Driver.BottomTee; + rune = CM.Glyphs.BottomTee; } else if (c == availableWidth - 1) { // for the last character in the table - rune = Driver.LRCorner; + rune = CM.Glyphs.LRCorner; } else if (Style.ExpandLastColumn == false && columnsToRender.Any (r => r.IsVeryLast && r.X + r.Width - 1 == c)) { // if the next console column is the lastcolumns end - rune = Driver.BottomTee; + rune = CM.Glyphs.BottomTee; } } @@ -639,8 +639,8 @@ namespace Terminal.Gui { Driver.SetAttribute (rowScheme.Normal); //render start and end of line - AddRune (0, row, Driver.VLine); - AddRune (Bounds.Width - 1, row, Driver.VLine); + AddRune (0, row, CM.Glyphs.VLine); + AddRune (Bounds.Width - 1, row, CM.Glyphs.VLine); } } @@ -685,7 +685,7 @@ namespace Terminal.Gui { var renderLines = isHeader ? style.ShowVerticalHeaderLines : style.ShowVerticalCellLines; - Rune symbol = renderLines ? Driver.VLine : SeparatorSymbol; + Rune symbol = renderLines ? CM.Glyphs.VLine : SeparatorSymbol; AddRune (col, row, symbol); } @@ -1337,7 +1337,7 @@ namespace Terminal.Gui { /// This always calls public void Update () { - if (TableIsNullOrInvisible ()) { + if (!IsInitialized || TableIsNullOrInvisible ()) { SetNeedsDisplay (); return; } diff --git a/Terminal.Gui/Views/TextField.cs b/Terminal.Gui/Views/TextField.cs index f4c8e3b6a..875f33872 100644 --- a/Terminal.Gui/Views/TextField.cs +++ b/Terminal.Gui/Views/TextField.cs @@ -469,7 +469,7 @@ namespace Terminal.Gui { Driver.SetAttribute (idx >= start && length > 0 && idx < start + length ? selColor : ColorScheme.Focus); } if (col + cols <= width) { - Driver.AddRune ((Rune)(Secret ? '*' : rune)); + Driver.AddRune ((Rune)(Secret ? CM.Glyphs.Dot : rune)); } if (!TextModel.SetCol (ref col, width, cols)) { break; diff --git a/Terminal.Gui/Views/TextView.cs b/Terminal.Gui/Views/TextView.cs index 10cf213ef..413b829e9 100644 --- a/Terminal.Gui/Views/TextView.cs +++ b/Terminal.Gui/Views/TextView.cs @@ -1995,7 +1995,14 @@ namespace Terminal.Gui { /// Indicates whatever the text was changed or not. /// if the text was changed otherwise. /// - public bool IsDirty => _historyText.IsDirty (Text); + public bool IsDirty { + get { + return _historyText.IsDirty (Text); + } + set { + _historyText.Clear (Text); + } + } /// /// Indicates whatever the text has history changes or not. diff --git a/Terminal.Gui/Views/TileView.cs b/Terminal.Gui/Views/TileView.cs index 912a02f6d..c305fd799 100644 --- a/Terminal.Gui/Views/TileView.cs +++ b/Terminal.Gui/Views/TileView.cs @@ -200,7 +200,9 @@ namespace Terminal.Gui { tile.TitleChanged += (s, e) => SetNeedsDisplay (); } - LayoutSubviews (); + if (IsInitialized) { + LayoutSubviews (); + } } /// @@ -233,7 +235,9 @@ namespace Terminal.Gui { } } SetNeedsDisplay (); - LayoutSubviews (); + if (IsInitialized) { + LayoutSubviews (); + } return toReturn; } @@ -326,12 +330,18 @@ namespace Terminal.Gui { get { return orientation; } set { orientation = value; - LayoutSubviews (); + if (IsInitialized) { + LayoutSubviews (); + } } } /// public override void LayoutSubviews () { + if (!IsInitialized) { + return; + } + var contentArea = Bounds; if (HasBorder ()) { @@ -719,7 +729,7 @@ namespace Terminal.Gui { line.Height = orientation == Orientation.Vertical ? Dim.Fill () : 1; line.LineRune = orientation == Orientation.Vertical ? - Driver.VLine : Driver.HLine; + CM.Glyphs.VLine : CM.Glyphs.HLine; if (orientation == Orientation.Vertical) { line.X = splitterDistances [i]; @@ -928,7 +938,7 @@ namespace Terminal.Gui { var location = moveRuneRenderLocation ?? new Point (Bounds.Width / 2, Bounds.Height / 2); - AddRune (location.X, location.Y, Driver.Diamond); + AddRune (location.X, location.Y, CM.Glyphs.Diamond); } } diff --git a/Terminal.Gui/Views/TreeView/Branch.cs b/Terminal.Gui/Views/TreeView/Branch.cs index 56c2c5df6..27964067a 100644 --- a/Terminal.Gui/Views/TreeView/Branch.cs +++ b/Terminal.Gui/Views/TreeView/Branch.cs @@ -210,16 +210,16 @@ namespace Terminal.Gui { if (cur.IsLast ()) { yield return new Rune (' '); } else { - yield return driver.VLine; + yield return CM.Glyphs.VLine; } yield return new Rune (' '); } if (IsLast ()) { - yield return driver.LLCorner; + yield return CM.Glyphs.LLCorner; } else { - yield return driver.LeftTee; + yield return CM.Glyphs.LeftTee; } } @@ -246,7 +246,7 @@ namespace Terminal.Gui { /// public Rune GetExpandableSymbol (ConsoleDriver driver) { - var leafSymbol = tree.Style.ShowBranchLines ? driver.HLine : ' '; + var leafSymbol = tree.Style.ShowBranchLines ? CM.Glyphs.HLine : ' '; if (IsExpanded) { return tree.Style.CollapseableSymbol ?? leafSymbol; diff --git a/Terminal.Gui/Views/TreeView/TreeStyle.cs b/Terminal.Gui/Views/TreeView/TreeStyle.cs index 12a636b26..a0c2061be 100644 --- a/Terminal.Gui/Views/TreeView/TreeStyle.cs +++ b/Terminal.Gui/Views/TreeView/TreeStyle.cs @@ -17,13 +17,13 @@ namespace Terminal.Gui { /// Symbol to use for branch nodes that can be expanded to indicate this to the user. /// Defaults to '+'. Set to null to hide. /// - public Rune? ExpandableSymbol { get; set; } = '+'; + public Rune? ExpandableSymbol { get; set; } = CM.Glyphs.Expand; /// /// Symbol to use for branch nodes that can be collapsed (are currently expanded). /// Defaults to '-'. Set to null to hide. /// - public Rune? CollapseableSymbol { get; set; } = '-'; + public Rune? CollapseableSymbol { get; set; } = CM.Glyphs.Collapse; /// /// Set to to highlight expand/collapse symbols in hot key color. diff --git a/UICatalog/Scenario.cs b/UICatalog/Scenario.cs index 3b3c40b66..f82a76d9c 100644 --- a/UICatalog/Scenario.cs +++ b/UICatalog/Scenario.cs @@ -14,7 +14,7 @@ namespace UICatalog { /// Annotate the derived class with a attribute specifying the scenario's name and description. /// Add one or more attributes to the class specifying which categories the scenario belongs to. If you don't specify a category the scenario will show up in "_All". /// Implement the override which will be called when a user selects the scenario to run. - /// Optionally, implement the and/or overrides to provide a custom implementation. + /// Optionally, implement the and/or overrides to provide a custom implementation. /// /// /// diff --git a/UICatalog/Scenarios/AllViewsTester.cs b/UICatalog/Scenarios/AllViewsTester.cs index 0239a7104..ad5128c08 100644 --- a/UICatalog/Scenarios/AllViewsTester.cs +++ b/UICatalog/Scenarios/AllViewsTester.cs @@ -244,8 +244,6 @@ namespace UICatalog.Scenarios { Application.Top.Add (_leftPane, _settingsPane, _hostPane); - Application.Top.LayoutSubviews (); - _curView = CreateClass (_viewClasses.First ().Value); } @@ -417,8 +415,6 @@ namespace UICatalog.Scenarios { // Add _hostPane.Add (view); - //DimPosChanged (); - _hostPane.LayoutSubviews (); _hostPane.Clear (); _hostPane.SetNeedsDisplay (); UpdateSettings (view); diff --git a/UICatalog/Scenarios/ConfigurationEditor.cs b/UICatalog/Scenarios/ConfigurationEditor.cs index d04668b06..0ae5ef8c2 100644 --- a/UICatalog/Scenarios/ConfigurationEditor.cs +++ b/UICatalog/Scenarios/ConfigurationEditor.cs @@ -61,7 +61,7 @@ namespace UICatalog.Scenarios { Application.Top.Add (statusBar); - Open (); + Application.Top.Loaded += (s, a) => Open (); ConfigurationEditor._editorColorSchemeChanged += () => { foreach (var t in _tileView.Tiles) { @@ -80,7 +80,7 @@ namespace UICatalog.Scenarios { internal ConfigTextView () { - ContentsChanged += (s,obj) => { + ContentsChanged += (s, obj) => { if (IsDirty) { if (!Tile.Title.EndsWith ('*')) { Tile.Title += '*'; @@ -132,7 +132,7 @@ namespace UICatalog.Scenarios { writer.Write (Text.ToString ()); writer.Close (); Tile.Title = Tile.Title.TrimEnd ('*'); - //IsDirty = false; + IsDirty = false; } } @@ -163,26 +163,13 @@ namespace UICatalog.Scenarios { textView.Read (); - textView.Enter += (s,e) => { + textView.Enter += (s, e) => { _lenStatusItem.Title = $"Len:{textView.Text.Length}"; }; - //var mi = new MenuItem () { - // Title = tile.Title, - // CheckType = MenuItemCheckStyle.Checked, - // Checked = true, - //}; - //mi.Action += () => { - // mi.Checked =! mi.Checked; - // _tileView.SetNeedsDisplay (); - //}; - - //subMenu.Children = subMenu.Children.Append (mi).ToArray (); } - //var menu = new MenuBar (new MenuBarItem [] { subMenu }); - //Application.Top.Add (menu); - + Application.Top.LayoutSubviews (); } private void Reload () diff --git a/UICatalog/Scenarios/GraphViewExample.cs b/UICatalog/Scenarios/GraphViewExample.cs index 13f2ec82d..1341720f5 100644 --- a/UICatalog/Scenarios/GraphViewExample.cs +++ b/UICatalog/Scenarios/GraphViewExample.cs @@ -105,7 +105,7 @@ namespace UICatalog.Scenarios { var series = new MultiBarSeries (3, 1, 0.25f, new [] { magenta, cyan, red }); - var stiple = Application.Driver.Stipple; + var stiple = CM.Glyphs.Stipple; series.AddBars ("'96", stiple, 5900, 9000, 14000); series.AddBars ("'97", stiple, 6100, 9200, 14800); @@ -428,7 +428,7 @@ namespace UICatalog.Scenarios { graphView.AxisY.ShowLabelsEvery = 0; graphView.AxisY.Minimum = 0; - var stiple = new GraphCellToRender (Application.Driver.Stipple); + var stiple = new GraphCellToRender (CM.Glyphs.Stipple); // Bars in 2 directions diff --git a/UICatalog/Scenarios/LineDrawing.cs b/UICatalog/Scenarios/LineDrawing.cs index 3101a3bc4..9ae3da08f 100644 --- a/UICatalog/Scenarios/LineDrawing.cs +++ b/UICatalog/Scenarios/LineDrawing.cs @@ -1,7 +1,10 @@ -using System; +using NStack; +using System; using System.Collections.Generic; +using System.Linq; using System.Reflection.Metadata.Ecma335; using Terminal.Gui; +using Attribute = Terminal.Gui.Attribute; namespace UICatalog.Scenarios { @@ -12,214 +15,127 @@ namespace UICatalog.Scenarios { public override void Setup () { - var toolsWidth = 12; - var canvas = new DrawingArea { - Width = Dim.Fill (toolsWidth + 1), - Height = Dim.Fill (), - BorderStyle = LineStyle.Single + X = 0, + Y = 0, + Width = Dim.Fill (), + Height = Dim.Fill () }; - var tools = new ToolsView (toolsWidth) { - Y = 1, - X = Pos.AnchorEnd (toolsWidth + 1), - Height = Dim.Fill (), - Width = Dim.Fill () + var tools = new ToolsView () { + Title = "Tools", + X = Pos.Right(canvas) - 20, + Y = 2 }; tools.ColorChanged += (c) => canvas.SetColor (c); tools.SetStyle += (b) => canvas.LineStyle = b; + tools.AddLayer += () => canvas.AddLayer (); Win.Add (canvas); Win.Add (tools); - Win.Add (new Label (" -Tools-") { X = Pos.AnchorEnd (toolsWidth + 1) }); } - class ToolsView : View { - - LineCanvas grid; + class ToolsView : Window { public event Action ColorChanged; public event Action SetStyle; + public event Action AddLayer; - Dictionary swatches = new Dictionary { - { new Point(1,1),Color.Red}, - { new Point(3,1),Color.Green}, - { new Point(5,1),Color.BrightBlue}, - { new Point(7,1),Color.Black}, - { new Point(9,1),Color.DarkGray}, - { new Point(11,1),Color.White}, - }; + private RadioGroup _stylePicker; + private ColorPicker _colorPicker; + private Button _addLayerBtn; - public ToolsView (int width) + public ToolsView () { - grid = new LineCanvas (); - - grid.AddLine (new Point (0, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (0, 0), width + 1, Orientation.Horizontal, LineStyle.Single); - grid.AddLine (new Point (width, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (0, 6), width + 1, Orientation.Horizontal, LineStyle.Single); - - grid.AddLine (new Point (2, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (4, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (6, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (8, 0), 7, Orientation.Vertical, LineStyle.Single); - grid.AddLine (new Point (10, 0), 7, Orientation.Vertical, LineStyle.Single); - - grid.AddLine (new Point (0, 2), width + 1, Orientation.Horizontal, LineStyle.Single); - grid.AddLine (new Point (0, 4), width + 1, Orientation.Horizontal, LineStyle.Single); + BorderStyle = LineStyle.Dotted; + Border.Thickness = new Thickness (1, 2, 1, 1); + Initialized += ToolsView_Initialized; } - public override void OnDrawContent (Rect contentArea) + private void ToolsView_Initialized (object sender, EventArgs e) { - base.OnDrawContent (contentArea); - - Driver.SetAttribute (new Terminal.Gui.Attribute (Color.DarkGray, ColorScheme.Normal.Background)); - - - foreach (var p in grid.GetMap (Bounds)) { - this.AddRune (p.Key.X, p.Key.Y, p.Value); - } - - foreach (var swatch in swatches) { - Driver.SetAttribute (new Terminal.Gui.Attribute (swatch.Value, ColorScheme.Normal.Background)); - AddRune (swatch.Key.X, swatch.Key.Y, '█'); - } - - Driver.SetAttribute (new Terminal.Gui.Attribute (ColorScheme.Normal.Foreground, ColorScheme.Normal.Background)); - AddRune (1, 3, Application.Driver.HLine); - AddRune (3, 3, Application.Driver.HDsLine); - AddRune (5, 3, Application.Driver.HDtLine); - AddRune (7, 3, Application.Driver.ULRCorner); - AddRune (9, 3, Application.Driver.HDsLine); - AddRune (11, 3, Application.Driver.HDtLine); - AddRune (1, 5, Application.Driver.HThLine); - AddRune (3, 5, Application.Driver.HThDsLine); - AddRune (5, 5, Application.Driver.HThDtLine); - AddRune (7, 5, Application.Driver.HDbLine); + LayoutSubviews (); + Width = Math.Max (_colorPicker.Frame.Width, _stylePicker.Frame.Width) + GetFramesThickness().Horizontal; + Height = _colorPicker.Frame.Height + _stylePicker.Frame.Height + _addLayerBtn.Frame.Height + GetFramesThickness ().Vertical; + SuperView.LayoutSubviews (); } - public override bool OnMouseEvent (MouseEvent mouseEvent) + public override void BeginInit () { - if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Clicked)) { - foreach (var swatch in swatches) { - if (mouseEvent.X == swatch.Key.X && mouseEvent.Y == swatch.Key.Y) { + base.BeginInit (); - ColorChanged?.Invoke (swatch.Value); - return true; - } - } + _colorPicker = new ColorPicker () { + X = 0, + Y = 0, + BoxHeight = 1, + BoxWidth = 2 + }; - if (mouseEvent.X == 1 && mouseEvent.Y == 3) { + _colorPicker.ColorChanged += (s, a) => ColorChanged?.Invoke (a.Color); - SetStyle?.Invoke (LineStyle.Single); - return true; - } - if (mouseEvent.X == 3 && mouseEvent.Y == 3) { + _stylePicker = new RadioGroup (Enum.GetNames (typeof (LineStyle)).Select (s => ustring.Make (s)).ToArray ()) { + X = 0, + Y = Pos.Bottom (_colorPicker) + }; - SetStyle?.Invoke (LineStyle.Dashed); - return true; - } - if (mouseEvent.X == 5 && mouseEvent.Y == 3) { + _stylePicker.SelectedItemChanged += (s, a) => { + SetStyle?.Invoke ((LineStyle)a.SelectedItem); + }; - SetStyle?.Invoke (LineStyle.Dotted); - return true; - } - if (mouseEvent.X == 7 && mouseEvent.Y == 3) { + _addLayerBtn = new Button () { + Text = "New Layer", + X = Pos.Center (), + Y = Pos.Bottom (_stylePicker), + }; - SetStyle?.Invoke (LineStyle.Rounded); - return true; - } - if (mouseEvent.X == 9 && mouseEvent.Y == 3) { - - SetStyle?.Invoke (LineStyle.RoundedDashed); - return true; - } - if (mouseEvent.X == 11 && mouseEvent.Y == 3) { - - SetStyle?.Invoke (LineStyle.RoundedDotted); - return true; - } - if (mouseEvent.X == 1 && mouseEvent.Y == 5) { - - SetStyle?.Invoke (LineStyle.Heavy); - return true; - } - if (mouseEvent.X == 3 && mouseEvent.Y == 5) { - - SetStyle?.Invoke (LineStyle.HeavyDashed); - return true; - } - if (mouseEvent.X == 5 && mouseEvent.Y == 5) { - - SetStyle?.Invoke (LineStyle.HeavyDotted); - return true; - } - if (mouseEvent.X == 7 && mouseEvent.Y == 5) { - - SetStyle?.Invoke (LineStyle.Double); - return true; - } - } - - return base.OnMouseEvent (mouseEvent); + _addLayerBtn.Clicked += (s, a) => AddLayer?.Invoke (); + Add (_colorPicker, _stylePicker, _addLayerBtn); } } class DrawingArea : View { - /// - /// Index into by color. - /// - Dictionary colorLayers = new Dictionary (); - List canvases = new List (); - int currentColor; + List _layers = new List (); + LineCanvas _currentLayer; + Color _currentColor = Color.White; + Point? _currentLineStart = null; - Point? currentLineStart = null; public LineStyle LineStyle { get; set; } public DrawingArea () { - AddCanvas (Color.White); + AddLayer (); } - private void AddCanvas (Color c) + internal void AddLayer () { - if (colorLayers.ContainsKey (c)) { - return; - } - - canvases.Add (new LineCanvas ()); - colorLayers.Add (c, canvases.Count - 1); - currentColor = canvases.Count - 1; + _currentLayer = new LineCanvas (); + _layers.Add (_currentLayer); } public override void OnDrawContent (Rect contentArea) { base.OnDrawContent (contentArea); - foreach (var kvp in colorLayers) { - - Driver.SetAttribute (new Terminal.Gui.Attribute (kvp.Key, ColorScheme.Normal.Background)); - - var canvas = canvases [kvp.Value]; - - foreach (var p in canvas.GetMap (Bounds)) { - this.AddRune (p.Key.X, p.Key.Y, p.Value); + foreach (var canvas in _layers) { + + foreach (var c in canvas.GetCellMap ()) { + Driver.SetAttribute (c.Value.Attribute?.Value ?? ColorScheme.Normal); + this.AddRune (c.Key.X, c.Key.Y, c.Value.Rune.Value); } } } public override bool OnMouseEvent (MouseEvent mouseEvent) { - if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Pressed)) { - if (currentLineStart == null) { - currentLineStart = new Point (mouseEvent.X - 1, mouseEvent.Y - 1); + if (_currentLineStart == null) { + _currentLineStart = new Point (mouseEvent.X - GetBoundsOffset().X, mouseEvent.Y - GetBoundsOffset ().X); } } else { - if (currentLineStart != null) { + if (_currentLineStart != null) { - var start = currentLineStart.Value; - var end = new Point (mouseEvent.X - 1, mouseEvent.Y - 1); + var start = _currentLineStart.Value; + var end = new Point (mouseEvent.X - GetBoundsOffset ().X, mouseEvent.Y - GetBoundsOffset ().X); var orientation = Orientation.Vertical; var length = end.Y - start.Y; @@ -235,14 +151,14 @@ namespace UICatalog.Scenarios { length--; } - - canvases [currentColor].AddLine ( + _currentLayer.AddLine ( start, length, orientation, - LineStyle); + LineStyle, + new Attribute (_currentColor, GetNormalColor().Background)); - currentLineStart = null; + _currentLineStart = null; SetNeedsDisplay (); } } @@ -252,10 +168,8 @@ namespace UICatalog.Scenarios { internal void SetColor (Color c) { - AddCanvas (c); - currentColor = colorLayers [c]; + _currentColor = c; } - } } } diff --git a/UICatalog/Scenarios/LineViewExample.cs b/UICatalog/Scenarios/LineViewExample.cs index cf1dab920..de29d0125 100644 --- a/UICatalog/Scenarios/LineViewExample.cs +++ b/UICatalog/Scenarios/LineViewExample.cs @@ -61,7 +61,7 @@ namespace UICatalog.Scenarios { var arrowLine = new LineView () { Y = 7, Width = 10, - StartingAnchor = Application.Driver.LeftTee, + StartingAnchor = CM.Glyphs.LeftTee, EndingAnchor = '>' }; @@ -81,7 +81,7 @@ namespace UICatalog.Scenarios { // creates a horizontal line var verticalArrow = new LineView (Orientation.Vertical) { X = 27, - StartingAnchor = Application.Driver.TopTee, + StartingAnchor = CM.Glyphs.TopTee, EndingAnchor = 'V' }; diff --git a/UICatalog/Scenarios/Snake.cs b/UICatalog/Scenarios/Snake.cs index b6a5ae2eb..609c138f9 100644 --- a/UICatalog/Scenarios/Snake.cs +++ b/UICatalog/Scenarios/Snake.cs @@ -115,7 +115,7 @@ namespace UICatalog.Scenarios { } Driver.SetAttribute (red); - AddRune (State.Apple.X, State.Apple.Y, 'A'); + AddRune (State.Apple.X, State.Apple.Y, CM.Glyphs.Apple); Driver.SetAttribute (white); } public override bool OnKeyDown (KeyEvent keyEvent) diff --git a/UICatalog/Scenarios/TableEditor.cs b/UICatalog/Scenarios/TableEditor.cs index bc57cc73c..fde6005fe 100644 --- a/UICatalog/Scenarios/TableEditor.cs +++ b/UICatalog/Scenarios/TableEditor.cs @@ -192,7 +192,7 @@ namespace UICatalog.Scenarios { // add a new one if this the one that is being sorted if (col.Ordinal == clickedCol) { - col.ColumnName += isAsc ? '▲' : '▼'; + col.ColumnName += isAsc ? CM.Glyphs.UpArrow : CM.Glyphs.DownArrow; } } @@ -201,11 +201,11 @@ namespace UICatalog.Scenarios { private string TrimArrows (string columnName) { - return columnName.TrimEnd ('▼', '▲'); + return columnName.TrimEnd ((char)CM.Glyphs.UpArrow, (char)CM.Glyphs.DownArrow); } private string StripArrows (string columnName) { - return columnName.Replace ("▼", "").Replace ("▲", ""); + return columnName.Replace ($"{CM.Glyphs.DownArrow}", "").Replace ($"{CM.Glyphs.UpArrow}", ""); } private string GetProposedNewSortOrder (int clickedCol, out bool isAsc) { diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index 9ef655d5e..9ffa9454d 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -1,3 +1,5 @@ +global using CM = Terminal.Gui.ConfigurationManager; + using NStack; using System; using System.Collections.Generic; @@ -116,8 +118,8 @@ namespace UICatalog { Scenario scenario; while ((scenario = RunUICatalogTopLevel ()) != null) { VerifyObjectsWereDisposed (); - ConfigurationManager.Themes!.Theme = _cachedTheme!; - ConfigurationManager.Apply (); + CM.Themes!.Theme = _cachedTheme!; + CM.Apply (); scenario.Theme = _cachedTheme; scenario.TopLevelColorScheme = _topLevelColorScheme; scenario.Init (); @@ -188,8 +190,8 @@ namespace UICatalog { // TOOD: THis is a hack. Figure out how to ensure that the file is fully written before reading it. Thread.Sleep (500); - ConfigurationManager.Load (); - ConfigurationManager.Apply (); + CM.Load (); + CM.Apply (); } /// @@ -207,10 +209,10 @@ namespace UICatalog { Application.Init (); if (_cachedTheme is null) { - _cachedTheme = ConfigurationManager.Themes?.Theme; + _cachedTheme = CM.Themes?.Theme; } else { - ConfigurationManager.Themes!.Theme = _cachedTheme; - ConfigurationManager.Apply (); + CM.Themes!.Theme = _cachedTheme; + CM.Apply (); } //Application.EnableConsoleScrolling = _enableConsoleScrolling; @@ -415,11 +417,9 @@ namespace UICatalog { // Restore previous selections CategoryList.SelectedItem = _cachedCategoryIndex; - CategoryList.EnsureSelectedItemVisible (); ScenarioList.SelectedRow = _cachedScenarioIndex; - ScenarioList.EnsureSelectedCellIsVisible (); - ConfigurationManager.Applied += ConfigAppliedHandler; + CM.Applied += ConfigAppliedHandler; } void LoadedHandler (object? sender, EventArgs? args) @@ -451,11 +451,13 @@ namespace UICatalog { }; Loaded -= LoadedHandler; + CategoryList.EnsureSelectedItemVisible (); + ScenarioList.EnsureSelectedCellIsVisible (); } private void UnloadedHandler (object? sender, EventArgs? args) { - ConfigurationManager.Applied -= ConfigAppliedHandler; + CM.Applied -= ConfigAppliedHandler; Unloaded -= UnloadedHandler; } @@ -680,16 +682,16 @@ namespace UICatalog { public MenuItem []? CreateThemeMenuItems () { List menuItems = new List (); - foreach (var theme in ConfigurationManager.Themes!) { + foreach (var theme in CM.Themes!) { var item = new MenuItem { Title = theme.Key, Shortcut = Key.AltMask + theme.Key [0] }; item.CheckType |= MenuItemCheckStyle.Checked; - item.Checked = theme.Key == _cachedTheme; // ConfigurationManager.Themes.Theme; + item.Checked = theme.Key == _cachedTheme; // CM.Themes.Theme; item.Action += () => { - ConfigurationManager.Themes.Theme = _cachedTheme = theme.Key; - ConfigurationManager.Apply (); + CM.Themes.Theme = _cachedTheme = theme.Key; + CM.Apply (); }; menuItems.Add (item); } @@ -738,9 +740,9 @@ namespace UICatalog { if (checkedThemeMenu != null) { checkedThemeMenu.Checked = false; } - checkedThemeMenu = _themeMenuItems?.Where (m => m != null && m.Title == ConfigurationManager.Themes?.Theme).FirstOrDefault (); + checkedThemeMenu = _themeMenuItems?.Where (m => m != null && m.Title == CM.Themes?.Theme).FirstOrDefault (); if (checkedThemeMenu != null) { - ConfigurationManager.Themes!.Theme = checkedThemeMenu.Title.ToString ()!; + CM.Themes!.Theme = checkedThemeMenu.Title.ToString ()!; checkedThemeMenu.Checked = true; } diff --git a/UICatalog/UICatalog.csproj b/UICatalog/UICatalog.csproj index 9b27b05df..6ff3c35a1 100644 --- a/UICatalog/UICatalog.csproj +++ b/UICatalog/UICatalog.csproj @@ -2,7 +2,7 @@ Exe net7.0 - 8.0 + 10.0 UICatalog.UICatalogApp diff --git a/UnitTests/AssemblyInfo.cs b/UnitTests/AssemblyInfo.cs index e03a2fd4d..8739e61a2 100644 --- a/UnitTests/AssemblyInfo.cs +++ b/UnitTests/AssemblyInfo.cs @@ -1,4 +1,6 @@ -using System; +global using CM = Terminal.Gui.ConfigurationManager; + +using System; using System.Diagnostics; using System.Reflection; using Terminal.Gui; diff --git a/UnitTests/ConsoleDrivers/ConsoleDriverTests.cs b/UnitTests/ConsoleDrivers/ConsoleDriverTests.cs index a6b061021..03858df3e 100644 --- a/UnitTests/ConsoleDrivers/ConsoleDriverTests.cs +++ b/UnitTests/ConsoleDrivers/ConsoleDriverTests.cs @@ -251,7 +251,7 @@ namespace Terminal.Gui.DriverTests { System.Threading.Tasks.Task.Delay (500).Wait (); Application.MainLoop.Invoke (() => { var lbl = new Label ("Hello World") { X = Pos.Center () }; - var dlg = new Dialog (new Button ("Ok")); + var dlg = new Dialog (); dlg.Add (lbl); Application.Begin (dlg); @@ -261,7 +261,7 @@ namespace Terminal.Gui.DriverTests { ││ Hello World │ │ ││ │ │ ││ │ │ -││ [ Ok ] │ │ +││ │ │ │└───────────────┘ │ └──────────────────┘ "; @@ -278,7 +278,7 @@ namespace Terminal.Gui.DriverTests { ││ Hello World │ │ ││ │ │ ││ │ │ -││ [ Ok ] │ │ +││ │ │ │└───────────────┘ │ └──────────────────┘ "; diff --git a/UnitTests/Dialogs/DialogTests.cs b/UnitTests/Dialogs/DialogTests.cs index 2ebc5884c..b3595a4ea 100644 --- a/UnitTests/Dialogs/DialogTests.cs +++ b/UnitTests/Dialogs/DialogTests.cs @@ -30,7 +30,7 @@ namespace Terminal.Gui.DialogTests { // var title = "Title"; // var btnText = "ok"; - // var buttonRow = $"{d.VLine}{d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}"; + // var buttonRow = $"{CM.Glyphs.VLine}{CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; // var width = buttonRow.Length; // var topRow = $"┌┤{title} {new string (d.HLine.ToString () [0], width - title.Length - 2)}├┐"; // var bottomRow = $"└{new string (d.HLine.ToString () [0], width - 2)}┘"; @@ -214,7 +214,7 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; // E.g "|[ ok ]|" var btnText = "ok"; - var buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (width, 1); @@ -225,28 +225,28 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{d.LeftBracket} {btnText} {d.RightBracket} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Wider - buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket} {CM.Glyphs.VLine}"; width = buttonRow.Length; d.SetBufferSize (width, 1); @@ -256,21 +256,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{d.LeftBracket} {btnText} {d.RightBracket} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btnText)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -288,11 +288,11 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; // E.g "|[ yes ][ no ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; - var buttonRow = $@"{d.VLine} {btn1} {btn2} {d.VLine}"; + var buttonRow = $@"{CM.Glyphs.VLine} {btn1} {btn2} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 3); @@ -302,21 +302,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $@"{d.VLine}{btn1} {btn2}{d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine}{btn1} {btn2}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $@"{d.VLine} {btn1} {btn2}{d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine} {btn1} {btn2}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $@"{d.VLine}{btn1} {btn2} {d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine}{btn1} {btn2} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -335,11 +335,11 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; // E.g "|[ yes ][ no ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; - var buttonRow = $@"{d.VLine} {btn1} {btn2} {d.VLine}"; + var buttonRow = $@"{CM.Glyphs.VLine} {btn1} {btn2} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 3); @@ -353,7 +353,7 @@ namespace Terminal.Gui.DialogTests { (runstate, dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, button1, button2); button1.Visible = false; Application.RunMainLoopIteration (ref runstate, true, ref firstIteration); - buttonRow = $@"{d.VLine} {btn2} {d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine} {btn2} {CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); @@ -364,7 +364,7 @@ namespace Terminal.Gui.DialogTests { (runstate, dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, button1, button2); button1.Visible = false; Application.RunMainLoopIteration (ref runstate, true, ref firstIteration); - buttonRow = $@"{d.VLine} {btn2}{d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine} {btn2}{CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); @@ -385,7 +385,7 @@ namespace Terminal.Gui.DialogTests { (runstate, dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, button1, button2); button1.Visible = false; Application.RunMainLoopIteration (ref runstate, true, ref firstIteration); - buttonRow = $@"{d.VLine} {btn2} {d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine} {btn2} {CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); } @@ -401,13 +401,13 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; // E.g "|[ yes ][ no ][ maybe ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; var btn3Text = "maybe"; - var btn3 = $"{d.LeftBracket} {btn3Text} {d.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} {btn3Text} {CM.Glyphs.RightBracket}"; - var buttonRow = $@"{d.VLine} {btn1} {btn2} {btn3} {d.VLine}"; + var buttonRow = $@"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 3); @@ -417,21 +417,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $@"{d.VLine}{btn1} {btn2} {btn3}{d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine}{btn1} {btn2} {btn3}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $@"{d.VLine} {btn1} {btn2} {btn3}{d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine} {btn1} {btn2} {btn3}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $@"{d.VLine}{btn1} {btn2} {btn3} {d.VLine}"; + buttonRow = $@"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -450,15 +450,15 @@ namespace Terminal.Gui.DialogTests { // E.g "|[ yes ][ no ][ maybe ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; var btn3Text = "maybe"; - var btn3 = $"{d.LeftBracket} {btn3Text} {d.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} {btn3Text} {CM.Glyphs.RightBracket}"; var btn4Text = "never"; - var btn4 = $"{d.LeftBracket} {btn4Text} {d.RightBracket}"; + var btn4 = $"{CM.Glyphs.LeftBracket} {btn4Text} {CM.Glyphs.RightBracket}"; - var buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 3); @@ -468,21 +468,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -501,37 +501,37 @@ namespace Terminal.Gui.DialogTests { // E.g "|[ yes ][ no ][ maybe ][ never ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; var btn3Text = "maybe"; - var btn3 = $"{d.LeftBracket} {btn3Text} {d.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} {btn3Text} {CM.Glyphs.RightBracket}"; var btn4Text = "never"; - var btn4 = $"{d.LeftBracket} {btn4Text} {d.RightBracket}"; + var btn4 = $"{CM.Glyphs.LeftBracket} {btn4Text} {CM.Glyphs.RightBracket}"; var buttonRow = string.Empty; var width = 30; d.SetBufferSize (width, 1); // Default - Center - buttonRow = $"{d.VLine}es ] {btn2} {btn3} [ neve{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}es {CM.Glyphs.RightBracket} {btn2} {btn3} {CM.Glyphs.LeftBracket} neve{CM.Glyphs.VLine}"; (runstate, var dlg) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Center, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); Assert.Equal (new Size (width, 1), dlg.Frame.Size); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Justify - buttonRow = $"{d.VLine}[ yes [ no [ maybe [ never ]{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{CM.Glyphs.LeftBracket} yes {CM.Glyphs.LeftBracket} no {CM.Glyphs.LeftBracket} maybe {CM.Glyphs.LeftBracket} never {CM.Glyphs.RightBracket}{CM.Glyphs.VLine}"; (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine}] {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{CM.Glyphs.RightBracket} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} [ n{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {CM.Glyphs.LeftBracket} n{CM.Glyphs.VLine}"; (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); } @@ -548,18 +548,18 @@ namespace Terminal.Gui.DialogTests { // E.g "|[ yes ][ no ][ maybe ]|" var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; var btn3Text = "你你你你你"; // This is a wide char - var btn3 = $"{d.LeftBracket} {btn3Text} {d.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} {btn3Text} {CM.Glyphs.RightBracket}"; // Requires a Nerd Font var btn4Text = "\uE36E\uE36F\uE370\uE371\uE372\uE373"; - var btn4 = $"{d.LeftBracket} {btn4Text} {d.RightBracket}"; + var btn4 = $"{CM.Glyphs.LeftBracket} {btn4Text} {CM.Glyphs.RightBracket}"; // Note extra spaces to make dialog even wider // 123456 123456 - var buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; var width = ustring.Make (buttonRow).ConsoleWidth; d.SetBufferSize (width, 3); @@ -569,21 +569,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -602,17 +602,17 @@ namespace Terminal.Gui.DialogTests { // E.g "|[ yes ][ no ][ maybe ]|" var btn1Text = "really long button 1"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "really long button 2"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; var btn3Text = "really long button 3"; - var btn3 = $"{d.LeftBracket} {btn3Text} {d.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} {btn3Text} {CM.Glyphs.RightBracket}"; var btn4Text = "really long button 44"; // 44 is intentional to make length different than rest - var btn4 = $"{d.LeftBracket} {btn4Text} {d.RightBracket}"; + var btn4 = $"{CM.Glyphs.LeftBracket} {btn4Text} {CM.Glyphs.RightBracket}"; // Note extra spaces to make dialog even wider // 123456 1234567 - var buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 1); @@ -622,21 +622,21 @@ namespace Terminal.Gui.DialogTests { Application.End (runstate); // Justify - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Right - buttonRow = $"{d.VLine} {btn1} {btn2} {btn3} {btn4}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); Application.End (runstate); // Left - buttonRow = $"{d.VLine}{btn1} {btn2} {btn3} {btn4} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}"; Assert.Equal (width, buttonRow.Length); (runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text)); TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); @@ -653,7 +653,7 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; - var buttonRow = $"{d.VLine} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 3); @@ -673,7 +673,7 @@ namespace Terminal.Gui.DialogTests { var title = ""; var btnText = "ok"; - var buttonRow = $"{d.VLine} {d.LeftBracket} {btnText} {d.RightBracket} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {CM.Glyphs.LeftBracket} {btnText} {CM.Glyphs.RightBracket} {CM.Glyphs.VLine}"; var width = buttonRow.Length; d.SetBufferSize (buttonRow.Length, 10); @@ -693,12 +693,12 @@ namespace Terminal.Gui.DialogTests { var title = "1234"; var btn1Text = "yes"; - var btn1 = $"{d.LeftBracket} {btn1Text} {d.RightBracket}"; + var btn1 = $"{CM.Glyphs.LeftBracket} {btn1Text} {CM.Glyphs.RightBracket}"; var btn2Text = "no"; - var btn2 = $"{d.LeftBracket} {btn2Text} {d.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} {btn2Text} {CM.Glyphs.RightBracket}"; // We test with one button first, but do this to get the width right for 2 - var width = $@"{d.VLine} {btn1} {btn2} {d.VLine}".Length; + var width = $@"{CM.Glyphs.VLine} {btn1} {btn2} {CM.Glyphs.VLine}".Length; d.SetBufferSize (width, 1); // Default (center) @@ -706,11 +706,11 @@ namespace Terminal.Gui.DialogTests { // Create with no top or bottom border to simplify testing button layout (no need to account for title etc..) dlg.Border.Thickness = new Thickness (1, 0, 1, 0); runstate = Application.Begin (dlg); - var buttonRow = $"{d.VLine} {btn1} {d.VLine}"; + var buttonRow = $"{CM.Glyphs.VLine} {btn1} {CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); // Now add a second button - buttonRow = $"{d.VLine} {btn1} {btn2} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {CM.Glyphs.VLine}"; dlg.AddButton (new Button (btn2Text)); bool first = false; Application.RunMainLoopIteration (ref runstate, true, ref first); @@ -722,11 +722,11 @@ namespace Terminal.Gui.DialogTests { // Create with no top or bottom border to simplify testing button layout (no need to account for title etc..) dlg.Border.Thickness = new Thickness (1, 0, 1, 0); runstate = Application.Begin (dlg); - buttonRow = $"{d.VLine} {btn1}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1}{CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); // Now add a second button - buttonRow = $"{d.VLine}{btn1} {btn2}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2}{CM.Glyphs.VLine}"; dlg.AddButton (new Button (btn2Text)); first = false; Application.RunMainLoopIteration (ref runstate, true, ref first); @@ -738,11 +738,11 @@ namespace Terminal.Gui.DialogTests { // Create with no top or bottom border to simplify testing button layout (no need to account for title etc..) dlg.Border.Thickness = new Thickness (1, 0, 1, 0); runstate = Application.Begin (dlg); - buttonRow = $"{d.VLine}{new string (' ', width - btn1.Length - 2)}{btn1}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{new string (' ', width - btn1.Length - 2)}{btn1}{CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); // Now add a second button - buttonRow = $"{d.VLine} {btn1} {btn2}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2}{CM.Glyphs.VLine}"; dlg.AddButton (new Button (btn2Text)); first = false; Application.RunMainLoopIteration (ref runstate, true, ref first); @@ -754,11 +754,11 @@ namespace Terminal.Gui.DialogTests { // Create with no top or bottom border to simplify testing button layout (no need to account for title etc..) dlg.Border.Thickness = new Thickness (1, 0, 1, 0); runstate = Application.Begin (dlg); - buttonRow = $"{d.VLine}{btn1}{new string (' ', width - btn1.Length - 2)}{d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1}{new string (' ', width - btn1.Length - 2)}{CM.Glyphs.VLine}"; TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output); // Now add a second button - buttonRow = $"{d.VLine}{btn1} {btn2} {d.VLine}"; + buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {CM.Glyphs.VLine}"; dlg.AddButton (new Button (btn2Text)); first = false; Application.RunMainLoopIteration (ref runstate, true, ref first); @@ -788,11 +788,12 @@ namespace Terminal.Gui.DialogTests { btn2 = new Button ("Show Sub"); btn3 = new Button ("Close"); btn3.Clicked += (s, e) => Application.RequestStop (); - btn2.Clicked += (s, e) => { MessageBox.Query (string.Empty, "ya", "ok"); }; + btn2.Clicked += (s, e) => { MessageBox.Query (string.Empty, "ya", "Ok"); }; var dlg = new Dialog (btn2, btn3); Application.Run (dlg); }; + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; var iterations = -1; Application.Iteration += () => { @@ -800,7 +801,7 @@ namespace Terminal.Gui.DialogTests { if (iterations == 0) { Assert.True (btn1.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ()))); } else if (iterations == 1) { - expected = @" + expected = @$" ┌──────────────────────────────────────────────────────────────────┐ │ │ │ │ @@ -820,13 +821,13 @@ namespace Terminal.Gui.DialogTests { │ │ │ │ │ │ - │ [ Show Sub ] [ Close ] │ + │ {CM.Glyphs.LeftBracket} Show Sub {CM.Glyphs.RightBracket} {CM.Glyphs.LeftBracket} Close {CM.Glyphs.RightBracket} │ └──────────────────────────────────────────────────────────────────┘"; TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Assert.True (btn2.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ()))); } else if (iterations == 2) { - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────────────────────────────────────────────────────┐ │ │ │ │ @@ -838,7 +839,7 @@ namespace Terminal.Gui.DialogTests { │ ┌──────────────────────────────────────────────┐ │ │ │ ya │ │ │ │ │ │ - │ │ [◦ ok ◦] │ │ + │ │ {btn} │ │ │ └──────────────────────────────────────────────┘ │ │ │ │ │ @@ -846,7 +847,7 @@ namespace Terminal.Gui.DialogTests { │ │ │ │ │ │ - │ [ Show Sub ] [ Close ] │ + │ {CM.Glyphs.LeftBracket} Show Sub {CM.Glyphs.RightBracket} {CM.Glyphs.LeftBracket} Close {CM.Glyphs.RightBracket} │ └──────────────────────────────────────────────────────────────────┘", output); Assert.True (Application.Current.ProcessKey (new KeyEvent (Key.Enter, new KeyModifiers ()))); @@ -880,16 +881,17 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } }; + var btn = $"{CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket}"; win.Loaded += (s, a) => { var dlg = new Dialog (new Button ("Ok")) { Width = 18, Height = 3 }; dlg.Loaded += (s, a) => { Application.Refresh (); - var expected = @" + var expected = @$" ┌──────────────────┐ │┌────────────────┐│ -││ [ Ok ] ││ +││ {btn} ││ │└────────────────┘│ └──────────────────┘"; _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); @@ -949,6 +951,7 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } }; + var b = $"{CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket}"; win.Loaded += (s, a) => { var dlg = new Dialog () { Width = 18, Height = 3 }; @@ -968,10 +971,10 @@ namespace Terminal.Gui.DialogTests { Application.Refresh (); Assert.Equal (new Rect (10, 0, 6, 1), btn.Frame); Assert.Equal (new Rect (0, 0, 6, 1), btn.Bounds); - var expected = @" + var expected = @$" ┌──────────────────┐ │┌────────────────┐│ -││23456789 [ Ok ]││ +││23456789 {b}││ │└────────────────┘│ └──────────────────┘"; _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); @@ -981,10 +984,10 @@ namespace Terminal.Gui.DialogTests { Application.Refresh (); Assert.Equal (new Rect (10, 0, 6, 1), btn.Frame); Assert.Equal (new Rect (0, 0, 6, 1), btn.Bounds); - expected = @" + expected = @$" ┌──────────────────┐ │┌────────────────┐│ -││23456789 [ Ok ]││ +││23456789 {b}││ │└────────────────┘│ └──────────────────┘"; _ = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); diff --git a/UnitTests/Dialogs/MessageBoxTests.cs b/UnitTests/Dialogs/MessageBoxTests.cs index cf9a4018b..1a7a1afbd 100644 --- a/UnitTests/Dialogs/MessageBoxTests.cs +++ b/UnitTests/Dialogs/MessageBoxTests.cs @@ -215,6 +215,7 @@ namespace Terminal.Gui.DialogTests { aboutMessage.AppendLine (@"0123456789012345678901234567890123456789"); aboutMessage.AppendLine (@"https://github.com/gui-cs/Terminal.Gui"); var message = aboutMessage.ToString (); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; ((FakeDriver)Application.Driver).SetBufferSize (40 + 4, 8); @@ -228,13 +229,13 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔══════════════════════════════════════════╗ ║┌────────────────────────────────────────┐║ ║│0123456789012345678901234567890123456789│║ ║│ https://github.com/gui-cs/Terminal.Gui │║ ║│ │║ -║│ [◦ Ok ◦] │║ +║│ {btn} │║ ║└────────────────────────────────────────┘║ ╚══════════════════════════════════════════╝ ", output); @@ -264,11 +265,11 @@ namespace Terminal.Gui.DialogTests { Assert.Equal (new Size (7, 5), Application.Current.Frame.Size); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌─────┐ │Messa│ │ ge │ - │ Ok ◦│ + │ Ok {CM.Glyphs.RightDefaultIndicator}│ └─────┘ ", output); @@ -284,6 +285,7 @@ namespace Terminal.Gui.DialogTests { { var iterations = -1; Application.Begin (Application.Top); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; Application.Iteration += () => { iterations++; @@ -294,11 +296,11 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌─────────┐ │ Message │ │ │ - │[◦ Ok ◦] │ + │{btn} │ └─────────┘ ", output); @@ -317,6 +319,7 @@ namespace Terminal.Gui.DialogTests { Application.Top.BorderStyle = LineStyle.Double; ((FakeDriver)Application.Driver).SetBufferSize (20, 10); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} btn {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; Application.Iteration += () => { iterations++; @@ -328,7 +331,7 @@ namespace Terminal.Gui.DialogTests { } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔══════════════════╗ ║┌────────────────┐║ ║│ffffffffffffffff│║ @@ -336,7 +339,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ ff │║ ║│ │║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ║└────────────────┘║ ╚══════════════════╝", output); Assert.Equal (new Size (20 - 2, 10 - 2), Application.Current.Frame.Size); @@ -346,7 +349,7 @@ namespace Terminal.Gui.DialogTests { MessageBox.Query (string.Empty, new string ('f', 500), defaultButton: 0, wrapMessage: true, "btn"); } else if (iterations == 2) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔┌────────────────┐╗ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ @@ -355,7 +358,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ╚└────────────────┘╝", output); Application.RequestStop (); } @@ -372,6 +375,8 @@ namespace Terminal.Gui.DialogTests { Application.Top.BorderStyle = LineStyle.Double; ((FakeDriver)Application.Driver).SetBufferSize (20, 10); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} btn {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; + Application.Iteration += () => { iterations++; @@ -385,7 +390,7 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔══════════════════╗ ║ ┌──────────────┐ ║ ║ │ff ff ff ff ff│ ║ @@ -393,7 +398,7 @@ namespace Terminal.Gui.DialogTests { ║ │ff ff ff ff ff│ ║ ║ │ ff ff │ ║ ║ │ │ ║ -║ │ [◦ btn ◦] │ ║ +║ │ {btn} │ ║ ║ └──────────────┘ ║ ╚══════════════════╝", output); Application.RequestStop (); @@ -402,7 +407,7 @@ namespace Terminal.Gui.DialogTests { MessageBox.Query (string.Empty, new string ('f', 500), defaultButton: 0, wrapMessage: true, "btn"); } else if (iterations == 2) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔┌────────────────┐╗ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ @@ -411,7 +416,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ╚└────────────────┘╝", output); Application.RequestStop (); } @@ -428,6 +433,8 @@ namespace Terminal.Gui.DialogTests { Application.Top.BorderStyle = LineStyle.Double; ((FakeDriver)Application.Driver).SetBufferSize (20, 10); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} btn {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; + Application.Iteration += () => { iterations++; @@ -437,7 +444,7 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔══════════════════╗ ║┌────────────────┐║ ║│ffffffffffffffff│║ @@ -445,7 +452,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ ff │║ ║│ │║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ║└────────────────┘║ ╚══════════════════╝", output); @@ -455,7 +462,7 @@ namespace Terminal.Gui.DialogTests { MessageBox.Query (string.Empty, new string ('f', 500), defaultButton: 0, wrapMessage: true, "btn"); } else if (iterations == 2) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔┌────────────────┐╗ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ @@ -464,7 +471,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ╚└────────────────┘╝", output); Application.RequestStop (); @@ -481,6 +488,7 @@ namespace Terminal.Gui.DialogTests { Application.Begin (Application.Top); Application.Top.BorderStyle = LineStyle.Double; ((FakeDriver)Application.Driver).SetBufferSize (20, 10); + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} btn {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; Application.Iteration += () => { iterations++; @@ -495,7 +503,7 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔══════════════════╗ ║ ┌──────────────┐ ║ ║ │ff ff ff ff ff│ ║ @@ -503,7 +511,7 @@ namespace Terminal.Gui.DialogTests { ║ │ff ff ff ff ff│ ║ ║ │ ff ff │ ║ ║ │ │ ║ -║ │ [◦ btn ◦] │ ║ +║ │ {btn} │ ║ ║ └──────────────┘ ║ ╚══════════════════╝", output); Application.RequestStop (); @@ -512,7 +520,7 @@ namespace Terminal.Gui.DialogTests { MessageBox.Query (string.Empty, new string ('f', 500), defaultButton: 0, wrapMessage: false, "btn"); } else if (iterations == 2) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ╔┌────────────────┐╗ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ @@ -521,7 +529,7 @@ namespace Terminal.Gui.DialogTests { ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ ║│ffffffffffffffff│║ -║│ [◦ btn ◦] │║ +║│ {btn} │║ ╚└────────────────┘╝", output); Application.RequestStop (); } @@ -553,13 +561,12 @@ namespace Terminal.Gui.DialogTests { Application.RequestStop (); } else if (iterations == 1) { Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────────────────────────────────┐ │ │ │ │ - │ [◦ ok ◦] │ + │ {CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket} │ └──────────────────────────────────────────────┘", output); - Application.RequestStop (); } }; diff --git a/UnitTests/Dialogs/WizardTests.cs b/UnitTests/Dialogs/WizardTests.cs index 29ac370f6..0c133c7ba 100644 --- a/UnitTests/Dialogs/WizardTests.cs +++ b/UnitTests/Dialogs/WizardTests.cs @@ -114,16 +114,16 @@ namespace Terminal.Gui.DialogTests { d.SetBufferSize (width, height); var btnBackText = "Back"; - var btnBack = $"{d.LeftBracket} {btnBackText} {d.RightBracket}"; + var btnBack = $"{CM.Glyphs.LeftBracket} {btnBackText} {CM.Glyphs.RightBracket}"; var btnNextText = "Finish"; - var btnNext = $"{d.LeftBracket}{d.LeftDefaultIndicator} {btnNextText} {d.RightDefaultIndicator}{d.RightBracket}"; + var btnNext = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} {btnNextText} {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; - var topRow = $"{d.ULDbCorner}╡{title}{stepTitle}╞{new string (d.HDbLine.ToString () [0], width - title.Length - stepTitle.Length - 4)}{d.URDbCorner}"; - var row2 = $"{d.VDbLine}{new string (' ', width - 2)}{d.VDbLine}"; + var topRow = $"{CM.Glyphs.ULCornerDbl}╡{title}{stepTitle}╞{new string (CM.Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)}{CM.Glyphs.URCornerDbl}"; + var row2 = $"{CM.Glyphs.VLineDbl}{new string (' ', width - 2)}{CM.Glyphs.VLineDbl}"; var row3 = row2; - var separatorRow = $"{d.VDbLine}{new string (d.HLine.ToString () [0], width - 2)}{d.VDbLine}"; - var buttonRow = $"{d.VDbLine}{btnBack}{new string (' ', width - btnBack.Length - btnNext.Length - 2)}{btnNext}{d.VDbLine}"; - var bottomRow = $"{d.LLDbCorner}{new string (d.HDbLine.ToString () [0], width - 2)}{d.LRDbCorner}"; + var separatorRow = $"{CM.Glyphs.VLineDbl}{new string (CM.Glyphs.HLine.ToString () [0], width - 2)}{CM.Glyphs.VLineDbl}"; + var buttonRow = $"{CM.Glyphs.VLineDbl}{btnBack}{new string (' ', width - btnBack.Length - btnNext.Length - 2)}{btnNext}{CM.Glyphs.VLineDbl}"; + var bottomRow = $"{CM.Glyphs.LLCornerDbl}{new string (CM.Glyphs.HLineDbl.ToString () [0], width - 2)}{CM.Glyphs.LRCornerDbl}"; var wizard = new Wizard () { Title = title, Width = width, Height = height }; var runstate = Application.Begin (wizard); @@ -146,17 +146,17 @@ namespace Terminal.Gui.DialogTests { d.SetBufferSize (width, height); // var btnBackText = "Back"; - var btnBack = string.Empty; // $"{d.LeftBracket} {btnBackText} {d.RightBracket}"; + var btnBack = string.Empty; // $"{CM.Glyphs.LeftBracket} {btnBackText} {CM.Glyphs.RightBracket}"; var btnNextText = "Finish"; // "Next"; - var btnNext = $"{d.LeftBracket}{d.LeftDefaultIndicator} {btnNextText} {d.RightDefaultIndicator}{d.RightBracket}"; + var btnNext = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} {btnNextText} {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; - var topRow = $"{d.ULDbCorner}╡{title} - {stepTitle}╞{new string (d.HDbLine.ToString () [0], width - title.Length - stepTitle.Length - 7)}{d.URDbCorner}"; - var row2 = $"{d.VDbLine}{new string (' ', width - 2)}{d.VDbLine}"; + var topRow = $"{CM.Glyphs.ULCornerDbl}╡{title} - {stepTitle}╞{new string (CM.Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 7)}{CM.Glyphs.URCornerDbl}"; + var row2 = $"{CM.Glyphs.VLineDbl}{new string (' ', width - 2)}{CM.Glyphs.VLineDbl}"; var row3 = row2; var row4 = row3; - var separatorRow = $"{d.VDbLine}{new string (d.HLine.ToString () [0], width - 2)}{d.VDbLine}"; - var buttonRow = $"{d.VDbLine}{btnBack}{new string (' ', width - btnBack.Length - btnNext.Length - 2)}{btnNext}{d.VDbLine}"; - var bottomRow = $"{d.LLDbCorner}{new string (d.HDbLine.ToString () [0], width - 2)}{d.LRDbCorner}"; + var separatorRow = $"{CM.Glyphs.VLineDbl}{new string (CM.Glyphs.HLine.ToString () [0], width - 2)}{CM.Glyphs.VLineDbl}"; + var buttonRow = $"{CM.Glyphs.VLineDbl}{btnBack}{new string (' ', width - btnBack.Length - btnNext.Length - 2)}{btnNext}{CM.Glyphs.VLineDbl}"; + var bottomRow = $"{CM.Glyphs.LLCornerDbl}{new string (CM.Glyphs.HLineDbl.ToString () [0], width - 2)}{CM.Glyphs.LRCornerDbl}"; var wizard = new Wizard () { Title = title, Width = width, Height = height }; wizard.AddStep (new Wizard.WizardStep () { Title = stepTitle }); @@ -218,15 +218,15 @@ namespace Terminal.Gui.DialogTests { d.SetBufferSize (width, height); var btnNextText = "Finish"; - var btnNext = $"{d.LeftBracket}{d.LeftDefaultIndicator} {btnNextText} {d.RightDefaultIndicator}{d.RightBracket}"; + var btnNext = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} {btnNextText} {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; - var topRow = $"{d.ULDbCorner}╡{title}{stepTitle}╞{new string (d.HDbLine.ToString () [0], width - title.Length - stepTitle.Length - 4)}{d.URDbCorner}"; - var separatorRow = $"{d.VDbLine}{new string (d.HLine.ToString () [0], width - 2)}{d.VDbLine}"; + var topRow = $"{CM.Glyphs.ULCornerDbl}╡{title}{stepTitle}╞{new string (CM.Glyphs.HLineDbl.ToString () [0], width - title.Length - stepTitle.Length - 4)}{CM.Glyphs.URCornerDbl}"; + var separatorRow = $"{CM.Glyphs.VLineDbl}{new string (CM.Glyphs.HLine.ToString () [0], width - 2)}{CM.Glyphs.VLineDbl}"; // Once this is fixed, revert to commented out line: https://github.com/gui-cs/Terminal.Gui/issues/1791 - var buttonRow = $"{d.VDbLine}{new string (' ', width - btnNext.Length - 2)}{btnNext}{d.VDbLine}"; - //var buttonRow = $"{d.VDLine}{new String (' ', width - btnNext.Length - 2)}{btnNext}{d.VDLine}"; - var bottomRow = $"{d.LLDbCorner}{new string (d.HDbLine.ToString () [0], width - 2)}{d.LRDbCorner}"; + var buttonRow = $"{CM.Glyphs.VLineDbl}{new string (' ', width - btnNext.Length - 2)}{btnNext}{CM.Glyphs.VLineDbl}"; + //var buttonRow = $"{CM.Glyphs.VDLine}{new String (' ', width - btnNext.Length - 2)}{btnNext}{CM.Glyphs.VDLine}"; + var bottomRow = $"{CM.Glyphs.LLCornerDbl}{new string (CM.Glyphs.HLineDbl.ToString () [0], width - 2)}{CM.Glyphs.LRCornerDbl}"; var wizard = new Wizard () { Title = title, Width = width, Height = height }; wizard.AddStep (new Wizard.WizardStep () { Title = "ABCD" }); diff --git a/UnitTests/FileServices/FileDialogTests.cs b/UnitTests/FileServices/FileDialogTests.cs index aa0f8ea16..9646bf63e 100644 --- a/UnitTests/FileServices/FileDialogTests.cs +++ b/UnitTests/FileServices/FileDialogTests.cs @@ -384,10 +384,10 @@ namespace Terminal.Gui.FileServicesTests { fd.Draw (); string expected = - @" + @$" ┌──────────────────────────────────────────────────────────────────┐ │/demo/ │ - │[▲] │ +│{CM.Glyphs.LeftBracket}▲{CM.Glyphs.RightBracket} │ │┌────────────┬──────────┬──────────────────────────────┬─────────┐│ ││Filename (▲)│Size │Modified │Type ││ │├────────────┼──────────┼──────────────────────────────┼─────────┤│ @@ -398,7 +398,7 @@ namespace Terminal.Gui.FileServicesTests { │ │ │ │ │ │ - │[ ►► ] Enter Search [ Cancel ] [ Ok ] │ +│{CM.Glyphs.LeftBracket} ►► {CM.Glyphs.RightBracket} Enter Search {CM.Glyphs.LeftBracket} Cancel {CM.Glyphs.RightBracket} {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ └──────────────────────────────────────────────────────────────────┘ "; TestHelpers.AssertDriverContentsAre (expected, output, true); @@ -420,10 +420,10 @@ namespace Terminal.Gui.FileServicesTests { string expected = - @" + @$" ┌──────────────────────────────────────────────────────────────────┐ │c:\demo\ │ -│[▲] │ +│{CM.Glyphs.LeftBracket}▲{CM.Glyphs.RightBracket} │ │┌────────────┬──────────┬──────────────────────────────┬─────────┐│ ││Filename (▲)│Size │Modified │Type ││ │├────────────┼──────────┼──────────────────────────────┼─────────┤│ @@ -434,7 +434,7 @@ namespace Terminal.Gui.FileServicesTests { ││mybinary.exe│7.00 bytes│2001-01-01T11:44:42 │.exe ││ │ │ │ │ -│[ ►► ] Enter Search [ Cancel ] [ Ok ] │ +│{CM.Glyphs.LeftBracket} ►► {CM.Glyphs.RightBracket} Enter Search {CM.Glyphs.LeftBracket} Cancel {CM.Glyphs.RightBracket} {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ └──────────────────────────────────────────────────────────────────┘ "; TestHelpers.AssertDriverContentsAre (expected, output, true); diff --git a/UnitTests/Text/TextFormatterTests.cs b/UnitTests/Text/TextFormatterTests.cs index dd13f278a..d95cb2ca5 100644 --- a/UnitTests/Text/TextFormatterTests.cs +++ b/UnitTests/Text/TextFormatterTests.cs @@ -3789,7 +3789,7 @@ namespace Terminal.Gui.TextTests { Assert.Equal (6, TextFormatter.GetLengthThatFits (runes, 6)); runes = ustring.Make ("こんにちは 世界").ToRuneList (); Assert.Equal (3, TextFormatter.GetLengthThatFits (runes, 6)); - runes = ustring.Make ("[ Say Hello 你 ]").ToRuneList (); + runes = ustring.Make ($"{CM.Glyphs.LeftBracket} Say Hello 你 {CM.Glyphs.RightBracket}").ToRuneList (); Assert.Equal (15, TextFormatter.GetLengthThatFits (runes, 16)); } diff --git a/UnitTests/Text/UnicodeTests.cs b/UnitTests/Text/UnicodeTests.cs index 5292875d0..09aac7fd6 100644 --- a/UnitTests/Text/UnicodeTests.cs +++ b/UnitTests/Text/UnicodeTests.cs @@ -67,13 +67,13 @@ namespace Terminal.Gui.TextTests { Application.Begin (dg); ((FakeDriver)Application.Driver).SetBufferSize (30, 10); - var expected = @" + var expected = @$" ┌────────────────────────────┐ │これは広いルーンラインです。│ │これは広いルーンラインです。│ │これは ┌────────────┐ です。│ │これは │ワイドルーン│ です。│ -│これは │ [ 選ぶ ] │ です。│ +│これは │ {CM.Glyphs.LeftBracket} 選ぶ {CM.Glyphs.RightBracket} │ です。│ │これは └────────────┘ です。│ │これは広いルーンラインです。│ │これは広いルーンラインです。│ diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index e2b3f78d2..b2907d091 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -41,7 +41,7 @@ - True + False [UICatalog]* diff --git a/UnitTests/View/Layout/LayoutTests.cs b/UnitTests/View/Layout/LayoutTests.cs index 03d5258ef..410f579f8 100644 --- a/UnitTests/View/Layout/LayoutTests.cs +++ b/UnitTests/View/Layout/LayoutTests.cs @@ -1092,10 +1092,10 @@ Y [Fact, AutoInitShutdown] public void AutoSize_Stays_True_Center_HotKeySpecifier () { - var btn = new Button () { + var label = new Label () { X = Pos.Center (), Y = Pos.Center (), - Text = "Say He_llo 你" + Text = "Say Hello 你" }; var win = new Window () { @@ -1103,31 +1103,31 @@ Y Height = Dim.Fill (), Title = "Test Demo 你" }; - win.Add (btn); + win.Add (label); Application.Top.Add (win); - Assert.True (btn.AutoSize); + Assert.True (label.AutoSize); Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ [ Say Hello 你 ] │ +│ Say Hello 你 │ │ │ └────────────────────────────┘ "; TestHelpers.AssertDriverContentsWithFrameAre (expected, output); - Assert.True (btn.AutoSize); - btn.Text = "Say He_llo 你 changed"; - Assert.True (btn.AutoSize); + Assert.True (label.AutoSize); + label.Text = "Say Hello 你 changed"; + Assert.True (label.AutoSize); Application.Refresh (); expected = @" ┌┤Test Demo 你├──────────────┐ │ │ -│ [ Say Hello 你 changed ] │ +│ Say Hello 你 changed │ │ │ └────────────────────────────┘ "; @@ -1810,15 +1810,15 @@ Y var clicked = false; var top = Application.Top; var win1 = new Window () { Id = "win1", Width = 20, Height = 10 }; - var btn = new Button ("ok"); - var win2 = new Window () { Id = "win2", Y = Pos.Bottom (btn) + 1, Width = 10, Height = 3 }; + var label= new Label ("[ ok ]"); + var win2 = new Window () { Id = "win2", Y = Pos.Bottom (label) + 1, Width = 10, Height = 3 }; var view1 = new View () { Id = "view1", Width = Dim.Fill (), Height = 1, CanFocus = true }; view1.MouseClick += (sender, e) => clicked = true; var view2 = new View () { Id = "view2", Width = Dim.Fill (1), Height = 1, CanFocus = true }; view1.Add (view2); win2.Add (view1); - win1.Add (btn, win2); + win1.Add (label, win2); top.Add (win1); var rs = Application.Begin (top); @@ -1835,7 +1835,7 @@ Y │ │ └──────────────────┘", output); Assert.Equal (new Rect (0, 0, 80, 25), top.Frame); - Assert.Equal (new Rect (0, 0, 6, 1), btn.Frame); + Assert.Equal (new Rect (0, 0, 6, 1), label.Frame); Assert.Equal (new Rect (0, 0, 20, 10), win1.Frame); Assert.Equal (new Rect (0, 2, 10, 3), win2.Frame); Assert.Equal (new Rect (0, 0, 8, 1), view1.Frame); diff --git a/UnitTests/View/ViewTests.cs b/UnitTests/View/ViewTests.cs index 138bf61d4..39301c54e 100644 --- a/UnitTests/View/ViewTests.cs +++ b/UnitTests/View/ViewTests.cs @@ -1430,11 +1430,11 @@ At 0,0 frame.Frame.Right, frame.Frame.Bottom)); Assert.Equal (new Rect (0, 0, 38, 1), label.Frame); Assert.Equal (new Rect (12, 2, 13, 1), button.Frame); - var expected = @" + var expected = @$" ┌──────────────────────────────────────┐ │ This should be the first line. │ │ │ - │ [ Press me! ] │ + │ {CM.Glyphs.LeftBracket} Press me! {CM.Glyphs.RightBracket} │ │ │ │ │ │ │ diff --git a/UnitTests/Views/ButtonTests.cs b/UnitTests/Views/ButtonTests.cs index 390632ebb..8e5973b1d 100644 --- a/UnitTests/Views/ButtonTests.cs +++ b/UnitTests/Views/ButtonTests.cs @@ -19,7 +19,7 @@ namespace Terminal.Gui.ViewsTests { Application.Top.Add (btn); var rs = Application.Begin (Application.Top); - Assert.Equal ("[ ]", btn.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.LeftBracket} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text); Assert.False (btn.IsDefault); Assert.Equal (TextAlignment.Centered, btn.TextAlignment); Assert.Equal ('_', btn.HotKeySpecifier); @@ -27,8 +27,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (new Rect (0, 0, 4, 1), btn.Bounds); Assert.Equal (new Rect (0, 0, 4, 1), btn.Frame); Assert.Equal (Key.Null, btn.HotKey); - var expected = @" -[ ] + var expected = @$" +{CM.Glyphs.LeftBracket} {CM.Glyphs.RightBracket} "; TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); @@ -38,7 +38,7 @@ namespace Terminal.Gui.ViewsTests { Application.Top.Add (btn); rs = Application.Begin (Application.Top); - Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Test {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}", btn.TextFormatter.Text); Assert.True (btn.IsDefault); Assert.Equal (TextAlignment.Centered, btn.TextAlignment); Assert.Equal ('_', btn.HotKeySpecifier); @@ -46,10 +46,6 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (new Rect (0, 0, 10, 1), btn.Bounds); Assert.Equal (new Rect (0, 0, 10, 1), btn.Frame); Assert.Equal (Key.T, btn.HotKey); - expected = @" -[◦ Test ◦] -"; - TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); btn = new Button (3, 4, "Test", true); @@ -57,7 +53,7 @@ namespace Terminal.Gui.ViewsTests { Application.Top.Add (btn); rs = Application.Begin (Application.Top); - Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Test {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}", btn.TextFormatter.Text); Assert.True (btn.IsDefault); Assert.Equal (TextAlignment.Centered, btn.TextAlignment); Assert.Equal ('_', btn.HotKeySpecifier); @@ -65,10 +61,6 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (new Rect (0, 0, 10, 1), btn.Bounds); Assert.Equal (new Rect (3, 4, 10, 1), btn.Frame); Assert.Equal (Key.T, btn.HotKey); - expected = @" - [◦ Test ◦] -"; - TestHelpers.AssertDriverContentsWithFrameAre (expected, output); Application.End (rs); } @@ -231,13 +223,13 @@ namespace Terminal.Gui.ViewsTests { Assert.True (btn.IsInitialized); Assert.Equal ("Say Hello 你", btn.Text); - Assert.Equal ("[ Say Hello 你 ]", btn.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text); Assert.Equal (new Rect (0, 0, 16, 1), btn.Bounds); - - var expected = @" + var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}"; + var expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 ] │ +│ {btnTxt} │ │ │ └────────────────────────────┘ "; @@ -268,13 +260,13 @@ namespace Terminal.Gui.ViewsTests { Assert.True (btn.IsInitialized); Assert.Equal ("Say Hello 你", btn.Text); - Assert.Equal ("[ Say Hello 你 ]", btn.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}", btn.TextFormatter.Text); Assert.Equal (new Rect (0, 0, 16, 1), btn.Bounds); - - var expected = @" + var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}"; + var expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 ] │ +│ {btnTxt} │ │ │ └────────────────────────────┘ "; @@ -307,10 +299,10 @@ namespace Terminal.Gui.ViewsTests { Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 ] │ +│ {CM.Glyphs.LeftBracket} Say Hello 你 {CM.Glyphs.RightBracket} │ │ │ └────────────────────────────┘ "; @@ -338,10 +330,10 @@ namespace Terminal.Gui.ViewsTests { Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 ] │ +│ {CM.Glyphs.LeftBracket} Say Hello 你 {CM.Glyphs.RightBracket} │ │ │ └────────────────────────────┘ "; @@ -352,10 +344,10 @@ namespace Terminal.Gui.ViewsTests { btn.Text = "Say Hello 你 changed"; Assert.True (btn.AutoSize); Application.Refresh (); - expected = @" + expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 changed ] │ +│ {CM.Glyphs.LeftBracket} Say Hello 你 changed {CM.Glyphs.RightBracket} │ │ │ └────────────────────────────┘ "; @@ -371,6 +363,8 @@ namespace Terminal.Gui.ViewsTests { Text = "Say Hello 你", AutoSize = true }; + var btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}"; + btn.X = Pos.AnchorEnd () - Pos.Function (() => TextFormatter.GetTextWidth (btn.TextFormatter.Text)); var win = new Window () { @@ -384,10 +378,10 @@ namespace Terminal.Gui.ViewsTests { Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 ]│ +│ {btnTxt}│ │ │ └────────────────────────────┘ "; @@ -396,12 +390,13 @@ namespace Terminal.Gui.ViewsTests { Assert.True (btn.AutoSize); btn.Text = "Say Hello 你 changed"; + btnTxt = $"{CM.Glyphs.LeftBracket} {btn.Text} {CM.Glyphs.RightBracket}"; Assert.True (btn.AutoSize); Application.Refresh (); - expected = @" + expected = @$" ┌────────────────────────────┐ │ │ -│ [ Say Hello 你 changed ]│ +│ {btnTxt}│ │ │ └────────────────────────────┘ "; @@ -509,16 +504,19 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (new Rect (30, 4, 20, 1), btnCancel.Frame); Assert.Equal (new Rect (0, 3, 12, 1), ckbMatchCase.Frame); Assert.Equal (new Rect (0, 4, 18, 1), ckbMatchWholeWord.Frame); - var expected = @" + var btn1 = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Find Next {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; + var btn2 = $"{CM.Glyphs.LeftBracket} Find Previous {CM.Glyphs.RightBracket}"; + var btn3 = $"{CM.Glyphs.LeftBracket} Cancel {CM.Glyphs.RightBracket}"; + var expected = @$" ┌────────────────────────────────────────────────────┐ │┌────┐ │ ││Find│ │ ││ └─────────────────────────────────────────────┐│ ││ ││ -││ Find: Testing buttons. [◦ Find Next ◦] ││ -││ [ Find Previous ] ││ -││√ Match case ││ -││╴ Match whole word [ Cancel ] ││ +││ Find: Testing buttons. {btn1} ││ +││ {btn2} ││ +││{CM.Glyphs.Checked} Match case ││ +││{CM.Glyphs.UnChecked} Match whole word {btn3} ││ │└──────────────────────────────────────────────────┘│ └────────────────────────────────────────────────────┘ "; @@ -545,10 +543,12 @@ namespace Terminal.Gui.ViewsTests { ((FakeDriver)Application.Driver).SetBufferSize (30, 5); Assert.True (button.AutoSize); Assert.Equal (new Rect (5, 1, 18, 1), button.Frame); - var expected = @" + var btn = $"{CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Process keys {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket}"; + + var expected = @$" ┌────────────────────────────┐ │ │ -│ [◦ Process keys ◦] │ +│ {btn} │ │ │ └────────────────────────────┘ "; @@ -577,10 +577,10 @@ namespace Terminal.Gui.ViewsTests { ((FakeDriver)Application.Driver).SetBufferSize (30, 5); Assert.False (button.AutoSize); Assert.Equal (new Rect (4, 1, 20, 1), button.Frame); - var expected = @" + var expected = @$" ┌────────────────────────────┐ │ │ -│ [◦ Process keys ◦] │ +│ {CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Process keys {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket} │ │ │ └────────────────────────────┘ "; diff --git a/UnitTests/Views/CheckBoxTests.cs b/UnitTests/Views/CheckBoxTests.cs index 48a99b3e6..33da5978f 100644 --- a/UnitTests/Views/CheckBoxTests.cs +++ b/UnitTests/Views/CheckBoxTests.cs @@ -23,7 +23,7 @@ namespace Terminal.Gui.ViewsTests { Assert.False (ckb.Checked); Assert.False (ckb.AllowNullChecked); Assert.Equal (string.Empty, ckb.Text); - Assert.Equal ("╴ ", ckb.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.UnChecked} ", ckb.TextFormatter.Text); Assert.True (ckb.CanFocus); Assert.Equal (new Rect (0, 0, 2, 1), ckb.Frame); @@ -32,7 +32,7 @@ namespace Terminal.Gui.ViewsTests { Assert.True (ckb.Checked); Assert.False (ckb.AllowNullChecked); Assert.Equal ("Test", ckb.Text); - Assert.Equal ("√ Test", ckb.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text); Assert.True (ckb.CanFocus); Assert.Equal (new Rect (0, 0, 6, 1), ckb.Frame); @@ -41,7 +41,7 @@ namespace Terminal.Gui.ViewsTests { Assert.False (ckb.Checked); Assert.False (ckb.AllowNullChecked); Assert.Equal ("Test", ckb.Text); - Assert.Equal ("╴ Test", ckb.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.UnChecked} Test", ckb.TextFormatter.Text); Assert.True (ckb.CanFocus); Assert.Equal (new Rect (1, 2, 6, 1), ckb.Frame); @@ -50,7 +50,7 @@ namespace Terminal.Gui.ViewsTests { Assert.True (ckb.Checked); Assert.False (ckb.AllowNullChecked); Assert.Equal ("Test", ckb.Text); - Assert.Equal ("√ Test", ckb.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text); Assert.True (ckb.CanFocus); Assert.Equal (new Rect (3, 4, 6, 1), ckb.Frame); } @@ -84,8 +84,8 @@ namespace Terminal.Gui.ViewsTests { Application.Refresh (); - var expected = @" -√ Test + var expected = @$" +{CM.Glyphs.Checked} Test "; var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); @@ -116,54 +116,16 @@ namespace Terminal.Gui.ViewsTests { Assert.True (checkBox.IsInitialized); Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame); Assert.Equal ("Check this out 你", checkBox.Text); - Assert.Equal ("╴ Check this out 你", checkBox.TextFormatter.Text); + Assert.Equal ($"{CM.Glyphs.UnChecked} Check this out 你", checkBox.TextFormatter.Text); Assert.True (checkBox.AutoSize); - var expected = @" -┌┤Test Demo 你├──────────────┐ -│ │ -│ ╴ Check this out 你 │ -│ │ -└────────────────────────────┘ -"; - - // Positive test - var pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); - Assert.Equal (new Rect (0, 0, 30, 5), pos); - - // Also Positive test - checkBox.AutoSize = true; - bool first = false; - Application.RunMainLoopIteration (ref runstate, true, ref first); - Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame); - expected = @" -┌┤Test Demo 你├──────────────┐ -│ │ -│ ╴ Check this out 你 │ -│ │ -└────────────────────────────┘ -"; - - TestHelpers.AssertDriverContentsWithFrameAre (expected, output); - Assert.Equal (new Rect (0, 0, 30, 5), pos); checkBox.Checked = true; - Application.RunMainLoopIteration (ref runstate, true, ref first); - Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame); - expected = @" -┌┤Test Demo 你├──────────────┐ -│ │ -│ √ Check this out 你 │ -│ │ -└────────────────────────────┘ -"; + Assert.Equal ($"{CM.Glyphs.Checked} Check this out 你", checkBox.TextFormatter.Text); - pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, output); - Assert.Equal (new Rect (0, 0, 30, 5), pos); - - checkBox.AutoSize = false; + //checkBox.AutoSize = false; // It isn't auto-size so the height is guaranteed by the SetMinWidthHeight - checkBox.Text = "Check this out 你 changed"; - Application.RunMainLoopIteration (ref runstate, true, ref first); + //checkBox.Text = "Check this out 你 changed"; + //Application.RunMainLoopIteration (ref runstate, true, ref first); // BUGBUG - v2 - Autosize is busted; disabling tests for now // Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame); // expected = @" @@ -233,14 +195,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (TextAlignment.Left, checkBox.TextAlignment); Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame); Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size); - Assert.Equal ("Check this out 你", checkBox.Text); - Assert.Equal ("╴ Check this out 你", checkBox.TextFormatter.Text); - Assert.False (checkBox.AutoSize); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你 │ +│ {CM.Glyphs.UnChecked} Check this out 你 │ │ │ └────────────────────────────┘ "; @@ -250,10 +209,10 @@ namespace Terminal.Gui.ViewsTests { checkBox.Checked = true; Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ √ Check this out 你 │ +│ {CM.Glyphs.Checked} Check this out 你 │ │ │ └────────────────────────────┘ "; @@ -287,14 +246,12 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (TextAlignment.Centered, checkBox.TextAlignment); Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame); Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size); - Assert.Equal ("Check this out 你", checkBox.Text); - Assert.Equal ("╴ Check this out 你", checkBox.TextFormatter.Text); Assert.False (checkBox.AutoSize); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你 │ +│ {CM.Glyphs.UnChecked} Check this out 你 │ │ │ └────────────────────────────┘ "; @@ -304,10 +261,10 @@ namespace Terminal.Gui.ViewsTests { checkBox.Checked = true; Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ √ Check this out 你 │ +│ {CM.Glyphs.Checked} Check this out 你 │ │ │ └────────────────────────────┘ "; @@ -349,21 +306,15 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (TextAlignment.Justified, checkBox1.TextAlignment); Assert.Equal (new Rect (1, 1, 25, 1), checkBox1.Frame); Assert.Equal (new Size (25, 1), checkBox1.TextFormatter.Size); - Assert.Equal ("Check first out 你", checkBox1.Text); - Assert.Equal ("╴ Check first out 你", checkBox1.TextFormatter.Text); - Assert.False (checkBox1.AutoSize); Assert.Equal (TextAlignment.Justified, checkBox2.TextAlignment); Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame); Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size); - Assert.Equal ("Check second out 你", checkBox2.Text); - Assert.Equal ("╴ Check second out 你", checkBox2.TextFormatter.Text); - Assert.False (checkBox2.AutoSize); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check first out 你 │ -│ ╴ Check second out 你 │ +│ {CM.Glyphs.UnChecked} Check first out 你 │ +│ {CM.Glyphs.UnChecked} Check second out 你 │ │ │ └────────────────────────────┘ "; @@ -378,11 +329,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame); //Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size); Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ √ Check first out 你 │ -│ √ Check second out 你 │ +│ {CM.Glyphs.Checked} Check first out 你 │ +│ {CM.Glyphs.Checked} Check second out 你 │ │ │ └────────────────────────────┘ "; @@ -416,14 +367,12 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (TextAlignment.Right, checkBox.TextAlignment); Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame); Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size); - Assert.Equal ("Check this out 你", checkBox.Text); - Assert.Equal ("Check this out 你 ╴", checkBox.TextFormatter.Text); Assert.False (checkBox.AutoSize); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ Check this out 你 ╴ │ +│ Check this out 你 {CM.Glyphs.UnChecked} │ │ │ └────────────────────────────┘ "; @@ -433,10 +382,10 @@ namespace Terminal.Gui.ViewsTests { checkBox.Checked = true; Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ Check this out 你 √ │ +│ Check this out 你 {CM.Glyphs.Checked} │ │ │ └────────────────────────────┘ "; @@ -466,10 +415,10 @@ namespace Terminal.Gui.ViewsTests { Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你│ +│ {CM.Glyphs.UnChecked} Check this out 你│ │ │ └────────────────────────────┘ "; @@ -480,10 +429,10 @@ namespace Terminal.Gui.ViewsTests { checkBox.Text = "Check this out 你 changed"; Assert.True (checkBox.AutoSize); Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你 changed│ +│ {CM.Glyphs.UnChecked} Check this out 你 changed│ │ │ └────────────────────────────┘ "; @@ -512,10 +461,10 @@ namespace Terminal.Gui.ViewsTests { Application.Begin (Application.Top); ((FakeDriver)Application.Driver).SetBufferSize (30, 5); - var expected = @" + var expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你│ +│ {CM.Glyphs.UnChecked} Check this out 你│ │ │ └────────────────────────────┘ "; @@ -526,10 +475,10 @@ namespace Terminal.Gui.ViewsTests { checkBox.Text = "Check this out 你 changed"; Assert.True (checkBox.AutoSize); Application.Refresh (); - expected = @" + expected = @$" ┌┤Test Demo 你├──────────────┐ │ │ -│ ╴ Check this out 你 changed│ +│ {CM.Glyphs.UnChecked} Check this out 你 changed│ │ │ └────────────────────────────┘ "; @@ -555,8 +504,8 @@ namespace Terminal.Gui.ViewsTests { Assert.True (checkBox.ProcessKey (new KeyEvent (Key.Space, new KeyModifiers ()))); Assert.Null (checkBox.Checked); Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" -⍰ Check this out 你", output); + TestHelpers.AssertDriverContentsWithFrameAre (@$" +{CM.Glyphs.NullChecked} Check this out 你", output); Assert.True (checkBox.MouseEvent (new MouseEvent () { X = 0, Y = 0, Flags = MouseFlags.Button1Clicked })); Assert.True (checkBox.Checked); Assert.True (checkBox.ProcessKey (new KeyEvent (Key.Space, new KeyModifiers ()))); diff --git a/UnitTests/Views/GraphViewTests.cs b/UnitTests/Views/GraphViewTests.cs index 10a77ed92..a4e780483 100644 --- a/UnitTests/Views/GraphViewTests.cs +++ b/UnitTests/Views/GraphViewTests.cs @@ -1236,9 +1236,9 @@ namespace Terminal.Gui.ViewsTests { gv.Draw (); var expected = -@" +@$" │ - ┤ x + ┤ {CM.Glyphs.Dot} ┤ 0┼┬┬┬┬┬┬┬┬ 0 5"; @@ -1378,11 +1378,11 @@ namespace Terminal.Gui.ViewsTests { gv.Draw (); var expected = -@" +@$" │ -1┤x +1┤{CM.Glyphs.Dot} │ -0┼┬┬┬┬x┬┬┬ +0┼┬┬┬┬{CM.Glyphs.Dot}┬┬┬ 0 5 "; @@ -1417,13 +1417,13 @@ namespace Terminal.Gui.ViewsTests { gv.Draw (); var expected = - @" + @$" │ 2┤ │ - 1┤x + 1┤{CM.Glyphs.Dot} │ - 0┼┬┬┬┬x┬ + 0┼┬┬┬┬{CM.Glyphs.Dot}┬ 0 5 "; diff --git a/UnitTests/Views/MenuTests.cs b/UnitTests/Views/MenuTests.cs index fed55bf98..00d0b84af 100644 --- a/UnitTests/Views/MenuTests.cs +++ b/UnitTests/Views/MenuTests.cs @@ -1150,10 +1150,10 @@ Edit // // The width of the Frame is determined in Menu.cs line 144, where `Width` is calculated // 1 space before the Title and 2 spaces after the Title/Check/Help - public string expectedTopRow (int i) => $"{d.ULCorner}{new string (d.HLine.ToString () [0], Menus [i].Children [0].TitleLength + 3)}{d.URCorner} \n"; + public string expectedTopRow (int i) => $"{CM.Glyphs.ULCorner}{new string (CM.Glyphs.HLine.ToString () [0], Menus [i].Children [0].TitleLength + 3)}{CM.Glyphs.URCorner} \n"; // The 3 spaces at end are a result of Menu.cs line 1062 where `pos` is calculated (` + spacesAfterTitle`) - public string expectedMenuItemRow (int i) => $"{d.VLine} {Menus [i].Children [0].Title} {d.VLine} \n"; - public string expectedBottomRow (int i) => $"{d.LLCorner}{new string (d.HLine.ToString () [0], Menus [i].Children [0].TitleLength + 3)}{d.LRCorner} \n"; + public string expectedMenuItemRow (int i) => $"{CM.Glyphs.VLine} {Menus [i].Children [0].Title} {CM.Glyphs.VLine} \n"; + public string expectedBottomRow (int i) => $"{CM.Glyphs.LLCorner}{new string (CM.Glyphs.HLine.ToString () [0], Menus [i].Children [0].TitleLength + 3)}{CM.Glyphs.LRCorner} \n"; // The fulll expected string for an open sub menu public string expectedSubMenuOpen (int i) => ClosedMenuText + @@ -2040,10 +2040,10 @@ Edit View = menu })); Application.Refresh (); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" Nullable Checked ┌──────────────────────┐ -│ ⍰ Check this out 你 │ +│ {CM.Glyphs.NullChecked} Check this out 你 │ └──────────────────────┘", output); Assert.True (menu.openMenu.MouseEvent (new MouseEvent () { X = 0, diff --git a/UnitTests/Views/ProgressBarTests.cs b/UnitTests/Views/ProgressBarTests.cs index ffcb87dfa..e3e5e7358 100644 --- a/UnitTests/Views/ProgressBarTests.cs +++ b/UnitTests/Views/ProgressBarTests.cs @@ -21,7 +21,7 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (1, pb.Height); Assert.Equal (ProgressBarStyle.Blocks, pb.ProgressBarStyle); Assert.Equal (ProgressBarFormat.Simple, pb.ProgressBarFormat); - Assert.Equal (Application.Driver.BlocksMeterSegment, pb.SegmentCharacter); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, pb.SegmentCharacter); } [Fact] @@ -33,16 +33,16 @@ namespace Terminal.Gui.ViewsTests { var pb = new ProgressBar (); pb.ProgressBarStyle = ProgressBarStyle.Blocks; - Assert.Equal (driver.BlocksMeterSegment, pb.SegmentCharacter); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, pb.SegmentCharacter); pb.ProgressBarStyle = ProgressBarStyle.Continuous; - Assert.Equal (driver.ContinuousMeterSegment, pb.SegmentCharacter); + Assert.Equal (CM.Glyphs.ContinuousMeterSegment, pb.SegmentCharacter); pb.ProgressBarStyle = ProgressBarStyle.MarqueeBlocks; - Assert.Equal (driver.BlocksMeterSegment, pb.SegmentCharacter); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, pb.SegmentCharacter); pb.ProgressBarStyle = ProgressBarStyle.MarqueeContinuous; - Assert.Equal (driver.ContinuousMeterSegment, pb.SegmentCharacter); + Assert.Equal (CM.Glyphs.ContinuousMeterSegment, pb.SegmentCharacter); } [Fact] @@ -178,7 +178,7 @@ namespace Terminal.Gui.ViewsTests { pb.Pulse (); pb.Draw (); if (i == 0) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); @@ -194,8 +194,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 1) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); @@ -210,9 +210,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 2) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); @@ -226,10 +226,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 3) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); @@ -242,11 +242,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 4) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); @@ -259,11 +259,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 5) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); @@ -276,11 +276,11 @@ namespace Terminal.Gui.ViewsTests { } else if (i == 6) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); @@ -293,11 +293,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); @@ -310,11 +310,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); @@ -327,11 +327,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); @@ -344,11 +344,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); @@ -361,11 +361,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); @@ -378,11 +378,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 13) { @@ -395,11 +395,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 14) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); @@ -412,11 +412,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 15) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -429,10 +429,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 16) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -446,9 +446,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 17) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -463,8 +463,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 18) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -480,7 +480,7 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 19) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -495,8 +495,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 20) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -510,9 +510,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 21) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -525,10 +525,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 22) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -540,11 +540,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 23) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -555,11 +555,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 24) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); @@ -570,11 +570,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 25) { @@ -585,11 +585,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); @@ -600,11 +600,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); @@ -615,11 +615,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); @@ -630,11 +630,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); @@ -645,11 +645,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); @@ -660,11 +660,11 @@ namespace Terminal.Gui.ViewsTests { } else if (i == 30) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); @@ -675,11 +675,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 31) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); @@ -690,11 +690,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 32) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); @@ -706,10 +706,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 33) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); @@ -722,9 +722,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 34) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); @@ -738,8 +738,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 35) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); @@ -754,7 +754,7 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 36) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); @@ -770,8 +770,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 37) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); @@ -808,7 +808,7 @@ namespace Terminal.Gui.ViewsTests { pb.Pulse (); pb.Draw (); if (i == 0) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); @@ -824,8 +824,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 1) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); @@ -840,9 +840,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 2) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); @@ -856,10 +856,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 3) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); @@ -872,11 +872,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 4) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); @@ -889,11 +889,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 5) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); @@ -906,11 +906,11 @@ namespace Terminal.Gui.ViewsTests { } else if (i == 6) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); @@ -923,11 +923,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); @@ -940,11 +940,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); @@ -957,11 +957,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); @@ -974,11 +974,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); @@ -991,11 +991,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); @@ -1008,11 +1008,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 13) { @@ -1025,11 +1025,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 14) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); @@ -1042,11 +1042,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 15) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1059,10 +1059,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 16) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1076,9 +1076,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 17) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1093,8 +1093,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 18) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1110,9 +1110,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 19) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); @@ -1128,8 +1128,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 20) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); @@ -1144,9 +1144,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 21) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); @@ -1160,10 +1160,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 22) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); @@ -1176,11 +1176,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 23) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); @@ -1193,11 +1193,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 24) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); @@ -1210,11 +1210,11 @@ namespace Terminal.Gui.ViewsTests { } else if (i == 25) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); @@ -1227,11 +1227,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); @@ -1244,11 +1244,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); @@ -1261,11 +1261,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 5, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); @@ -1278,11 +1278,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 6, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); @@ -1295,11 +1295,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 7, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); @@ -1312,11 +1312,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 8, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 32) { @@ -1329,11 +1329,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 6, 0]); Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 9, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); Assert.Equal (' ', (double)driver.Contents [0, 14, 0]); } else if (i == 33) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); @@ -1346,11 +1346,11 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 7, 0]); Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 10, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 34) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1363,10 +1363,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 8, 0]); Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 11, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 35) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1380,9 +1380,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 9, 0]); Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 12, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 36) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1397,8 +1397,8 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 10, 0]); Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 13, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } else if (i == 37) { Assert.Equal (' ', (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); @@ -1414,7 +1414,7 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (' ', (double)driver.Contents [0, 11, 0]); Assert.Equal (' ', (double)driver.Contents [0, 12, 0]); Assert.Equal (' ', (double)driver.Contents [0, 13, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 14, 0]); } } } @@ -1436,46 +1436,46 @@ namespace Terminal.Gui.ViewsTests { pb.Fraction += 0.2F; pb.Draw (); if (i == 0) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); Assert.Equal (' ', (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } else if (i == 1) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); Assert.Equal (' ', (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } else if (i == 2) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); Assert.Equal (' ', (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } else if (i == 3) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); Assert.Equal (' ', (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } else if (i == 4) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } else if (i == 5) { - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); - Assert.Equal (driver.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 0, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 1, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 2, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 3, 0]); + Assert.Equal (CM.Glyphs.BlocksMeterSegment, (double)driver.Contents [0, 4, 0]); Assert.Equal (' ', (double)driver.Contents [0, 5, 0]); } } diff --git a/UnitTests/Views/RadioGroupTests.cs b/UnitTests/Views/RadioGroupTests.cs index d3d234921..6c49e962d 100644 --- a/UnitTests/Views/RadioGroupTests.cs +++ b/UnitTests/Views/RadioGroupTests.cs @@ -90,10 +90,10 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (0, rg.Y); Assert.Equal (13, rg.Frame.Width); Assert.Equal (2, rg.Frame.Height); - var expected = @" + var expected = @$" ┌────────────────────────────┐ -│● Test │ -│◌ New Test 你 │ +│{CM.Glyphs.Selected} Test │ +│{CM.Glyphs.UnSelected} New Test 你 │ │ │ └────────────────────────────┘ "; @@ -111,9 +111,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (21, rg.Width); Assert.Equal (1, rg.Height); - expected = @" + expected = @$" ┌────────────────────────────┐ -│● Test ◌ New Test 你 │ +│{CM.Glyphs.Selected} Test {CM.Glyphs.UnSelected} New Test 你 │ │ │ │ │ └────────────────────────────┘ @@ -131,9 +131,9 @@ namespace Terminal.Gui.ViewsTests { Assert.Equal (0, rg.Y); Assert.Equal (23, rg.Width); Assert.Equal (1, rg.Height); - expected = @" + expected = @$" ┌────────────────────────────┐ -│● Test ◌ New Test 你 │ +│{CM.Glyphs.Selected} Test {CM.Glyphs.UnSelected} New Test 你 │ │ │ │ │ └────────────────────────────┘ diff --git a/UnitTests/Views/ScrollBarViewTests.cs b/UnitTests/Views/ScrollBarViewTests.cs index 22680e23f..08cec5c4f 100644 --- a/UnitTests/Views/ScrollBarViewTests.cs +++ b/UnitTests/Views/ScrollBarViewTests.cs @@ -1104,8 +1104,8 @@ This is a test Assert.Null (sbv.OtherScrollBarView); Assert.False (sbv.ShowScrollIndicator); Assert.False (sbv.Visible); - TestHelpers.AssertDriverContentsWithFrameAre (@" -This is a test[ Click Me! ] + TestHelpers.AssertDriverContentsWithFrameAre (@$" +This is a test{CM.Glyphs.LeftBracket} Click Me! {CM.Glyphs.RightBracket} This is a test This is a test This is a test @@ -1131,8 +1131,8 @@ This is a test ", output); Assert.True (sbv.Visible); Application.Top.Draw (); Assert.False (sbv.Visible); - TestHelpers.AssertDriverContentsWithFrameAre (@" -This is a test[ Click Me! ] + TestHelpers.AssertDriverContentsWithFrameAre (@$" +This is a test{CM.Glyphs.LeftBracket} Click Me! {CM.Glyphs.RightBracket} This is a test This is a test This is a test diff --git a/UnitTests/Views/ScrollViewTests.cs b/UnitTests/Views/ScrollViewTests.cs index e9727491c..a9cde6345 100644 --- a/UnitTests/Views/ScrollViewTests.cs +++ b/UnitTests/Views/ScrollViewTests.cs @@ -611,7 +611,7 @@ namespace Terminal.Gui.ViewsTests { var view = new View (new Rect (Point.Empty, size)); view.Add (new Label (rule.Repeat (size.Width / rule.Length)) { AutoSize = false, Width = Dim.Fill () }); view.Add (new Label (rule.Repeat (size.Height / rule.Length), TextDirection.TopBottom_LeftRight) { Height = Dim.Fill (), AutoSize = false }); - view.Add (new Button (1, 1, "Press me!")); + view.Add (new Label (1, 1, "[ Press me! ]")); var scrollView = new ScrollView (new Rect (1, 1, 15, 10)) { ContentSize = size, ShowHorizontalScrollIndicator = true, diff --git a/UnitTests/Views/StatusBarTests.cs b/UnitTests/Views/StatusBarTests.cs index f798b8075..06ef9d597 100644 --- a/UnitTests/Views/StatusBarTests.cs +++ b/UnitTests/Views/StatusBarTests.cs @@ -109,7 +109,7 @@ namespace Terminal.Gui.ViewsTests { sb.OnDrawContent (sb.Bounds); string expected = @$" -^O Open {Application.Driver.VLine} Q, CtrlMask to Quit! +^O Open {CM.Glyphs.VLine} Q, CtrlMask to Quit! "; TestHelpers.AssertDriverContentsAre (expected, output); } @@ -126,7 +126,7 @@ namespace Terminal.Gui.ViewsTests { sb.OnDrawContent (sb.Bounds); string expected = @$" -CTRL-O Open {Application.Driver.VLine} CTRL-Q Quit +CTRL-O Open {CM.Glyphs.VLine} CTRL-Q Quit "; TestHelpers.AssertDriverContentsAre (expected, output); diff --git a/UnitTests/Views/TableViewTests.cs b/UnitTests/Views/TableViewTests.cs index e33b52cbe..960de54be 100644 --- a/UnitTests/Views/TableViewTests.cs +++ b/UnitTests/Views/TableViewTests.cs @@ -42,6 +42,7 @@ namespace Terminal.Gui.ViewsTests { public void EnsureValidScrollOffsets_LoadSmallerTable () { var tableView = new TableView (); + tableView.BeginInit (); tableView.EndInit (); tableView.Bounds = new Rect (0, 0, 25, 10); Assert.Equal (0, tableView.RowOffset); diff --git a/UnitTests/Views/ToplevelTests.cs b/UnitTests/Views/ToplevelTests.cs index be77b936c..689fd122a 100644 --- a/UnitTests/Views/ToplevelTests.cs +++ b/UnitTests/Views/ToplevelTests.cs @@ -681,7 +681,7 @@ namespace Terminal.Gui.ViewsTests { MessageBox.Query ("", "Hello Word", "Ok"); } else if (iterations == 1) { - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────────────────────────┐ │ │ │ │ @@ -690,7 +690,7 @@ namespace Terminal.Gui.ViewsTests { │ ┌──────────────────────┐ │ │ │ Hello Word │ │ │ │ │ │ -│ │ [◦ Ok ◦] │ │ +│ │ {CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket} │ │ │ └──────────────────────┘ │ │ │ │ │ @@ -731,7 +731,7 @@ namespace Terminal.Gui.ViewsTests { } else if (iterations == 4) { Assert.Equal (Application.Current, Application.MouseGrabView); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────────────────────────┐ │ │ │ │ @@ -740,7 +740,7 @@ namespace Terminal.Gui.ViewsTests { │ ┌──────────────────────┐ │ │ │ Hello Word │ │ │ │ │ │ -│ │ [◦ Ok ◦] │ │ +│ │ {CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket} │ │ │ └──────────────────────┘ │ │ │ │ │ @@ -767,7 +767,7 @@ namespace Terminal.Gui.ViewsTests { } else if (iterations == 6) { Assert.Equal (Application.Current, Application.MouseGrabView); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────────────────────────┐ │ │ │ │ @@ -775,7 +775,7 @@ namespace Terminal.Gui.ViewsTests { │ ┌──────────────────────┐ │ │ │ Hello Word │ │ │ │ │ │ -│ │ [◦ Ok ◦] │ │ +│ │ {CM.Glyphs.LeftBracket}{CM.Glyphs.LeftDefaultIndicator} Ok {CM.Glyphs.RightDefaultIndicator}{CM.Glyphs.RightBracket} │ │ │ └──────────────────────┘ │ │ │ │ │ @@ -1176,9 +1176,9 @@ namespace Terminal.Gui.ViewsTests { Application.Refresh (); Assert.Equal (new Rect (0, 0, 40, 10), top.Frame); Assert.Equal (new Rect (10, 3, 20, 3), dialog.Frame); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────┐ - │ [ Ok ] │ + │ {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ └──────────────────┘ ", output); @@ -1207,9 +1207,9 @@ namespace Terminal.Gui.ViewsTests { Application.Refresh (); Assert.Equal (new Rect (0, 0, 40, 10), top.Frame); Assert.Equal (new Rect (0, 0, 20, 3), dialog.Frame); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────┐ -│ [ Ok ] │ +│ {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ └──────────────────┘ ", output); @@ -1227,9 +1227,9 @@ namespace Terminal.Gui.ViewsTests { Application.Refresh (); Assert.Equal (new Rect (0, 0, 20, 3), top.Frame); Assert.Equal (new Rect (0, 0, 20, 3), dialog.Frame); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────┐ -│ [ Ok ] │ +│ {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ └──────────────────┘ ", output); @@ -1247,9 +1247,9 @@ namespace Terminal.Gui.ViewsTests { Application.Refresh (); Assert.Equal (new Rect (0, 0, 19, 2), top.Frame); Assert.Equal (new Rect (-1, 0, 20, 3), dialog.Frame); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ──────────────────┐ - [ Ok ] │ + {CM.Glyphs.LeftBracket} Ok {CM.Glyphs.RightBracket} │ ", output); ReflectionTools.InvokePrivate ( @@ -1437,7 +1437,7 @@ namespace Terminal.Gui.ViewsTests { var rs = Application.Begin (dialog); Assert.Equal (new Rect (2, 5, 15, 10), dialog.Frame); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────┐ │ │ │ │ @@ -1451,7 +1451,7 @@ namespace Terminal.Gui.ViewsTests { │ │ │ │ │ │ │ │ │ │ │ │ -│ │ [ Popup ] │ │ +│ │ {CM.Glyphs.LeftBracket} Popup {CM.Glyphs.RightBracket} │ │ │ └─────────────┘ │ │ │ │ │ @@ -1470,7 +1470,7 @@ namespace Terminal.Gui.ViewsTests { var firstIteration = false; Application.RunMainLoopIteration (ref rs, true, ref firstIteration); - TestHelpers.AssertDriverContentsWithFrameAre (@" + TestHelpers.AssertDriverContentsWithFrameAre (@$" ┌──────────────────┐ │ │ │ │ @@ -1484,7 +1484,7 @@ namespace Terminal.Gui.ViewsTests { │ │ │ │ │ │ │ │ │ │ │ │ -│ │ [ Popup ] │ │ +│ │ {CM.Glyphs.LeftBracket} Popup {CM.Glyphs.RightBracket} │ │ │┌────────────────┐│ ││One ││ ││Two ││ diff --git a/docfx/articles/config.md b/docfx/articles/config.md index 64159402e..db27b5885 100644 --- a/docfx/articles/config.md +++ b/docfx/articles/config.md @@ -1,12 +1,12 @@ # Configuration Management -Terminal.Gui provides configuration and theme management for Terminal.Gui applications via the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration. +Terminal.Gui provides configuration and theme management for Terminal.Gui applications via the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui. -1) **Settings**. Settings are applied to the [`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml) class. Settings are accessed via the `Settings` property of the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration.ConfigurationManager.yml) class. +1) **Settings**. Settings are applied to the [`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml) class. Settings are accessed via the `Settings` property of the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.ConfigurationManager.yml) class. 2) **Themes**. Themes are a named collection of settings impacting how applications look. The default theme is named "Default". The built-in configuration stored within the Terminal.Gui library defines two additional themes: "Dark", and "Light". Additional themes can be defined in the configuration files. -3) **AppSettings**. AppSettings allow applicaitons to use the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration.ConfigurationManager.yml) to store and retrieve application-specific settings. +3) **AppSettings**. AppSettings allow applicaitons to use the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.ConfigurationManager.yml) to store and retrieve application-specific settings. -The The [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration.ConfigurationManager.yml) will look for configuration files in the `.tui` folder in the user's home directory (e.g. `C:/Users/username/.tui` or `/usr/username/.tui`), the folder where the Terminal.Gui application was launched from (e.g. `./.tui`), or as a resource within the Terminal.Gui application's main assembly. +The The [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.ConfigurationManager.yml) will look for configuration files in the `.tui` folder in the user's home directory (e.g. `C:/Users/username/.tui` or `/usr/username/.tui`), the folder where the Terminal.Gui application was launched from (e.g. `./.tui`), or as a resource within the Terminal.Gui application's main assembly. Settings that will apply to all applications (global settings) reside in files named config.json. Settings that will apply to a specific Terminal.Gui application reside in files named appname.config.json, where appname is the assembly name of the application (e.g. `UICatalog.config.json`). @@ -24,19 +24,39 @@ Settings are applied using the following precedence (higher precedence settings 6. Default settings defined in the Terminal.Gui assembly -- Lowest precedence. -The `UI Catalog` application provides an example of how to use the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration.ConfigurationManager.yml) class to load and save configuration files. The `Configuration Editor` scenario provides an editor that allows users to edit the configuration files. UI Catalog also uses a file system watcher to detect changes to the configuration files to tell [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.Configuration.ConfigurationManager.yml) to reaload them; allowing users to change settings without having to restart the application. +The `UI Catalog` application provides an example of how to use the [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.ConfigurationManager.yml) class to load and save configuration files. The `Configuration Editor` scenario provides an editor that allows users to edit the configuration files. UI Catalog also uses a file system watcher to detect changes to the configuration files to tell [`ConfigurationManager`](~/api/Terminal.Gui/Terminal.Gui.ConfigurationManager.yml) to reaload them; allowing users to change settings without having to restart the application. # What Can Be Configured ## Settings -Settings for the [`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml) class. - * [QuitKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#QuitKey) - * [AlternateForwardKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#AlternateForwardKey) - * [AlternateBackwardKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#AlternateBackwardKey) - * [UseSystemConsole](~/api/Terminal.Gui/Terminal.Gui.Application.yml#UseSystemConsole) - * [IsMouseDisabled](~/api/Terminal.Gui/Terminal.Gui.Application.yml#IsMouseDisabled) - * [HeightAsBuffer](~/api/Terminal.Gui/Terminal.Gui.Application.yml#HeightAsBuffer) +(Note, this list may not be complete; search the source code for `SerializableConfigurationProperty` to find all settings that can be configured.) + + * [Application.QuitKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_QuitKey) + * [Application.AlternateForwardKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_AlternateForwardKey) + * [Application.AlternateBackwardKey](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_AlternateBackwardKey) + * [Application.UseSystemConsole](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_UseSystemConsole) + * [Application.IsMouseDisabled](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_IsMouseDisabled) + * [Application.EnableConsoleScrolling](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_EnableConsoleScrolling) + +## Glyphs + +Defines the standard set of glyphs used for standard views (e.g. the default indicator for [Button](~/api/Terminal.Gui/Terminal.Gui.Button.yml)) and line drawing (e.g. [LineCanvas](~/api/Terminal.Gui/Terminal.Gui.LineCanvas.yml)). + +The value can be either a decimal number or a string. The string may be: + +- A unicode char (e.g. "☑") +- A hex value in U+ format (e.g. "U+2611") +- A hex value in UTF-16 format (e.g. "\\u2611") + +```json + "Glyphs": { + "RightArrow": "►", + "LeftArrow": "U+25C4", + "DownArrow": "\\u25BC", + "UpArrow": 965010 + } +``` ## Themes diff --git a/docfx/build.ps1 b/docfx/build.ps1 index ac94c6e88..b40d968ee 100644 --- a/docfx/build.ps1 +++ b/docfx/build.ps1 @@ -9,7 +9,7 @@ try { rm ../docs -Recurse -Force -ErrorAction SilentlyContinue - $env:DOCFX_SOURCE_BRANCH_NAME="main" + $env:DOCFX_SOURCE_BRANCH_NAME="v2_develop" docfx --metadata --serve --force }