Class Dim
Dim properties of a
View to control the position.
Inheritance
System.Object
Dim
Assembly: Terminal.Gui.dll
Syntax
public class Dim : Object
Constructors
Dim()
Declaration
Methods
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. |
Fill(Int32)
Initializes a new instance of the
Dim class that fills the dimension, but leaves the specified number of colums for a margin.
Declaration
public static Dim Fill(int margin = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
margin |
Margin to use. |
Returns
Type |
Description |
Dim |
The Fill dimension. |
Function(Func<Int32>)
Creates a "DimFunc" from the specified function.
Declaration
public static Dim Function(Func<int> function)
Parameters
Type |
Name |
Description |
System.Func<System.Int32> |
function |
The function to be executed. |
Returns
Type |
Description |
Dim |
The Dim returned from the function. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
A hash code for the current object. |
Height(View)
Returns a
Dim object tracks the Height of the specified
View.
Declaration
public static Dim Height(View view)
Parameters
Type |
Name |
Description |
View |
view |
The view that will be tracked. |
Returns
Percent(Single, Boolean)
Creates a percentage
Dim object
Declaration
public static Dim Percent(float n, bool r = false)
Parameters
Type |
Name |
Description |
System.Single |
n |
A value between 0 and 100 representing the percentage. |
System.Boolean |
r |
If true the Percent is computed based on the remaining space after the X/Y anchor positions. If false is computed based on the whole original space. |
Returns
Type |
Description |
Dim |
The percent Dim object. |
Sized(Int32)
Creates an Absolute
Dim from the specified integer value.
Declaration
public static Dim Sized(int n)
Parameters
Type |
Name |
Description |
System.Int32 |
n |
The value to convert to the Dim. |
Returns
Type |
Description |
Dim |
The Absolute Dim. |
Width(View)
Returns a
Dim object tracks the Width of the specified
View.
Declaration
public static Dim Width(View view)
Parameters
Type |
Name |
Description |
View |
view |
The view that will be tracked. |
Returns
Operators
Addition(Dim, Dim)
Declaration
public static Dim operator +(Dim left, Dim right)
Parameters
Type |
Name |
Description |
Dim |
left |
The first Dim to add. |
Dim |
right |
The second Dim to add. |
Returns
Type |
Description |
Dim |
The Dim that is the sum of the values of left and right . |
Implicit(Int32 to Dim)
Creates an Absolute
Dim from the specified integer value.
Declaration
public static implicit operator Dim(int n)
Parameters
Type |
Name |
Description |
System.Int32 |
n |
The value to convert to the pos. |
Returns
Type |
Description |
Dim |
The Absolute Dim. |
Subtraction(Dim, Dim)
Subtracts a
Dim from a
Dim, yielding a new
Dim.
Declaration
public static Dim operator -(Dim left, Dim right)
Parameters
Type |
Name |
Description |
Dim |
left |
The Dim to subtract from (the minuend). |
Dim |
right |
The Dim to subtract (the subtrahend). |
Returns
Type |
Description |
Dim |
The Dim that is the left minus right . |