Table of Contents

Enum ViewportSettingsFlags

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

Settings for how the Viewport behaves.

[Flags]
public enum ViewportSettingsFlags

Fields

AllowLocationGreaterThanContentSize = AllowXGreaterThanContentWidth | AllowYGreaterThanContentHeight

Combines AllowXGreaterThanContentWidth and AllowYGreaterThanContentHeight.

AllowLocationPlusSizeGreaterThanContentSize = AllowXPlusWidthGreaterThanContentWidth | AllowYPlusHeightGreaterThanContentHeight

Combines AllowXPlusWidthGreaterThanContentWidth and AllowYPlusHeightGreaterThanContentHeight. Allows blank space to appear when scrolling in either direction.

AllowNegativeLocation = AllowNegativeX | AllowNegativeY

Combines AllowNegativeX and AllowNegativeY.

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 exceed ContentSize.Width - 1, enabling scrolling beyond the right of the content.

When not set, Viewport.X is clamped to keep at least the last column visible.

AllowXPlusWidthGreaterThanContentWidth = 64

If set, Viewport.X + Viewport.Width can exceed ContentSize.Width, allowing blank space on the right when scrolling.

When not set (default), Viewport.X is clamped so the content always fills the viewport horizontally.

AllowYGreaterThanContentHeight = 8

If set, Viewport.Y can exceed ContentSize.Height - 1, enabling scrolling beyond the bottom of the content.

When not set, Viewport.Y is clamped to keep at least the last row visible.

AllowYPlusHeightGreaterThanContentHeight = 128

If set, Viewport.Y + Viewport.Height can exceed ContentSize.Height, allowing blank space at the bottom when scrolling.

When not set (default), Viewport.Y is clamped so the content always fills the viewport vertically.

ClearContentOnly = 512

If set ClearViewport(DrawContext?) 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 = 256

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 = 1024

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 = 2048

If set the View will be transparent to mouse events: Specifically, any mouse event that occurs over the View that is NOT occupied by a SubView will not be captured by the View.

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.Gui/docs/layout.html