From f0df96684418bd1819652908d721a2492f36469b Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Mon, 23 May 2022 20:45:24 +0100 Subject: [PATCH] make bar go up to last item if list has fewer items than where the bar is currently --- mL-nlparse.mpy | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/mL-nlparse.mpy b/mL-nlparse.mpy index 105da9a..b723088 100755 --- a/mL-nlparse.mpy +++ b/mL-nlparse.mpy @@ -193,7 +193,7 @@ def showList(offset = 0): global filter global fDictSortedLen #gotoxy(68,24); write("|19|11"+str(len(filter))+" ") - gotoxy(10,1); write("|19|11["+str(fDictSortedLen).ljust(4)+"]") + gotoxy(10,1); write("|19|11["+str(fDictSortedLen).rjust(4)+"]") R = 1 count = 0 gotoxy(1,2) @@ -215,6 +215,8 @@ def showList(offset = 0): else: R += 1 if R < screenDepth: + if barOffset > fDictSortedLen-1: + barOffset = fDictSortedLen if barOffset+1 == R: gotoxy(1,R) write('|21|15') @@ -260,14 +262,16 @@ def drawWindow(x1, y1, x2, y2, title = ""): def showHelp(): write("|SS") - drawWindow(10,4,70,23,"Help Menu") - gotoxy(13,6); write("|15To use this BBS lister just remember a few simple key") - gotoxy(13,7); write("|15bindings. There aren't many... ") - gotoxy(13,8); write("|15 ") - gotoxy(13,9); write("|15In the LIST view: ") - gotoxy(13,10);write("|15UP/DOWN Arrows move the bar UP/DOWN a line. ") - gotoxy(13,11);write("|15LEFT/RIGHT or PGUP/PGDN moves the list 1 page UP/DN ") - gotoxy(13,12);write("|15ENTER chooses the highlighted BBS to see more detail.") + drawWindow(10,2,70,23,"Help Menu") + gotoxy(13,4); write("|15To use this BBS lister just remember a few simple key") + gotoxy(13,5); write("|15bindings. There aren't many... ") + gotoxy(13,6); write("|15 ") + gotoxy(13,7); write("|15In the LIST view: ") + gotoxy(13,8);write("|15UP/DOWN Arrows move the bar UP/DOWN a line. ") + gotoxy(13,9);write("|15LEFT/RIGHT or PGUP/PGDN moves the list 1 page UP/DN ") + gotoxy(13,10);write("|15ENTER chooses the highlighted BBS to see more detail.") + gotoxy(13,11);write("|15 ") + gotoxy(13,12);write("|15Start typing letters/numbers to live-filter the list!") gotoxy(13,13);write("|15 ") gotoxy(13,14);write("|15In the BBS Detail view: ") gotoxy(13,15);write("|15LEFT/RIGHT allows you to rate the BBS from 0-7 ")