Class Dim
Inheritance
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class 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 postion of the view 3 characters to the left after centering for example.
Constructors
Dim()
Declaration
public Dim ();
Methods
Fill(Int32)
Creates a Dim object that fills the dimension, but leaves the specified number of colums for a margin.
Declaration
public static Terminal.Gui.Dim Fill (int margin = 0);
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | margin | Margin to use. |
Returns
| Type | Description |
|---|---|
| Dim | The Fill dimension. |
Height(View)
Returns a Dim object tracks the Height of the specified view.
Declaration
public static Terminal.Gui.Dim Height (Terminal.Gui.View view);
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The view that will be tracked. |
Returns
| Type | Description |
|---|---|
| Dim | The dimension of the other view. |
Percent(Single)
Creates a percentage Dim object
Declaration
public static Terminal.Gui.Dim Percent (float n);
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | n | A value between 0 and 100 representing the percentage. |
Returns
| Type | Description |
|---|---|
| Dim | The percent Dim object. |
Sized(Int32)
Creates an Absolute Pos from the specified integer value.
Declaration
public static Terminal.Gui.Dim Sized (int n);
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | The value to convert to the pos. |
Returns
| Type | Description |
|---|---|
| Dim | The Absolute Pos. |
Width(View)
Returns a Dim object tracks the Width of the specified view.
Declaration
public static Terminal.Gui.Dim Width (Terminal.Gui.View view);
Parameters
| Type | Name | Description |
|---|---|---|
| View | view | The view that will be tracked. |
Returns
| Type | Description |
|---|---|
| Dim | The dimension of the other view. |
Operators
op_Addition(Dim, Dim)
Declaration
public static Terminal.Gui.Dim op_Addition (Terminal.Gui.Dim left, Terminal.Gui.Dim right);
Parameters
| Type | Name | Description |
|---|---|---|
| Dim | left | The first Pos to add. |
| Dim | right | The second Pos to add. |
Returns
| Type | Description |
|---|---|
| Dim | The Pos that is the sum of the values of |
op_Implicit(Int32 to Dim)
Creates an Absolute Pos from the specified integer value.
Declaration
public static Terminal.Gui.Dim op_Implicit (int n);
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | n | The value to convert to the pos. |
Returns
| Type | Description |
|---|---|
| Dim | The Absolute Pos. |
op_Subtraction(Dim, Dim)
Declaration
public static Terminal.Gui.Dim op_Subtraction (Terminal.Gui.Dim left, Terminal.Gui.Dim right);
Parameters
| Type | Name | Description |
|---|---|---|
| Dim | left | The Pos to subtract from (the minuend). |
| Dim | right | The Pos to subtract (the subtrahend). |
Returns
| Type | Description |
|---|---|
| Dim | The Pos that is the |