home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
borland
/
jnfb88.arc
/
PDOWN.ARC
/
STATUS1.PRO
< prev
next >
Wrap
Text File
|
1987-10-09
|
4KB
|
115 lines
/* Listing1 */
/* Pulldown window action corresponding to input key and
spulldown
window state */
pdwkeyact(right,ROW,COL,up,MAXROW,MAXCOL,LEN,ATTR,LIST,SLIST,cont):-
nextcol(COL,1,COL1,MAXCOL),
pdwmovevert(COL,COL1,ATTR,LIST),
setstatus(COL1,ROW,SLIST,up),
changepdwstate(pdwstate(ROW,COL1,up,MAXROW,LEN)).
pdwkeyact(right,ROW,COL,down,_,MAXCOL,_,ATTR,LIST,SLIST,cont):-
nextcol(COL,1,COL1,MAXCOL),
check_removewindow(ROW),
pdwmovevert(COL,COL1,ATTR,LIST),
makepdwwindow(COL1,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
setstatus(COL1,0,SLIST,down),
changepdwstate(pdwstate(FIRSTROW,COL1,down,MAXROW1,LEN1)).
pdwkeyact(left,ROW,COL,up,MAXROW,MAXCOL,LEN,ATTR,LIST,SLIST,cont):-
nextcol(COL,-1,COL1,MAXCOL),
pdwmovevert(COL,COL1,ATTR,LIST),
setstatus(COL1,ROW,SLIST,up),
changepdwstate(pdwstate(ROW,COL1,up,MAXROW,LEN)).
pdwkeyact(left,ROW,COL,down,_,MAXCOL,_,ATTR,LIST,SLIST,cont):-
nextcol(COL,-1,COL1,MAXCOL),
check_removewindow(ROW),
pdwmovevert(COL,COL1,ATTR,LIST),
makepdwwindow(COL1,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
setstatus(COL1,0,SLIST,down),
changepdwstate(pdwstate(FIRSTROW,COL1,down,MAXROW1,LEN1)).
pdwkeyact(up,ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,SLIST,cont):-
ROW>1,!,
ROW1=ROW-1,
field_attr(ROW,1,LEN,ATTR),
pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
pdwindex(ROW1,LIST,WORD),
intenseletter(ROW,1,ATTR,WORD),
reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
cursor(ROW1,1),
R=ROW1-1,
setstatus(COL,R,SLIST,down),
changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)).
pdwkeyact(down,ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,SLIST,cont):-
ROW<MAXROW,!,
ROW1=ROW+1,
field_attr(ROW,1,LEN,ATTR),
pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
INDX=ROW-1,pdwindex(INDX,LIST,WORD),
intenseletter(ROW,1,ATTR,WORD),
reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
cursor(ROW1,1),
setstatus(COL,ROW,SLIST,down),
changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)).
pdwkeyact(down,_,COL,up,_,_,_,ATTR,LIST,SLIST,cont):-
makepdwwindow(COL,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
setstatus(COL,0,SLIST,down),
changepdwstate(pdwstate(FIRSTROW,COL,down,MAXROW1,LEN1)).
pdwkeyact(cr,_,COL,up,_,_,_,ATTR,LIST,SLIST,stop):-
makepdwwindow(COL,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
setstatus(COL,0,SLIST,down),
changepdwstate(pdwstate(FIRSTROW,COL,down,MAXROW1,LEN1)),
FIRSTROW=0,
CH=COL+1, SUBCH=0,
not(pdwaction(CH,SUBCH)).
pdwkeyact(cr,ROW,COL,down,_,_,_,_,_,_,stop):-
CH=COL+1, SUBCH=ROW,
not(pdwaction(CH,SUBCH)),
check_removewindow(ROW).
pdwkeyact(char(CHAR),ROW,COL,UP,_,_,_,ATTR,PDWLIST,SLIST,stop):-
is_up(UP,ROW),!,
pdwlist_strlist(PDWLIST,STRLIST),
tryletter(CHAR,STRLIST,SEL),NEWCOL=SEL,
pdwmovevert(COL,NEWCOL,ATTR,PDWLIST),
makepdwwindow(NEWCOL,ATTR,PDWLIST,MAXROW1,LEN1,FIRSTROW),
setstatus(NEWCOL,ROW,SLIST,up),
setstatus(NEWCOL,0,SLIST,down),
changepdwstate(pdwstate(FIRSTROW,NEWCOL,down,MAXROW1,LEN1)),
FIRSTROW=0,
CH=NEWCOL+1, SUBCH=0,
not(pdwaction(CH,SUBCH)).
pdwkeyact(char(CHAR),ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,
SLIST, stop):-
ROW><0,
pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
tryletter(CHAR,LIST,SEL),ROW1=SEL+1,
field_attr(ROW,1,LEN,ATTR),
R=ROW-1,
pdwindex(R,LIST,OLDWORD),
intenseletter(ROW,1,ATTR,OLDWORD),
reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
cursor(ROW1,1),
CH=COL+1, SUBCH=ROW1,
R2=ROW1-1,
setstatus(COL,R2,SLIST,down),
changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)),
not(pdwaction(CH,SUBCH)),
removewindow.
pdwkeyact(esc,ROW,COL,down,_,_,_,_,_,SLIST,cont):-
check_removewindow(ROW),
setstatus(COL,ROW,SLIST,up),
changepdwstate(pdwstate(0,COL,up,0,0)).