Search Results for

    Show / Hide Table of Contents

    Class Dim

    Dim properties of a View to control the position.
    Inheritance
    System.Object
    Dim
    Remarks

    Use the Dim objects on the Width or Height properties of a View to control the position.

    These can be used to set the absolute position, when merely assigning an integer value (via the implicit integer to Pos conversion), and they can be combined to produce more useful layouts, like: Pos.Center - 3, which would shift the position of the View 3 characters to the left after centering for example.

    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class Dim : Object

    Constructors

    Dim()

    Declaration
    public Dim()

    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
    Type Description
    Dim The Dim of the other View.

    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
    Type Description
    Dim The Dim of the other View.

    Operators

    Addition(Dim, Dim)

    Adds a Dim to a Dim, yielding a new 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.
    In This Article
    Back to top Generated by DocFX