Tab.cs 809 B

123456789101112131415161718192021222324252627282930313233
  1. #nullable enable
  2. namespace Terminal.Gui.Views;
  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. SetNeedsLayout ();
  23. }
  24. }
  25. /// <summary>The control to display when the tab is selected.</summary>
  26. /// <value></value>
  27. public View? View { get; set; }
  28. }