mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 01:38:01 +01:00
25 lines
851 B
C#
25 lines
851 B
C#
#nullable enable
|
|
namespace Terminal.Gui;
|
|
|
|
/// <summary>
|
|
/// Represents a position that is computed by executing a function that returns an integer position.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This is a low-level API that is typically used internally by the layout system. Use the various static
|
|
/// methods on the <see cref="Gui.Pos"/> class to create <see cref="Gui.Pos"/> objects instead.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <param name="Pos">The position.</param>
|
|
public record PosFunc (Func<int> Pos) : Pos
|
|
{
|
|
/// <summary>
|
|
/// Gets the function that computes the position.
|
|
/// </summary>
|
|
public new Func<int> Func { get; } = Pos;
|
|
|
|
/// <inheritdoc/>
|
|
public override string ToString () { return $"PosFunc({Func ()})"; }
|
|
|
|
internal override int GetAnchor (int size) { return Func (); }
|
|
} |