home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carsten's PPE Collection
/
Carstens_PPE_Collection_2007.zip
/
S
/
SDE-ZI11.ZIP
/
SDE-ZL.PPS
< prev
next >
Wrap
Text File
|
1995-12-30
|
5KB
|
236 lines
*$USEFUNCS
* //////// LIGHTBAR PROCEDURE DECLARATiONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
declare procedure bs_clearline(integer bn)
declare procedure bs_drawline(integer bn)
declare procedure bs_setupbars(integer x, integer y, integer w, integer num)
declare procedure bs_barup()
declare procedure bs_bardown()
declare function bs_select() integer
* /////////////////// PROCEDURE DECLARATiONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
declare procedure changeopts()
declare procedure maingfx()
declare procedure init()
declare function colorstr(string cstr, string c1, string c2, string c3) string
declare function read(integer ra, integer rb,integer hr) string
* /////////////////////// LIGHTBAR VARS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
string bars(10)
string dec(10)
integer actbar, barx, bary, barw, barn
boolean bs_enter, exit
* ///////////////////////// GLOBAL VARS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
int sel
string cmd,zippystr,optstr
boolean abort
begin
if (len(lastans()) <= 2) then
init()
cmd = "Z "
If ((left(upper(lastAns()), 1) = "L")) cmd = "L "
maingfx()
print "@X0B"
zippystr = read(17,6,44)
if (zippystr != "") then
optstr = ""
cls
if (bars(0) = "ALL") join 1
if (bars(1) = "ON ") optstr = " D"
if (bars(2) = "ON ") optstr = optstr + " NS"
kbdstuff cmd + zippystr + " A" + optstr+ chr(13)
else
cls
println colorstr("ZIPPY SCAN/LOCATE DONE BY STEAM/SDE ANSI BY OBI^WAN/SDE. ", "@X05", "@X0D","@X0F")
println colorstr("ABORTED ...", "@X08", "@X07","@X0F")
newline
endif
else
kbdstuff lastans()
endif
end
* ///////////////////// PROCEDURES n FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\
procedure changeopts()
exit = FALSE
while (exit = FALSE) do
sel = bs_select()
select case (sel)
case 99 : exit = TRUE
end select
endwhile
endproc
function colorstr(string cstr, string c1, string c2, string c3) string
string s1, x
int i1, l1
l1 = 0
s1 = ""
for i1 = 1 to len(cstr)
x = mid(cstr, i1, 1)
if (x <> " ") then
select case l1
case 0
s1 = s1 + c1
case 1
s1 = s1 + c2
case 2
s1 = s1 + c3
end select
inc l1
s1 = s1 + x
else
s1 = s1 + x
l1 = 0
endif
next
colorstr = s1
endfunc
function read(integer ra, integer rb,integer hr) string
string sr,cr
integer ro
boolean doner
abort = FALSE
ansipos ra,rb
sr = ""
doner = FALSE
while (doner = FALSE) do
cr = inkey()
ro = asc(cr)
if ((cr != "DOWN") && (cr != "UP") && (cr != "LEFT") && (cr != "RIGHT") && (ro != 9) && (ro != 27)) then
if (ro = 13) then
doner = TRUE
else
if (ro = 8) then
if (len(sr) > 0) then begin
sr = mid(sr,1, len(sr)-1)
print cr + "@X0F·@X0B" + cr
endif
else
if (len(sr) < hr) then
sr = sr + cr
if (cr = " ") then
print "@X0F·@X0B"
else
print cr
endif
endif
endif
endif
else
if (ro = 9) then
changeopts()
bs_setupbars(75,12,3 ,2)
print "@X0B"
ansipos ra+len(sr),rb
endif
if (ro = 27) then
doner = TRUE
abort = TRUE
endif
endif
endwhile
read = sr
endfunc
procedure maingfx()
cls
startdisp fns
if (cmd = "Z ") then
dispfile ppepath() + "zippyscn.pcb", graph
else
dispfile ppepath() + "locate.pcb", graph
endif
bs_setupbars(75,12,3 ,2)
endproc
procedure init()
bars(0) = "ALL"
bars(1) = "OFF"
bars(2) = "OFF"
bars(3) = " "
bars(4) = "CUR"
bars(5) = "ON "
bars(6) = "ON "
bars(7) = " "
endproc
* ///////////////////// LIGHTBAR STUFF \\\\\\\\\\\\\\\\\\\\\\\\\\\\
procedure bs_clearline(integer bn)
string s
ansipos barx, bary + bn
print "@X05" + bars(bn) + space(barw - len(bars(bn)))
endproc
procedure bs_drawline(integer bn)
string s
ansipos barx, bary + bn
print "@X1F" + upper(bars(bn)) + space(barw - len(bars(bn))) + "@X07"
endproc
procedure bs_setupbars(integer x, integer y, integer w, integer num)
integer i
barx = x
bary = y
barw = w
barn = num + 1
for i = 0 to num
ansipos x, y+i
print "@X05" + bars(i)
next
actbar = 0
endproc
procedure bs_barup()
bs_clearline(actbar)
actbar = (actbar + 1) % barn
bs_drawline(actbar)
endproc
procedure bs_bardown()
bs_clearline(actbar)
actbar = (actbar - 1 + barn) % barn
bs_drawline(actbar)
endproc
function bs_select() integer
string c,tmp
byte o
boolean done
bs_drawline(actbar)
bs_enter = TRUE;
done = FALSE;
while (done = FALSE) do
c = inkey()
o = asc(c)
select case (o)
case 13
tmp = bars(actbar)
bars(actbar) = bars(actbar + 4)
bars(actbar + 4) = tmp
bs_drawline(actbar)
case 27,9
done = TRUE
actbar = 99
case 68, 122
bs_barup()
case 85, 97
bs_bardown()
end select
endwhile
bs_select = actbar
endfunc