home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / borland / jnfb88.arc / PDOWN.ARC / STATUS1.PRO < prev    next >
Text File  |  1987-10-09  |  4KB  |  115 lines

  1. /* Listing1 */
  2.  
  3. /*  Pulldown window action corresponding to input key and
  4. spulldown
  5.     window  state */
  6.  
  7.   pdwkeyact(right,ROW,COL,up,MAXROW,MAXCOL,LEN,ATTR,LIST,SLIST,cont):-
  8.     nextcol(COL,1,COL1,MAXCOL),
  9.     pdwmovevert(COL,COL1,ATTR,LIST),
  10.     setstatus(COL1,ROW,SLIST,up), 
  11.     changepdwstate(pdwstate(ROW,COL1,up,MAXROW,LEN)).
  12.  
  13.   pdwkeyact(right,ROW,COL,down,_,MAXCOL,_,ATTR,LIST,SLIST,cont):-
  14.     nextcol(COL,1,COL1,MAXCOL),
  15.     check_removewindow(ROW),
  16.     pdwmovevert(COL,COL1,ATTR,LIST),
  17.     makepdwwindow(COL1,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
  18.     setstatus(COL1,0,SLIST,down),
  19.     changepdwstate(pdwstate(FIRSTROW,COL1,down,MAXROW1,LEN1)).
  20.  
  21.   pdwkeyact(left,ROW,COL,up,MAXROW,MAXCOL,LEN,ATTR,LIST,SLIST,cont):-
  22.     nextcol(COL,-1,COL1,MAXCOL),
  23.     pdwmovevert(COL,COL1,ATTR,LIST),
  24.     setstatus(COL1,ROW,SLIST,up),
  25.     changepdwstate(pdwstate(ROW,COL1,up,MAXROW,LEN)).
  26.  
  27.   pdwkeyact(left,ROW,COL,down,_,MAXCOL,_,ATTR,LIST,SLIST,cont):-
  28.     nextcol(COL,-1,COL1,MAXCOL),
  29.     check_removewindow(ROW),
  30.     pdwmovevert(COL,COL1,ATTR,LIST),
  31.     makepdwwindow(COL1,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
  32.     setstatus(COL1,0,SLIST,down), 
  33.     changepdwstate(pdwstate(FIRSTROW,COL1,down,MAXROW1,LEN1)).
  34.  
  35.   pdwkeyact(up,ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,SLIST,cont):-
  36.     ROW>1,!,
  37.     ROW1=ROW-1,
  38.     field_attr(ROW,1,LEN,ATTR),
  39.     pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
  40.     pdwindex(ROW1,LIST,WORD),
  41.     intenseletter(ROW,1,ATTR,WORD),
  42.     reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
  43.     cursor(ROW1,1),
  44.     R=ROW1-1,
  45.     setstatus(COL,R,SLIST,down), 
  46.     changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)).
  47.     
  48.    pdwkeyact(down,ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,SLIST,cont):-
  49.     ROW<MAXROW,!,
  50.     ROW1=ROW+1,
  51.     field_attr(ROW,1,LEN,ATTR),
  52.     pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
  53.     INDX=ROW-1,pdwindex(INDX,LIST,WORD),
  54.     intenseletter(ROW,1,ATTR,WORD),
  55.     reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
  56.     cursor(ROW1,1),
  57.     setstatus(COL,ROW,SLIST,down), 
  58.     changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)).
  59.     
  60.   
  61.   pdwkeyact(down,_,COL,up,_,_,_,ATTR,LIST,SLIST,cont):-
  62.     makepdwwindow(COL,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
  63.     setstatus(COL,0,SLIST,down),
  64.     changepdwstate(pdwstate(FIRSTROW,COL,down,MAXROW1,LEN1)).
  65.  
  66.   pdwkeyact(cr,_,COL,up,_,_,_,ATTR,LIST,SLIST,stop):-
  67.     makepdwwindow(COL,ATTR,LIST,MAXROW1,LEN1,FIRSTROW),
  68.     setstatus(COL,0,SLIST,down),
  69.     changepdwstate(pdwstate(FIRSTROW,COL,down,MAXROW1,LEN1)),
  70.     FIRSTROW=0,
  71.     CH=COL+1, SUBCH=0,
  72.     not(pdwaction(CH,SUBCH)).
  73.  
  74.   pdwkeyact(cr,ROW,COL,down,_,_,_,_,_,_,stop):-
  75.     CH=COL+1, SUBCH=ROW,
  76.     not(pdwaction(CH,SUBCH)),
  77.     check_removewindow(ROW).
  78.  
  79.   pdwkeyact(char(CHAR),ROW,COL,UP,_,_,_,ATTR,PDWLIST,SLIST,stop):-
  80.     is_up(UP,ROW),!,
  81.     pdwlist_strlist(PDWLIST,STRLIST),
  82.     tryletter(CHAR,STRLIST,SEL),NEWCOL=SEL,
  83.     pdwmovevert(COL,NEWCOL,ATTR,PDWLIST),
  84.     makepdwwindow(NEWCOL,ATTR,PDWLIST,MAXROW1,LEN1,FIRSTROW),
  85.     setstatus(NEWCOL,ROW,SLIST,up),
  86.     setstatus(NEWCOL,0,SLIST,down),
  87.     changepdwstate(pdwstate(FIRSTROW,NEWCOL,down,MAXROW1,LEN1)),
  88.     FIRSTROW=0,
  89.     CH=NEWCOL+1, SUBCH=0,
  90.     not(pdwaction(CH,SUBCH)).
  91.  
  92.   pdwkeyact(char(CHAR),ROW,COL,down,MAXROW,_,LEN,ATTR,PDWLIST,
  93.             SLIST, stop):-
  94.     ROW><0,
  95.     pdwindex(COL,PDWLIST,curtain(_,_,LIST)),
  96.     tryletter(CHAR,LIST,SEL),ROW1=SEL+1,
  97.     field_attr(ROW,1,LEN,ATTR),
  98.     R=ROW-1,
  99.     pdwindex(R,LIST,OLDWORD),
  100.     intenseletter(ROW,1,ATTR,OLDWORD),
  101.     reverseattr(ATTR,REV),field_attr(ROW1,1,LEN,REV),
  102.     cursor(ROW1,1),
  103.     CH=COL+1, SUBCH=ROW1,
  104.     R2=ROW1-1,
  105.     setstatus(COL,R2,SLIST,down),
  106.     changepdwstate(pdwstate(ROW1,COL,down,MAXROW,LEN)),
  107.     not(pdwaction(CH,SUBCH)),
  108.     removewindow.
  109.  
  110.   pdwkeyact(esc,ROW,COL,down,_,_,_,_,_,SLIST,cont):-
  111.     check_removewindow(ROW),
  112.     setstatus(COL,ROW,SLIST,up), 
  113.     changepdwstate(pdwstate(0,COL,up,0,0)).
  114.  
  115.