Class ScrollContainer

Namespace
Forma
Assembly
Forma.dll

Clips content to a viewport and provides horizontal and vertical scrolling when it overflows.

[TemplatePart("PART_ScrollPresenter", typeof(ScrollPresenter), true)]
public sealed class ScrollContainer : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable, IScrollViewportOwner
Inheritance
ScrollContainer
Implements
Inherited Members

Constructors

ScrollContainer()

public ScrollContainer()

Fields

ScrollPresenterPartName

public const string ScrollPresenterPartName = "PART_ScrollPresenter"

Field Value

string

Properties

AccessibilityActions

public override AccessibilityActions AccessibilityActions { get; }

Property Value

AccessibilityActions

AccessibilityRole

public override AccessibilityRole AccessibilityRole { get; }

Property Value

AccessibilityRole

Content

public Control Content { get; set; }

Property Value

Control

DragHoverScrollBorder

public int DragHoverScrollBorder { get; set; }

Property Value

int

DragHoverScrollSpeed

public float DragHoverScrollSpeed { get; set; }

Property Value

float

DrawFocusBorder

Retained draw-focus-border policy.

public bool DrawFocusBorder { get; set; }

Property Value

bool

Extent

public Vector2 Extent { get; }

Property Value

Vector2

FollowFocus

Scrolls the focused descendant into view as focus changes, matching Godot's follow_focus property.

public bool FollowFocus { get; set; }

Property Value

bool

HorizontalCustomStep

Forwards to the underlying scrollbar's own CustomStep, matching Godot's set_horizontal_custom_step/set_vertical_custom_step, which themselves just forward to h_scroll/v_scroll's set_custom_step - this has no effect on mouse-wheel scroll amount, which Godot always computes from the scrollbar's page instead (see PointerWheel).

public float HorizontalCustomStep { get; set; }

Property Value

float

HorizontalScroll

Horizontal scroll position, corresponding to Godot's h_scroll property.

public int HorizontalScroll { get; set; }

Property Value

int

HorizontalScrollBar

public HScrollBar HorizontalScrollBar { get; }

Property Value

HScrollBar

HorizontalScrollMode

public ScrollBarVisibility HorizontalScrollMode { get; set; }

Property Value

ScrollBarVisibility

IsBeyondScrollDeadzone

public bool IsBeyondScrollDeadzone { get; }

Property Value

bool

IsTouchDragDecelerating

public bool IsTouchDragDecelerating { get; }

Property Value

bool

IsTouchDragging

public bool IsTouchDragging { get; }

Property Value

bool

MaxScrollOffset

public Vector2 MaxScrollOffset { get; }

Property Value

Vector2

ScrollAnchor

public ScrollAnchor? ScrollAnchor { get; }

Property Value

ScrollAnchor?

ScrollDeadzone

Retained touch-drag deadzone state, corresponding to Godot's scroll_deadzone property.

public int ScrollDeadzone { get; set; }

Property Value

int

ScrollHintMode

Retained overflow hint mode.

public ScrollContainerScrollHintMode ScrollHintMode { get; }

Property Value

ScrollContainerScrollHintMode

ScrollHorizontalByDefault

Retained default wheel-axis policy. Touch/trackpad gesture parity remains platform-dependent.

public bool ScrollHorizontalByDefault { get; set; }

Property Value

bool

ScrollOffset

public Vector2 ScrollOffset { get; set; }

Property Value

Vector2

ScrollOnDragHover

Scrolls while a retained drag hovers near an edge, matching Godot's scroll_on_drag_hover property.

public bool ScrollOnDragHover { get; set; }

Property Value

bool

TileScrollHint

Retains Godot's texture tiling policy for themed scroll hints.

public bool TileScrollHint { get; }

Property Value

bool

TouchDragSpeed

public Vector2 TouchDragSpeed { get; }

Property Value

Vector2

VerticalCustomStep

public float VerticalCustomStep { get; set; }

Property Value

float

VerticalScroll

Vertical scroll position, corresponding to Godot's v_scroll property.

public int VerticalScroll { get; set; }

Property Value

int

VerticalScrollBar

public VScrollBar VerticalScrollBar { get; }

Property Value

VScrollBar

VerticalScrollMode

public ScrollBarVisibility VerticalScrollMode { get; set; }

Property Value

ScrollBarVisibility

Viewport

public Vector2 Viewport { get; }

Property Value

Vector2

Methods

AddChild(Control)

public override void AddChild(Control child)

Parameters

child Control

ArrangeChildren()

protected override void ArrangeChildren()

BeginTouchDragScroll()

Begins a retained touch drag, mirroring Godot's touchscreen mouse-press handling in ScrollContainer::gui_input.

public void BeginTouchDragScroll()

BringIndexIntoView(int)

public bool BringIndexIntoView(int index)

Parameters

index int

Returns

bool

CancelTouchDragScroll()

Cancels an in-progress touch drag immediately, mirroring Godot's ScrollContainer::_cancel_drag.

public void CancelTouchDragScroll()

CaptureScrollAnchor(object, Vector2)

public ScrollAnchor CaptureScrollAnchor(object token, Vector2 contentPosition)

Parameters

