Scrolling
trait Scrolling
Properties
| int | $scroll | The number of items to display before scrolling. |
|
| int|null | $highlighted | The index of the highlighted option. |
|
| int | $firstVisible | The index of the first visible option. |
Methods
void
initializeScrolling(int|null $highlighted = null)
Initialize scrolling.
void
reduceScrollingToFitTerminal()
Reduce the scroll property to fit the terminal height.
void
highlight(int|null $index)
Highlight the given index.
void
highlightPrevious(int $total, bool $allowNull = false)
Highlight the previous entry, or wrap around to the last entry.
void
highlightNext(int $total, bool $allowNull = false)
Highlight the next entry, or wrap around to the first entry.
void
scrollToHighlighted(int $total)
Center the highlighted option.
Details
at line 29
protected void
initializeScrolling(int|null $highlighted = null)
Initialize scrolling.
at line 39
protected void
reduceScrollingToFitTerminal()
Reduce the scroll property to fit the terminal height.
at line 49
protected void
highlight(int|null $index)
Highlight the given index.
at line 67
protected void
highlightPrevious(int $total, bool $allowNull = false)
Highlight the previous entry, or wrap around to the last entry.
at line 85
protected void
highlightNext(int $total, bool $allowNull = false)
Highlight the next entry, or wrap around to the first entry.
at line 101
protected void
scrollToHighlighted(int $total)
Center the highlighted option.