Table of Contents

Enum ViewportSettings

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Settings for how the Viewport behaves.

[Flags]
public enum ViewportSettings

Fields

AllowLocationGreaterThanContentSize = AllowXGreaterThanContentWidth | AllowYGreaterThanContentHeight

If set, Viewport.Location can be set values greater than GetContentSize() enabling scrolling beyond the bottom-right of the content area.

When not set, Viewport is constrained to GetContentSize() -1. This means the last column and row of the content will remain visible even if there is an attempt to scroll the Viewport past the last column or row.

AllowNegativeLocation = AllowNegativeX | AllowNegativeY

If set, Viewport.Size can be set to negative coordinates enabling scrolling beyond the top-left of the content area.

When not set, Viewport.Size is constrained to positive coordinates.

AllowNegativeLocationWhenSizeGreaterThanContentSize = AllowNegativeXWhenWidthGreaterThanContentWidth | AllowNegativeYWhenHeightGreaterThanContentHeight

The combination of AllowNegativeXWhenWidthGreaterThanContentWidth and AllowNegativeYWhenHeightGreaterThanContentHeight.

AllowNegativeX = 1

If set, Viewport.X can be set to negative values enabling scrolling beyond the left of the content area.

When not set, Viewport.X is constrained to positive values.

AllowNegativeXWhenWidthGreaterThanContentWidth = 16

If set and Viewport.Width is greater than GetContentSize() .Width Viewport.X can be negative.

When not set, Viewport.X will be constrained to non-negative values when Viewport.Width is greater than GetContentSize() .Width, preventing scrolling beyond the left of the Viewport.

This can be useful in infinite scrolling scenarios.

AllowNegativeY = 2

If set, Viewport.Y can be set to negative values enabling scrolling beyond the top of the content area.

When not set, Viewport.Y is constrained to positive values.

AllowNegativeYWhenHeightGreaterThanContentHeight = 32

If set and Viewport.Height is greater than GetContentSize() .Height Viewport.Y can be negative.

When not set, Viewport.Y will be constrained to non-negative values when Viewport.Height is greater than GetContentSize() .Height, preventing scrolling above the top of the Viewport.

This can be useful in infinite scrolling scenarios.

AllowXGreaterThanContentWidth = 4

If set, Viewport.X can be set values greater than GetContentSize() .Width enabling scrolling beyond the right of the content area.

When not set, Viewport.X is constrained to GetContentSize() .Width - 1. This means the last column of the content will remain visible even if there is an attempt to scroll the Viewport past the last column.

The practical effect of this is that the last column of the content will always be visible.

AllowYGreaterThanContentHeight = 8

If set, Viewport.Y can be set values greater than GetContentSize() .Height enabling scrolling beyond the right of the content area.

When not set, Viewport.Y is constrained to GetContentSize() .Height - 1. This means the last row of the content will remain visible even if there is an attempt to scroll the Viewport past the last row.

The practical effect of this is that the last row of the content will always be visible.

ClearContentOnly = 128

If set ClearViewport() will clear only the portion of the content area that is visible within the Viewport. This is useful for views that have a content area larger than the Viewport and want the area outside the content to be visually distinct. ClipContentOnly must be set for this setting to work (clipping beyond the visible area must be disabled).

ClipContentOnly = 64

By default, clipping is applied to the Viewport. Setting this flag will cause clipping to be applied to the visible content area.

None = 0

No settings.

Transparent = 256

If set the View will be transparent: The Viewport will not be cleared when the View is drawn and the clip region will be set to clip the View's Text and Subviews.

Only the topmost View in a Subview Hierarchy can be transparent. Any subviews of the topmost transparent view will have indeterminate draw behavior.

Combine this with TransparentMouse to get a view that is both visually transparent and transparent to the mouse.

TransparentMouse = 512

If set the View will be transparent to mouse events: Any mouse event that occurs over the View (and it's Subviews) will be passed to the Views below it.

Combine this with Transparent to get a view that is both visually transparent and transparent to the mouse.

Remarks

See the Layout Deep Dive for more information: https://gui-cs.github.io/Terminal.GuiV2Docs/docs/layout.html