token object
contentPosition Vector2

Returns

ScrollAnchor

ClearScrollAnchor()

public void ClearScrollAnchor()

EndTouchDragScroll()

Ends a retained touch drag, entering inertial deceleration when speed is nonzero like Godot's release handling.

public void EndTouchDragScroll()

EnsureControlVisible(Control)

Scrolls as little as necessary to reveal a descendant control inside the viewport.

public void EnsureControlVisible(Control control)

Parameters

control Control

GetDeadzone()

public int GetDeadzone()

Returns

int

GetDrawFocusBorder()

public bool GetDrawFocusBorder()

Returns

bool

GetHScroll()

public int GetHScroll()

Returns

int

GetHScrollBar()

public HScrollBar GetHScrollBar()

Returns

HScrollBar

GetHorizontalCustomStep()

public float GetHorizontalCustomStep()

Returns

float

GetHorizontalScrollMode()

public ScrollBarVisibility GetHorizontalScrollMode()

Returns

ScrollBarVisibility

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2

GetScrollHintMode()

public ScrollContainerScrollHintMode GetScrollHintMode()

Returns

ScrollContainerScrollHintMode

GetVScroll()

public int GetVScroll()

Returns

int

GetVScrollBar()

public VScrollBar GetVScrollBar()

Returns

VScrollBar

GetVerticalCustomStep()

public float GetVerticalCustomStep()

Returns

float

GetVerticalScrollMode()

public ScrollBarVisibility GetVerticalScrollMode()

Returns

ScrollBarVisibility

IsFollowingFocus()

public bool IsFollowingFocus()

Returns

bool

IsScrollHintTiled()

public bool IsScrollHintTiled()

Returns

bool

IsScrollHorizontalByDefault()

public bool IsScrollHorizontalByDefault()

Returns

bool

IsScrollOnDragHoverEnabled()

public bool IsScrollOnDragHoverEnabled()

Returns

bool

OnContextChanged(UIContext, UIContext)

Called when this control enters, exits, or moves between retained UI contexts.

protected override void OnContextChanged(UIContext previous, UIContext current)

Parameters

previous UIContext
current UIContext

OnTemplateApplied()

protected override void OnTemplateApplied()

RestoreScrollAnchor(object, Vector2)

public bool RestoreScrollAnchor(object token, Vector2 contentPosition)

Parameters

token object
contentPosition Vector2

Returns

bool

ScrollTo(Vector2)

public void ScrollTo(Vector2 offset)

Parameters

offset Vector2

SetDeadzone(int)

public void SetDeadzone(int deadzone)

Parameters

deadzone int

SetDrawFocusBorder(bool)

public void SetDrawFocusBorder(bool draw)

Parameters

draw bool

SetFollowFocus(bool)

public void SetFollowFocus(bool enable)

Parameters

enable bool

SetHScroll(int)

public void SetHScroll(int value)

Parameters

value int

SetHorizontalCustomStep(float)

public void SetHorizontalCustomStep(float value)

Parameters

value float

SetHorizontalScrollMode(ScrollBarVisibility)

public void SetHorizontalScrollMode(ScrollBarVisibility mode)

Parameters

mode ScrollBarVisibility

SetScrollHintMode(ScrollContainerScrollHintMode)

public void SetScrollHintMode(ScrollContainerScrollHintMode mode)

Parameters

mode ScrollContainerScrollHintMode

SetScrollHorizontalByDefault(bool)

public void SetScrollHorizontalByDefault(bool enable)

Parameters

enable bool

SetScrollOnDragHover(bool)

public void SetScrollOnDragHover(bool enable)

Parameters

enable bool

SetTileScrollHint(bool)

public void SetTileScrollHint(bool enable)

Parameters

enable bool

SetVScroll(int)

public void SetVScroll(int value)

Parameters

value int

SetVerticalCustomStep(float)

public void SetVerticalCustomStep(float value)

Parameters

value float

SetVerticalScrollMode(ScrollBarVisibility)

public void SetVerticalScrollMode(ScrollBarVisibility mode)

Parameters

mode ScrollBarVisibility

TouchDragScrollBy(Vector2)

Applies relative touch motion, gating on ScrollDeadzone exactly like Godot's gui_input drag accumulation.

public void TouchDragScrollBy(Vector2 relativeMotion)

Parameters

relativeMotion Vector2

Events

ScrollEnded

Raised when a touch drag that crossed the deadzone ends, matching Godot's scroll_ended signal.

public event EventHandler ScrollEnded

Event Type

EventHandler

ScrollExtentChanged

public event EventHandler ScrollExtentChanged

Event Type

EventHandler

ScrollMetricsChanged

public event EventHandler<ScrollViewportMetricsChangedEventArgs> ScrollMetricsChanged

Event Type

EventHandler<ScrollViewportMetricsChangedEventArgs>

ScrollOffsetChanged

public event EventHandler ScrollOffsetChanged

Event Type

EventHandler

ScrollStarted

Raised when a touch drag first crosses ScrollDeadzone, matching Godot's scroll_started signal.

public event EventHandler ScrollStarted

Event Type

EventHandler

ViewportChanged

public event EventHandler ViewportChanged

Event Type

EventHandler