Commit 15324cb9 authored by Philipp's avatar Philipp

fixed several lb refresh bugs

parent 5d92fa5b
No preview for this file type
......@@ -53,7 +53,7 @@ end
procedure RunMenu( byte pos )
begin
if ( left( cmds(pos), 1 ) == "%" ) then
DispFile Mid( cmds(pos), 2, len( cmds(pos)-1 ) ), DEFS
DispFile Right( cmds(pos), len( cmds(pos) ) -1 ), DEFS
wait
else
DispStr cmds(pos)
......@@ -95,7 +95,11 @@ begin
case "HOME", "H", "1"
opos = pos
pos = 1
olpos = lpos
if ( lstart = 1 ) then
olpos = lpos
else
olpos = 1
endif
lpos = 1
lstart = 1
keypress = 1
......@@ -109,12 +113,15 @@ begin
else
olpos = lpos
lpos = height
if ( olpos < lpos-height ) olpos = height
if ( lstart < numentries-height ) olpos = height
lstart = numentries-height+1
endif
keypress = 1
case "PGUP", "-", "[", "LEFT", "4"
if ( pos-height > 1 ) then
if ( height > numentries ) then
pos = 1
lpos = pos
else if ( pos-height > 1 ) then
pos = pos-height ;+lpos
if ( pos < lpos ) then
lpos = pos
......@@ -130,7 +137,10 @@ begin
endif
keypress = 1
case "PGDN", "+", "]", "RIGHT", "6"
if ( pos+height < numentries-height+1 ) then
if ( height > numentries ) then
pos = numentries
lpos = pos
else if ( pos+height < numentries-height+1 ) then
pos = pos+height+lpos
else
pos = numentries-height+lpos
......@@ -186,9 +196,9 @@ begin
if ( keypress ) then
; enable for debugging
; ansipos 1,22
; print "opos: "+ string(opos) +"; pos: "+ string(pos) +"; olpos: "+ string(olpos)
; print "; lpos: "+ string(lpos) +"; lstart: "+ string(lstart) +"; keypress: "+ string(keypress)
ansipos 1,23
print "opos: "+ string(opos) +"; pos: "+ string(pos) +"; olpos: "+ string(olpos)
print "; lpos: "+ string(lpos) +"; lstart: "+ string(lstart) +"; keypress: "+ string(keypress)
PrintLBLine( xpos, ypos+lpos-1, hlcol, entries(pos) )
keypress = 0
......@@ -215,9 +225,9 @@ endproc
function Center( string in ) string
begin
byte half
half = ( width - len( StripAtX( in ) )-1 )/2
half = ( width - len( StripAtX( in ) ) )/2
center = space( half ) + in + space( half )
if ( ( width - len( StripAtX( in ) )-1 )%2 > 0 ) then
if ( ( width - len( StripAtX( in ) ) )%2 > 0 ) then
center = center+" "
endif
endfunc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment