Tab.cs 800 B

1234567891011121314151617181920212223242526272829303132
  1. #nullable enable
  2. namespace Terminal.Gui;
  3. /// <summary>A single tab in a <see cref="TabView"/>.</summary>
  4. public class Tab : View
  5. {
  6. private string? _displayText;
  7. /// <summary>Creates a new unnamed tab with no controls inside.</summary>
  8. public Tab ()
  9. {
  10. BorderStyle = LineStyle.Rounded;
  11. CanFocus = true;
  12. TabStop = TabBehavior.NoStop;
  13. }
  14. /// <summary>The text to display in a <see cref="TabView"/>.</summary>
  15. /// <value></value>
  16. public string DisplayText
  17. {
  18. get => _displayText ?? "Unnamed";
  19. set
  20. {
  21. _displayText = value;
  22. SetNeedsDraw ();
  23. }
  24. }
  25. /// <summary>The control to display when the tab is selected.</summary>
  26. /// <value></value>
  27. public View? View { get; set; }
  28. }