diff --git a/Terminal.Gui/Text/TextFormatter.cs b/Terminal.Gui/Text/TextFormatter.cs index 710ed52bd..0ffbd7070 100644 --- a/Terminal.Gui/Text/TextFormatter.cs +++ b/Terminal.Gui/Text/TextFormatter.cs @@ -309,7 +309,7 @@ public class TextFormatter int start = isVertical ? screen.Top : screen.Left; int size = isVertical ? screen.Height : screen.Width; int current = start + colOffset; - List lastZeroWidthPos = null; + List lastZeroWidthPos = null!; Rune rune = default; int zeroLengthCount = isVertical ? runes.Sum (r => r.GetColumns () == 0 ? 1 : 0) : 0; @@ -378,12 +378,12 @@ public class TextFormatter { lastZeroWidthPos [foundIdx] = new Point ( - lastZeroWidthPos [foundIdx].Value.X + 1, + lastZeroWidthPos [foundIdx]!.Value.X + 1, current ); driver?.Move ( - lastZeroWidthPos [foundIdx].Value.X, + lastZeroWidthPos [foundIdx]!.Value.X, current ); } @@ -1758,7 +1758,7 @@ public class TextFormatter return lineResult; } - string [] lines = null; + string []? lines = null; if (text.Contains ("\r\n")) { @@ -1967,7 +1967,7 @@ public class TextFormatter /// The index of the text that fit the width. public static int GetLengthThatFits (string text, int width, int tabWidth = 0, TextDirection textDirection = TextDirection.LeftRight_TopBottom) { - return GetLengthThatFits (text?.ToRuneList (), width, tabWidth, textDirection); + return GetLengthThatFits (text.ToRuneList (), width, tabWidth, textDirection); } /// Gets the number of the Runes in a list of Runes that will fit in . diff --git a/Terminal.Gui/Views/CheckBox.cs b/Terminal.Gui/Views/CheckBox.cs index 9428ba91f..8d1b6a57b 100644 --- a/Terminal.Gui/Views/CheckBox.cs +++ b/Terminal.Gui/Views/CheckBox.cs @@ -6,8 +6,19 @@ namespace Terminal.Gui; /// public enum CheckState { + /// + /// Neither checked nor unchecked. + /// None, + + /// + /// Checked. + /// Checked, + + /// + /// Not checked. + /// UnChecked } diff --git a/Terminal.Gui/Views/CheckState.cs b/Terminal.Gui/Views/CheckState.cs new file mode 100644 index 000000000..54f818bc7 --- /dev/null +++ b/Terminal.Gui/Views/CheckState.cs @@ -0,0 +1,23 @@ +#nullable enable +namespace Terminal.Gui; + +/// +/// Represents the state of a . +/// +public enum CheckState +{ + /// + /// Neither checked nor unchecked. + /// + None, + + /// + /// Checked. + /// + Checked, + + /// + /// Not checked. + /// + UnChecked +}