Skip to content
ConsoleMonster
Class

ColumnFormat

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
Modifiers
sealed

How a widget lays out one of its stat columns (counts, percentages, values, details) across rows. Every row of a widget shares the column's width, so numbers line up; during a live session the width never shrinks, so columns do not jump when a value grows from 9 to 10 or drops back.

Inheritance

  • object
  • ColumnFormat

Remarks

The width of a column is the largest of: its widest current value, ColumnFormat.MinWidth, the width reserved by ColumnFormat.ReserveDigits (numeric columns), the width of a known maximum the widget supplies (a lane total, an overall total), and the widest width the column has used so far.

Usage

Explore 92 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 68

Constructors

public ColumnFormat(HorizontalAlignment alignment = Right, int minWidth = 0, int reserveDigits = 0) #

Creates a column format.

Parameters

alignment ConsoleMonster.Layout.HorizontalAlignment = Right optional
Alignment of values inside the column.
minWidth int = 0 optional
Minimum width in cells.
reserveDigits int = 0 optional
Digits reserved for numeric values (0 = only what the widget knows or has seen).

Properties

public HorizontalAlignment Alignment { get; set; } #

Alignment of values inside the column; numbers default to right.

public int MinWidth { get; set; } #

Minimum width in cells (never negative).

public int ReserveDigits { get; set; } #

Digits reserved for numeric values, for example 4 to keep room for 9999 from the first frame. Zero (the default) reserves only what the widget knows (its totals) or has already displayed.

public bool AllowShrink { get; set; } #

When true, the column follows its current values and may shrink; defaults to false.

Extension Methods

public static ColumnFormat Alignment(ColumnFormat columnFormat, HorizontalAlignment value) #

Sets ColumnFormat.Alignment: Alignment of values inside the column; numbers default to right.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat required
The instance.
value ConsoleMonster.Layout.HorizontalAlignment required
The value.

Returns

ColumnFormat The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Layout.ColumnFormat { Alignment = value };    Ui.ColumnFormat().Alignment(value);
public static ColumnFormat AllowShrink(ColumnFormat columnFormat, bool value = true) #

Sets ColumnFormat.AllowShrink: When true, the column follows its current values and may shrink; defaults to false.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat required
The instance.
value bool = true optional
The value; true when omitted.

Returns

ColumnFormat The same instance.

Examples

// C# initializer or property                                              // C# fluent
new global::ConsoleMonster.Layout.ColumnFormat { AllowShrink = value };    Ui.ColumnFormat().AllowShrink(value);
public static ColumnFormat MinWidth(ColumnFormat columnFormat, int value) #

Sets ColumnFormat.MinWidth: Minimum width in cells (never negative).

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat required
The instance.
value int required
The value.

Returns

ColumnFormat The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Layout.ColumnFormat { MinWidth = value };    Ui.ColumnFormat().MinWidth(value);
public static ColumnFormat ReserveDigits(ColumnFormat columnFormat, int value) #

Sets ColumnFormat.ReserveDigits: Digits reserved for numeric values, for example 4 to keep room for 9999 from the first frame. Zero (the default) reserves only what the widget knows (its totals) or has already displayed.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat required
The instance.
value int required
The value.

Returns

ColumnFormat The same instance.

Examples

// C# initializer or property                                                // C# fluent
new global::ConsoleMonster.Layout.ColumnFormat { ReserveDigits = value };    Ui.ColumnFormat().ReserveDigits(value);