ScrollDown scrolls the table the specified number of rows down if possible
(n int)
| 719 | |
| 720 | // ScrollDown scrolls the table the specified number of rows down if possible |
| 721 | func (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 |
| 743 | func (t *Table) scrollUp(n int) { |