PosAbsolute.cs 846 B

123456789101112131415161718192021222324
  1. namespace Terminal.Gui.ViewBase;
  2. /// <summary>
  3. /// Represents an absolute position in the layout. This is used to specify a fixed position in the layout.
  4. /// </summary>
  5. /// <remarks>
  6. /// <para>
  7. /// This is a low-level API that is typically used internally by the layout system. Use the various static
  8. /// methods on the <see cref="Pos"/> class to create <see cref="Pos"/> objects instead.
  9. /// </para>
  10. /// </remarks>
  11. /// <param name="Position"></param>
  12. public record PosAbsolute (int Position) : Pos
  13. {
  14. /// <summary>
  15. /// The position of the <see cref="View"/> in the layout.
  16. /// </summary>
  17. public int Position { get; } = Position;
  18. /// <inheritdoc/>
  19. public override string ToString () { return $"Absolute({Position})"; }
  20. internal override int GetAnchor (int size) { return Position; }
  21. }