Skip to content

Latest commit

 

History

History
50 lines (40 loc) · 1.56 KB

File metadata and controls

50 lines (40 loc) · 1.56 KB
uid Terminal.Gui.ViewBase
summary Core view system, base classes, layout primitives, and adornments.

The ViewBase namespace contains the foundational view architecture for all Terminal.Gui UI elements.

Key Types

  • View - Base class for all UI elements
  • Adornment / Margin / Border / Padding - Visual decorations around content
  • Pos / Dim - Flexible positioning and sizing system
  • ViewArrangement - User interaction flags (Movable, Resizable, Overlapped)
  • IValue<T> - Interface for views with strongly-typed values

View Architecture

Views are composed of nested layers:

  1. Frame - Outer rectangle in SuperView coordinates
  2. Margin - Transparent spacing outside Border
  3. Border - Visual frame with title and line style
  4. Padding - Spacing inside Border
  5. Viewport - Visible window into content area
  6. Content Area - Where content is drawn (can be larger than Viewport for scrolling)

Example

View view = new ()
{
    X = Pos.Center (),
    Y = Pos.Center (),
    Width = Dim.Percent (50),
    Height = Dim.Auto (),
    Title = "My View",
    BorderStyle = LineStyle.Rounded,
    Arrangement = ViewArrangement.Movable | ViewArrangement.Resizable
};

See Also