Table of Contents

Class Dim

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

A Dim object describes the dimensions of a View. Dim is the type of the Width and Height properties of View. Dim objects enable Computed Layout (see Computed) to automatically manage the dimensions of a view.

Integer values are implicitly convertible to an absolute Dim. These objects are created using the static methods described below. The Dim objects can be combined with the addition and subtraction operators.

public class Dim
Inheritance
Dim
Derived
Inherited Members

Remarks

Dim ObjectDescription
Auto(DimAutoStyle, Dim, Dim) Creates a Dim object that automatically sizes the view to fit the view's Text, SubViews, or ContentArea.
Function(Func<int>) Creates a Dim object that computes the dimension by executing the provided function. The function will be called every time the dimension is needed.
Percent(float, bool) Creates a Dim object that is a percentage of the width or height of the SuperView.
Fill(int) Creates a Dim object that fills the dimension from the View's X position to the end of the super view's width, leaving the specified number of columns for a margin.
Width(View) Creates a Dim object that tracks the Width of the specified View.
Height(View) Creates a Dim object that tracks the Height of the specified View.

Methods

Auto(DimAutoStyle, Dim, Dim)

Creates a Dim object that automatically sizes the view to fit all the view's SubViews and/or Text.

Equals(object)

Determines whether the specified object is equal to the current object.

Fill(int)

Creates a Dim object that fills the dimension, leaving the specified number of columns for a margin.

Function(Func<int>)

Creates a function Dim object that computes the dimension by executing the provided function. The function will be called every time the dimension is needed.

GetHashCode()

Serves as the default hash function.

Height(View)

Creates a Dim object that tracks the Height of the specified View.

Percent(float, bool)

Creates a percentage Dim object that is a percentage of the width or height of the SuperView.

Sized(int)

Creates an Absolute Dim from the specified integer value.

Width(View)

Creates a Dim object that tracks the Width of the specified View.

Operators

operator +(Dim, Dim)

Adds a Dim to a Dim, yielding a new Dim.

implicit operator Dim(int)

Creates an Absolute Dim from the specified integer value.

operator -(Dim, Dim)

Subtracts a Dim from a Dim, yielding a new Dim.