Table of Contents

Class AdornmentView

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

The View-backed rendering layer for an adornment (Margin, Border, or Padding). Implements IAdornmentView — i.e., it knows its Parent View and its Adornment settings owner. Created lazily by GetOrCreateView() when View-level functionality is needed.

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

Remarks

This class is structurally a copy of Adornment. It extends View directly (not Adornment) and accesses Thickness via the IAdornment back-reference, making AdornmentImpl the single authoritative owner of Thickness.

During the incremental migration, existing Border and Padding continue to extend Adornment. Only newly migrated adornments (starting with MarginView) extend AdornmentView.

Constructors

AdornmentView()

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

AdornmentView(IAdornment)

Constructs a rendering layer for the specified adornment.

Properties

Adornment

Back-reference to the lightweight IAdornment that owns this View. AdornmentImpl is the single authoritative owner of Thickness. Set by GetOrCreateView() when the backing View is created.

Diagnostics

Gets or sets whether the Adornment will draw diagnostic information.

SuperViewRendersLineCanvas

AdornmentViews only render to their Parent's or Parent's SuperView's LineCanvas.

Viewport

Gets or sets the rectangle describing the portion of the View's content that is visible to the user. The viewport Location is relative to the top-left corner of the inner rectangle of Padding. If the viewport Size is the same as GetContentSize(), or GetContentSize() is null the Location will be 0, 0.

Methods

Contains(in Point)

Indicates whether the specified Parent's SuperView-relative coordinates are within the Adornment's Thickness.

FrameToScreen()

Gets the Frame with a screen-relative location.

GetApp()

Gets the IApplication instance this view is running in. Used internally to allow overrides by IAdornment.

GetDriver()

Gets the IDriver instance for this view. Used internally to allow overrides by IAdornment.

OnClearingViewport()

Called when the Thickness of the Adornment is to be cleared.

OnDrawingSubViews()

Called when the SubViews are to be drawn.

OnDrawingText()

Called when the Text of the View is to be drawn.

OnGettingScheme(out Scheme?)

Called when the Scheme for the View is being retrieved. Subclasses can return true to stop further processing and optionally set scheme to a different value.

OnParentFrameChanged(Rectangle)
OnRenderingLineCanvas()

Does nothing for AdornmentView.

OnSettingScheme(ValueChangingEventArgs<Scheme?>)

Called before the scheme is set, allowing subclasses to cancel or modify the change.

ScreenToFrame(in Point)

Converts a screen-relative coordinate to a Frame-relative coordinate. Frame-relative means relative to the View's SuperView's Viewport.

ToDebugString()

Pretty prints the View with more debug information.