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.

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 abstract record Dim : IEqualityOperators<Dim, Dim, bool>, IEquatable<Dim>
Inheritance
Dim
Implements
Derived
Inherited Members

Remarks

Dim ObjectDescription
Absolute(int) Creates a Dim that is a fixed size.
Auto(DimAutoStyle, Dim?, Dim?) Creates a Dim object that automatically sizes the view to fit the view's Text, SubViews, or ContentArea.
Func(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(int, DimPercentMode) Creates a Dim object that is a percentage of the width or height of the SuperView.
Fill(Dim) 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

Absolute(int)

Creates an Absolute Dim from the specified integer value.

Auto(DimAutoStyle, Dim?, Dim?)

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

Fill()

Creates a Dim object that fills the dimension, leaving no margin.

Fill(Dim)

Creates a Dim object that fills the dimension, leaving the specified margin.

Func(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.

Has<T>(out T)

Indicates whether the specified type T is in the hierarchy of this Dim object.

Height(View?)

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

Percent(int, DimPercentMode)

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

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.