MCPcopy Index your code
hub / github.com/g3n/engine / scrollDown

Method scrollDown

gui/table.go:721–740  ·  view source on GitHub ↗

ScrollDown scrolls the table the specified number of rows down if possible

(n int)

Source from the content-addressed store, hash-verified

719
720// ScrollDown scrolls the table the specified number of rows down if possible
721func (t *Table) scrollDown(n int) {
722
723 // Calculates number of rows to scroll down
724 maxFirst := t.calcMaxFirst()
725 maxScroll := maxFirst - t.firstRow
726 if maxScroll <= 0 {
727 return
728 }
729 if n > maxScroll {
730 n = maxScroll
731 }
732
733 t.firstRow += n
734 if t.rowCursor < t.firstRow {
735 t.rowCursor = t.firstRow
736 t.Dispatch(OnChange, nil)
737 }
738 t.recalc()
739 return
740}
741
742// ScrollUp scrolls the table the specified number of rows up if possible
743func (t *Table) scrollUp(n int) {

Callers 3

onScrollMethod · 0.95
selNextMethod · 0.95
nextPageMethod · 0.95

Calls 3

calcMaxFirstMethod · 0.95
recalcMethod · 0.95
DispatchMethod · 0.65

Tested by

no test coverage detected