ScrollView
classin packageklyn.gui.terminal
public class ScrollView extends Widget
└ Widget
└ ScrollView

Basic text scroll view.

Fields
Modifier and Type Member Description
public scrollOffset
scrollOffset as Long = 0
No summary.
Inherited Attributes
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Properties
Modifier and Type Member Description
public readonly property hasSelection
hasSelection as Boolean
Returns true when this view currently owns a non-empty text selection.
Inherited Properties
propertyInherited Properties from Widget: focusable, focused, lastRenderFrame, position, size
propertyInherited Properties from Object: type
Signals
Modifier and Type Member Description
public signal property text
text as String
No summary.
Constructors
Modifier and Type Member Description
public ScrollView No summary.
Methods
Modifier and Type Member Description
public appendLine
appendLine(line as String) as Void
No summary.
public clampScrollOffsetFor
clampScrollOffsetFor(totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Void
Clamps the current scroll offset to the valid range.
public clear
clear() as Void
No summary.
public contentWidth
contentWidth(viewWidth as Int, totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0, rightInset as Int = 0) as Int
Returns the content width when the scrollbar reserves one column.
public copySelectionToClipboard
copySelectionToClipboard() as Boolean
Copies the current selection to the host terminal clipboard.
public override handleMouseEvent
handleMouseEvent(mouse as MouseEvent, localX as Int, localY as Int, viewWidth as Int, viewHeight as Int) as Boolean
Handles mouse interaction for scrollable text content.
public handleVerticalScrollbarMouse
handleVerticalScrollbarMouse(mouse as MouseEvent, localX as Int, localY as Int, viewWidth as Int, viewHeight as Int, totalLines as Long, topInset as Int = 0, bottomInset as Int = 0, rightInset as Int = 0) as Boolean
Handles mouse interaction with the vertical scrollbar.
public hasVerticalScrollbar
hasVerticalScrollbar(totalLines as Long, viewWidth as Int, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Boolean
Returns true when a vertical scrollbar is needed.
public maxScrollOffsetFor
maxScrollOffsetFor(totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Long
Computes the maximal vertical scroll offset for the given content size.
public override paintToFrame
paintToFrame(frame as TerminalFrame, row as Int, col as Int, width as Int, height as Int) as Boolean
No summary.
public scrollByAmount
scrollByAmount(delta as Int, totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Boolean
Scrolls vertically by the requested delta.
public scrollToTrackRow
scrollToTrackRow(trackRow as Int, totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Boolean
Scrolls to the absolute track row targeted by the mouse.
public scrollbarColumn
scrollbarColumn(viewWidth as Int, rightInset as Int = 0) as Int
Returns the track column for the vertical scrollbar.
public scrollbarThumbSize
scrollbarThumbSize(totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Int
Returns the scrollbar thumb size in rows.
public scrollbarThumbTop
scrollbarThumbTop(totalLines as Long, viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Int
Returns the scrollbar thumb top row relative to the viewport.
public selectedText
selectedText() as String
Returns the text currently selected in the scroll view.
public override terminalPromptVisible
terminalPromptVisible() as Boolean
No summary.
public override toString
toString() as String
Returns full textual content of the view.
public visibleRowCount
visibleRowCount(viewHeight as Int, topInset as Int = 0, bottomInset as Int = 0) as Int
Returns the number of visible rows available for scrollable content.
Inherited Methods
methodInherited Methods from Widget: add, baseAnsiStyle, captureRenderFrame, children, clearChildren, configureCursor, focusNext, handleEvent, handleMouseEvent, hasActiveTextInput, idle, paint, paintToFrame, performLayout, refresh, renderAnsiSnapshot, renderPlainSnapshot, scrollbarThumbGlyph, scrollbarTrackGlyph, terminalPromptVisible
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml