Table of Contents

Class BorderView

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

The View-backed rendering, navigation, and arrangement layer for the Border adornment. Created lazily by Border (via GetOrCreateView()) when rendering, arrangement, or other View-level functionality is needed.

public class BorderView : AdornmentView, IDisposable, ISupportInitializeNotification, ISupportInitialize, IAdornmentView, IDesignable
Inheritance
BorderView
Implements
Inherited Members
Extension Methods

Remarks

BorderView has two rendering code paths selected by BorderSettings:

  • Legacy mode (Tab not set): Draws the border frame and inline title using LineCanvas. Title position is determined by Thickness on the title side (1 = inline, 2 = cap line, 3+ = enclosed rectangle).
  • Tab mode (Tab set): Draws a content border frame and a separate tab header via a TitleView SubView. The TitleView has SuperViewRendersLineCanvas = true, so its border lines auto-join with the content border via LineCanvas.

Mouse and Keyboard-driven move/resize is handled by the Terminal.Gui.ViewBase.BorderView.Arranger (see Arrangement and the Arrangement Deep Dive).

See https://gui-cs.github.io/Terminal.Gui/docs/borders.html for the full deep dive.

Constructors

BorderView()

Parameter-less constructor required to support all views unit tests (e.g., AllViewsTester).

BorderView(Border)

Properties

DrawIndicator

Gets the SpinnerView SubView used to render DrawIndicator, or null if the diagnostic flag is not set or the border has zero thickness.

EffectiveTabLength

Gets the effective tab length — either the explicit TabLength or the MeasuredTabLength from the laid-out TitleView. Returns 0 if no TitleView exists yet.

TabLength

Gets or sets the total length of the tab header parallel to the border edge (including border cells). If null, the length is auto-computed from the Title width plus the TitleView's border cells. Only meaningful when Settings includes Tab.

TabOffset

Gets or sets the offset along the border edge where the tab header starts (columns for Top/Bottom, rows for Left/Right). Only meaningful when Settings includes Tab.

TabSide

Gets or sets which side the tab header protrudes from. Defaults to Top. Only meaningful when Settings includes Tab.

TitleView

Gets the tab header TitleView SubView, or null if Tab is not set or the view has not yet been created.

Methods

BeginInit()

Signals the View that initialization is starting. See ISupportInitialize.

Dispose(bool)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

OnCommandNotBound(CommandEventArgs)

When in tab mode, if a command is not handled by the TitleView, bubble it to the SuperView (e.g. Tabs); this enables keyboard navigation commands to be handled by the Tabs container when the TitleView has focus.

OnDrawingContent(DrawContext?)

Called when the View's content is to be drawn. The default implementation does nothing.

OnMouseEvent(Mouse)

Called when a mouse event occurs within the view's Viewport.

OnParentFrameChanged(Rectangle)
OnSubViewLayout(LayoutEventArgs)

Called from Terminal.Gui.ViewBase.View.LayoutSubViews before any subviews have been laid out.

See Also