Interface IDragAutoScrollTarget
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Implemented by selectable controls that participate in drag-select autoscroll. When a text drag-select is active, the control registers itself with the window system; the main loop then drives continuous scrolling each frame while the cursor is held past the viewport edge. All coordinates are CONTROL-RELATIVE rows (matching what the drag handler receives).
public interface IDragAutoScrollTarget
- Extension Methods
Properties
IsDragSelecting
True while a Button1 text-drag-select is in progress.
bool IsDragSelecting { get; }
Property Value
IsViewportReady
True when the control has painted at least once and its viewport metrics are known. The autoscroll tick no-ops until this is true.
bool IsViewportReady { get; }
Property Value
LastDragRelativeY
The last drag Y in control-relative rows. May be negative (above the viewport top) or ≥ ViewportHeightRows (below the bottom) — that overshoot drives the scroll.
int LastDragRelativeY { get; }
Property Value
ViewportHeightRows
The control's effective visible viewport height, in rows.
int ViewportHeightRows { get; }
Property Value
Methods
AutoScrollStep(int)
Scrolls by rows (sign = direction). The control chooses how (host
IScrollableContainer, Window.ScrollBy, or its own offset) and clamps at the
scroll extent. A no-op when no scrollable host exists.
void AutoScrollStep(int rows)
Parameters
rowsint
ExtendSelectionToRevealedEdge(int)
After a scroll step, extends the selection's end to the edge row now revealed:
direction -1 = the new top row, +1 = the new bottom row. Computes the
row from the post-scroll position arithmetically (never from the stale pre-paint cache).
void ExtendSelectionToRevealedEdge(int direction)
Parameters
directionint