Class Pos
Describes the position of a
View which can be an absolute value, a percentage, centered, or
relative to the ending dimension. Integer values are implicitly convertible to
an absolute
Pos. These objects are created using the static methods Percent,
AnchorEnd, and Center. The
Pos objects can be combined with the addition and
subtraction operators.
Inheritance
System.Object
Pos
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Terminal.Gui.dll
Syntax
Methods
|
Improve this Doc
View Source
AnchorEnd(Int32)
Creates a
Pos object that is anchored to the end (right side or bottom) of the dimension,
useful to flush the layout from the right or bottom.
Declaration
public static Pos AnchorEnd(int margin = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
margin |
Optional margin to place to the right or below. |
Returns
Type |
Description |
Pos |
The Pos object anchored to the end (the bottom or the right side). |
|
Improve this Doc
View Source
At(Int32)
Creates an Absolute
Pos from the specified integer value.
Declaration
public static Pos At(int n)
Parameters
Type |
Name |
Description |
System.Int32 |
n |
The value to convert to the Pos. |
Returns
Type |
Description |
Pos |
The Absolute Pos. |
|
Improve this Doc
View Source
Bottom(View)
Returns a
Pos object tracks the Bottom (Y+Height) coordinate of the specified
View
Declaration
public static Pos Bottom(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
|
Improve this Doc
View Source
Center()
Returns a
Pos object that can be used to center the
View
Declaration
public static Pos Center()
Returns
Type |
Description |
Pos |
The center Pos. |
|
Improve this Doc
View Source
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
The object to compare with the current object. |
Returns
Type |
Description |
System.Boolean |
true if the specified object is equal to the current object; otherwise, false. |
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
Function(Func<Int32>)
Creates a "PosFunc" from the specified function.
Declaration
public static Pos Function(Func<int> function)
Parameters
Type |
Name |
Description |
System.Func<System.Int32> |
function |
The function to be executed. |
Returns
Type |
Description |
Pos |
The Pos returned from the function. |
|
Improve this Doc
View Source
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
A hash code for the current object. |
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
Left(View)
Returns a
Pos object tracks the Left (X) position of the specified
View.
Declaration
public static Pos Left(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
|
Improve this Doc
View Source
Percent(Single)
Creates a percentage
Pos object
Declaration
public static Pos Percent(float n)
Parameters
Type |
Name |
Description |
System.Single |
n |
A value between 0 and 100 representing the percentage. |
Returns
Type |
Description |
Pos |
The percent Pos object. |
|
Improve this Doc
View Source
Right(View)
Returns a
Pos object tracks the Right (X+Width) coordinate of the specified
View.
Declaration
public static Pos Right(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
|
Improve this Doc
View Source
Top(View)
Returns a
Pos object tracks the Top (Y) position of the specified
View.
Declaration
public static Pos Top(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
|
Improve this Doc
View Source
X(View)
Returns a
Pos object tracks the Left (X) position of the specified
View.
Declaration
public static Pos X(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
|
Improve this Doc
View Source
Y(View)
Returns a
Pos object tracks the Top (Y) position of the specified
View.
Declaration
public static Pos Y(View view)
Parameters
Type |
Name |
Description |
View |
view |
The View that will be tracked. |
Returns
Type |
Description |
Pos |
The Pos that depends on the other view. |
Operators
|
Improve this Doc
View Source
Addition(Pos, Pos)
Declaration
public static Pos operator +(Pos left, Pos right)
Parameters
Type |
Name |
Description |
Pos |
left |
The first Pos to add. |
Pos |
right |
The second Pos to add. |
Returns
Type |
Description |
Pos |
The Pos that is the sum of the values of left and right . |
|
Improve this Doc
View Source
Implicit(Int32 to Pos)
Creates an Absolute
Pos from the specified integer value.
Declaration
public static implicit operator Pos(int n)
Parameters
Type |
Name |
Description |
System.Int32 |
n |
The value to convert to the Pos . |
Returns
Type |
Description |
Pos |
The Absolute Pos. |
|
Improve this Doc
View Source
Subtraction(Pos, Pos)
Subtracts a
Pos from a
Pos, yielding a new
Pos.
Declaration
public static Pos operator -(Pos left, Pos right)
Parameters
Type |
Name |
Description |
Pos |
left |
The Pos to subtract from (the minuend). |
Pos |
right |
The Pos to subtract (the subtrahend). |
Returns
Type |
Description |
Pos |
The Pos that is the left minus right . |