make bar go up to last item if list has fewer items than where the bar is currently

This commit is contained in:
MeaTLoTioN 2022-05-23 20:45:24 +01:00
parent f0deae9e4d
commit f0df966844

View File

@ -193,7 +193,7 @@ def showList(offset = 0):
global filter global filter
global fDictSortedLen global fDictSortedLen
#gotoxy(68,24); write("|19|11"+str(len(filter))+" ") #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 R = 1
count = 0 count = 0
gotoxy(1,2) gotoxy(1,2)
@ -215,6 +215,8 @@ def showList(offset = 0):
else: else:
R += 1 R += 1
if R < screenDepth: if R < screenDepth:
if barOffset > fDictSortedLen-1:
barOffset = fDictSortedLen
if barOffset+1 == R: if barOffset+1 == R:
gotoxy(1,R) gotoxy(1,R)
write('|21|15') write('|21|15')
@ -260,14 +262,16 @@ def drawWindow(x1, y1, x2, y2, title = ""):
def showHelp(): def showHelp():
write("|SS") write("|SS")
drawWindow(10,4,70,23,"Help Menu") drawWindow(10,2,70,23,"Help Menu")
gotoxy(13,6); write("|15To use this BBS lister just remember a few simple key") gotoxy(13,4); write("|15To use this BBS lister just remember a few simple key")
gotoxy(13,7); write("|15bindings. There aren't many... ") gotoxy(13,5); write("|15bindings. There aren't many... ")
gotoxy(13,8); write("|15 ") gotoxy(13,6); write("|15 ")
gotoxy(13,9); write("|15In the LIST view: ") gotoxy(13,7); write("|15In the LIST view: ")
gotoxy(13,10);write("|15UP/DOWN Arrows move the bar UP/DOWN a line. ") gotoxy(13,8);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,9);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.") 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,13);write("|15 ")
gotoxy(13,14);write("|15In the BBS Detail view: ") gotoxy(13,14);write("|15In the BBS Detail view: ")
gotoxy(13,15);write("|15LEFT/RIGHT allows you to rate the BBS from 0-7 ") gotoxy(13,15);write("|15LEFT/RIGHT allows you to rate the BBS from 0-7 ")