home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0770.lha / Uedit / Piotr.LZH / Super-Hyper < prev    next >
Text File  |  1991-04-28  |  16KB  |  531 lines

  1.  
  2.       .. >>>>>>>>>>>>>>>>>>>   Super-Hyper V0.28   <<<<<<<<<<<<<<<<< ..
  3.  
  4.       .. >>>>>>>>>>>>>>>>>>>    by Piotr Obminski  <<<<<<<<<<<<<<<<< ..
  5.       
  6.       .. >>>>>>>>>>>>>>>>>>>       14-Apr-91       <<<<<<<<<<<<<<<<< ..
  7.  
  8.  
  9. Just DO EVERYTHING!
  10. <alt-buttonDown:
  11.     if (geLoc(curFile,mouseLoc,eFile)) goto label(1)
  12.     equateLoc(curFile,atCursor,mouseLoc)
  13.     if (is(curFile,whiteSpace)) {
  14.     
  15. label(1)
  16.         if (HyperUp) {
  17.             
  18.             text(" ",0,0,7,-2)                              .. clear screen
  19.             
  20. text(" F1 ",2,8,6,0) 
  21.     text(" F2 ",2,27,6,0) 
  22.         text(" F3 ",2,46,6,0) 
  23.             text(" F4 ",2,66,6,0)
  24.             
  25. text("or",3,38,0,0)
  26.             
  27.   text("í-------------------- CLICK ON GADGET -------------------í",5,10,0,0)
  28.             
  29.             text(" ",9,10,3,60)
  30.             text(" ",10,10,3,60)
  31.             text(" HyperText is ON ",10,14,2,0)
  32.             text(" ",11,10,3,60)
  33.             text("   CURRENT HYPER FILE: ",12,10,3,60)
  34.             text(buf64,12,44,4,0)
  35.             text(" ",13,10,3,60)
  36.             text("      LAST HYPER WORD: ",14,10,3,60)
  37.             text(buf55,14,44,4,0)
  38.             text(" ",15,10,3,60)
  39.             
  40.             text(" ESCAPE ",20,5,6,0)
  41.             text("  or  ",20,-1,0,0)
  42.             text(" Q ",20,-1,6,0)
  43.             text("will also take you",22,5,0,0)
  44.             text("BACK TO EDITING MODE",23,4,0,0)
  45.             
  46.             text(" OPEN Hyper_WINDOW ",0,0,1,19)
  47.             text("    GO ON EDITING  ",0,19,5,38)
  48.             text("   NEW HyperFile  ",0,39,4,56)
  49.             text("    CLOSE HyperText  ",0,57,3,79)
  50.  
  51. label(0)
  52.             while (!inputKey(n52))
  53.                 delay(5)                                    .. don't refresh
  54.                 
  55.             .. Get word input and lookup hyper word, going into hyper text mode                
  56.             if (eqNum(n52,normal-gadget1) | eqNum(n52,normal-F1)) {
  57.                 runKey(1068)
  58.                 return
  59.             }
  60.                 
  61.             if (eqNum(n52,normal-gadget2) | eqNum(n52,normal-ESC) |
  62.                     eqNum(n52,normal-q) | eqNum(n52,shft-q) |
  63.                         eqNum(n52,normal-F2)) {
  64.                 putMsg("                                            ")
  65.                 refreshDisplay
  66.                 return
  67.             }
  68.             else if (eqNum(n52,normal-gadget3) | eqNum(n52,normal-F3)) {
  69.                 refreshDisplay
  70.                 putMsg("                                            ")
  71.                 runKey(1083)
  72.                 return
  73.             }
  74.             else if (eqNum(n52,normal-gadget4) | eqNum(n52,normal-F4)) {
  75.                     hyperClose
  76.                     freeBuf(buf52)
  77.                     freeBuf(buf53)
  78.                     freeBuf(buf55)
  79.                     freeBuf(buf56)
  80.                     freeBuf(buf64)
  81.                     putMsg("HyperText CLOSED!                        ")
  82.                     refreshDisplay
  83.                     return
  84.             }
  85.             else {
  86.                 goto label(0)
  87.             }
  88.  
  89.             freeBuf(buf51)
  90.             return
  91.         }
  92.         else {
  93.             putMsg("                                              ")
  94.             refreshDisplay
  95.             runKey(1083)                                .. requestor etc.
  96.             runKey(1054)
  97.             return
  98.         }
  99.     }
  100.     else {                                              .. not whiteSpace
  101.         if (HyperUp) {
  102.             runKey(1054)
  103.            freeBuf(buf55)
  104.            insertRgn(buf55,sFile,buf54,all)
  105.             runKey(1068)
  106.             return
  107.         }
  108.         else {
  109.             runKey(1054)
  110.             freeBuf(buf55)
  111.             insertRgn(buf55,sFile,buf54,all)
  112.            
  113.             runKey(1083)                                .. pseudo-requester
  114.             runKey(1068)
  115.             return
  116.         }
  117.     }
  118. >
  119.  
  120.  
  121. HyperText pseudo-requester etc.
  122. <1083:
  123.     freeBuf(buf50)
  124.     insertRgn(buf50,sFile,"U:HYPER/FILES",all)
  125.     if (!fileRequest(buf50,"Select HyperText File")) {
  126.         putMsg("User clearly didn't like any alternative...")
  127.         freeBuf(buf53)
  128.         freeBuf(buf64)
  129.         hyperClose
  130.         ..
  131.         freeBuf(buf52)
  132.         freeBuf(buf53)
  133.         freeBuf(buf55)
  134.         freeBuf(buf56)
  135.         freeBuf(buf64)
  136.         ..
  137.         return
  138.     }
  139.     
  140.     moveCursor(buf50,sFile)
  141.     moveCursor(buf50,downLine)
  142.     freeBuf(buf56)
  143.     insertRgn(buf56,sFile,buf50,line)   .. later - try to change buf56 -> buf52    
  144.     
  145.     if (HyperUp) {
  146.     
  147. .. first let's see if not the OLD ONE is DESIRED again
  148.  
  149.         stringComp(n52,buf64,buf56,1)
  150.         
  151.         if (eqNum(n52,0)) {                     .. SAME HyperFile file wanted!
  152.           putMsg("OLD HyperText file STAYING with us!")
  153.           return
  154.         }
  155.         else {                                  .. NEW HyperFile one is wanted
  156.             hyperClose
  157.             freeBuf(buf53)
  158.             freeBuf(buf55)
  159.             freeBuf(buf64)
  160.             if (HyperOpen(buf50,buf51,1)) {
  161.                 equateNum(n93,0)
  162.                 freeBuf(buf64)
  163.                 insertRgn(buf64,sFile,buf56,all)
  164.                 putMsg("NEW HyperText OPENED!                       ")
  165.                 return
  166.             }
  167.         }
  168.     }
  169.     
  170.     moveCursor(buf50,sFile)
  171.     moveCursor(buf50,downLine)
  172.                                         .. now create full name of the LookUp
  173.                                         .. table in buf51
  174.     freeBuf(buf51)
  175.     insertRgn(buf51,sFile,buf50,all)
  176.     moveCursor(buf51,sFile)
  177.     moveCursor(buf51,eLine)
  178.     equateLoc(buf51,locA,atCursor)
  179.     moveCursor(buf51,sWord)
  180.     equateLoc(buf51,locB,atCursor)
  181.     clearRgn(buf51,loc)                         .. 'loc' is locA - locB !!
  182.     insertRgn(buf51,atCursor,"TABLES/",all)
  183.     clearChar(buf51)                            .. or next char?
  184.     
  185.     insertRgn(buf51,eFile,".tbl",all)
  186.     
  187.     moveCursor(buf50,sFile)
  188.     moveCursor(buf50,eLine)
  189.     
  190.     clearChar(buf50)
  191.     
  192.     if (HyperOpen(buf50,buf51,1)) {
  193.         equateNum(n93,0)
  194.         freeBuf(buf64)
  195.         insertRgn(buf64,sFile,buf56,all)
  196.         putMsg("HyperText OPENED!                          ")
  197.         return
  198.     }                                                   .. not loaded but
  199.                                                         .. maybe already ON?
  200.     text(" ",1,0,6,-1)
  201.     text(" ",2,0,6,-1)
  202.     text(" ",3,0,6,-1)
  203.     text(" Opening THIS HyperText File FAILED ",2,20,0,36)
  204.     text("   Try to open  ANOTHER  HyperText",0,0,3,39)
  205.     text("                CANCEL",0,39,2,79)
  206.  
  207. label(0)
  208.             while (!inputKey(n52))
  209.                 delay(5)                                .. don't refresh
  210.                 
  211.             if (eqNum(n52,normal-gadget1) | 
  212.                     eqNum(n52,normal-gadget2)) {
  213.                 putMsg("                                            ")
  214.                 runKey(1083)
  215.                 refreshDisplay
  216.                 return
  217.             }
  218.             else if (eqNum(n52,normal-gadget4) |
  219.                         eqNum(n52,normal-gadget3)) {
  220.                     putMsg("                                        ")
  221.                     refreshDisplay
  222.                     return
  223.             }
  224.             else {
  225.                 goto label(0)
  226.             }
  227. >
  228.     
  229.     
  230. Capture hyper word or phrase (scavenged from Config!H)
  231. <1054:
  232.     moveCursor(curFile,mouseLoc)
  233.     if (!is(curFile,sWord)) moveCursor(curFile,sWord)
  234.     while (!is(curFile,"<")
  235.                 & !is(curFile,eLine)
  236.                     & !is(curFile,">")
  237.                         & moveCursor(curFile,sChar)) nothing
  238.      
  239.     freeBuf(buf54)
  240.     if (is(curFile,"<")) {                          .. copy the hyper phrase
  241.         moveCursor(curFile,eChar)
  242.         equateNum(n52,0)
  243.         while (nothing) {
  244.             copyChar(curFile,n53)
  245.             moveCursor(curFile,eChar)
  246.             if (eqNum(n53,">")) goto label(0)
  247.             insertChar(buf54,n53)
  248.             incNum(n52)
  249.             if (geNum(n52,17)) goto label(0)
  250.         }
  251.         label(0)
  252.     } 
  253.     else {                                            .. copy just this word
  254.         moveCursor(curFile,mouseLoc)
  255.         if (!is(curFile,sWord)) moveCursor(curFile,sWord)
  256.         insertRgn(buf54,eFile,curFile,word)
  257.     }
  258. >
  259.  
  260.  
  261. Forbid tiny window (scavenged from Config!H)
  262. <1099: 
  263.     if (!inTiny) 
  264.         return
  265.     toggle(toTiny)
  266.     refreshDisplay
  267. >
  268.  
  269.  
  270. Hyper lookup mode  (scavenged from Config!H)
  271. <1068:                              .. <hyper word> is in buf54, index is in n93
  272.     runKey(1099)
  273.     if (gtNum(0,n93)) equateNum(n93,0)
  274.     equateNum(n92,curFile)
  275.     if (!hyper(buf53,buf54,n93,0)) {    .. find word starting from n93
  276.         freeBuf(buf54)                  .. find word starting from top of table
  277.         if (!hyper(buf53,buf54,0,0)) return
  278.     }
  279.     
  280. label(50)
  281.     if (!eqNum(curFile,buf53) & !gotoSplit(buf53)) {
  282.         if (!splitWindow(buf53,18)) {
  283.             if (alertUser("CLOSE ALL WINDOWS EXCEPT THE CURRENT ONE?")) {
  284.                 toggle(WINDOWSPLIT)
  285.                 while (!eqNum(curFile,buf[n92])) {
  286.                     splitWindow(curFile,0)
  287.                     toggle(WINDOWSPLIT)
  288.                     goto label(50)
  289.                 }
  290.             }
  291.             else {
  292.                 putMsg("O.K. but close a window or two if you need HyperText.")
  293.                 return
  294.             }
  295.         }
  296.     }
  297.     refreshDisplay
  298.     
  299.     runKey(1084)
  300.     
  301. label(98)
  302.     equateNum(n55,0)                .. 0 = no text() needed; 1 = yes please!
  303.     runKey(1099)
  304.     while (mouseDown) inputKey(n54)
  305.     getKeyVal(n54,inputChar)
  306.     runKey(1099)
  307.     
  308.     if (eqNum(inputChar,10)) {
  309.         equateLoc(curFile,mouseLoc,atCursor)
  310.         runKey(1054)
  311.         goto label(96)
  312.     }
  313.     runKey(1099)                                    .. forbid tiny window
  314.     
  315.     switch(n54) {
  316.         case(normal-closeBox)
  317.         case(normal-ESC) {
  318.             gotoSplit(buf[n92])
  319.             splitWindow(buf53,0)                    .. close it if made it
  320.             freeBuf(buf54)
  321.             freeBuf(buf53)
  322.             refreshDisplay
  323.             putMsg("                                                  ")
  324.             return
  325.         }
  326.         case(normal-buttonDown) {                    .. scroll OR place cursor
  327.             runKey(1099)
  328.             moveCursor(curFile,mouseLoc)
  329.             updateDisplay
  330.             mouseXY(n0,n1)
  331.             equateNum(n4,0)
  332.             if (mouseDown) while (not inputWaiting) {
  333.                 runKey(1099)
  334.                 trackMouse
  335.                 mouseXY(n2,n3)
  336.                 sub(n3,n3,n1)
  337.                 div(n3,n3,5)
  338.                 if (!eqNum(n3,0)) {
  339.                   vScroll(n3)
  340.                   updateDisplay
  341.                   equateNum(n4,1)
  342.                 }
  343.             }
  344.             runKey(1099)
  345.             if (eqNum(n4,1)) refreshDisplay
  346.             goto label(98)
  347.         }
  348.         
  349.         case(alt-buttonDown) {
  350.             runKey(1054)
  351. label(96)
  352.             if (gtNum(0,n93)) equateNum(n93,0)
  353.             if (eqNum(0,n93)) {
  354. label(97)                                                .. try from top of table
  355.                 if (!hyper(buf52,buf54,n93,0)) {
  356.                     freeBuf(buf55)
  357.                     insertRgn(buf55,sFile,buf54,all)
  358.                     goto label(98)
  359.                 }
  360.             } 
  361.             else {                                    .. try algorithm
  362.                 if (!hyper(buf52,buf54,n93,1) & !hyper(buf52,buf54,n93,2)) {
  363.                     freeBuf(buf55)
  364.                     insertRgn(buf55,sFile,buf54,all)
  365.                     goto label(97)
  366.                 }
  367.             }
  368.         }
  369.         case(normal-F1) {
  370.             freeBuf(buf54)
  371.             equateNum(n93,0)                .. set index to 0 for top of tree
  372.             if (!hyper(buf52,buf54,n93,0)) {   .. goto index word (top of tree)
  373.                 goto label(98)
  374.             }
  375.             equateNum(n55,1)
  376.         }
  377.         case(normal-F2) {
  378.             freeBuf(buf54)
  379.             if (!hyper(buf52,buf54,n93,1)) {            .. goto parent of n93
  380.                 goto label(98)
  381.             }
  382.             equateNum(n55,1)
  383.         }
  384.         case(normal-F3) {
  385.             freeBuf(buf54)
  386.             if (!hyper(buf52,buf54,n93,2)) {            .. goto child of n93
  387.                 goto label(98)
  388.             }
  389.             equateNum(n55,1)
  390.         }
  391.         case(normal-F4) {
  392.             freeBuf(buf54)
  393.             if (!hyper(buf52,buf54,n93,3)) {        .. goto next sibling of n93
  394.                 goto label(98)
  395.             }
  396.             equateNum(n55,1)
  397.         }
  398.         case(normal-F5) {
  399.             freeBuf(buf54)
  400.             if (!hyper(buf52,buf54,n93,4)) {        .. goto prev sibling of n93
  401.                 goto label(98)
  402.             }
  403.             equateNum(n55,1)
  404.         }
  405.         case(normal-F6) {
  406.             equateNum(n55,1)
  407.             freeBuf(buf54)
  408.             if (!hyper(buf52,buf54,n93,5)) {                .. goto last lookup
  409.                 goto label(98)
  410.             }
  411.             equateNum(n55,1)
  412.         }
  413.         case(normal-F7) {                               .. get hyper word input
  414.             equateNum(n55,1)
  415.         
  416.             text(" ",0,0,7,-1)
  417.                 text("Input hyper word/phrase to look up:",0,0,5,0)
  418.                     text(" ",1,0,7,-1)
  419.                         text(" ",2,0,7,-1)
  420.                             text(" ",3,0,7,-1)
  421.                                 text(" ",4,0,7,-1)
  422.                                     text(" ",5,0,7,-1)
  423.                                         text(" ",6,0,7,-1)
  424.                                             text(" ",7,0,7,-1)
  425.                                                 text(" ",8,0,7,-1)
  426.                                                     text(" ",9,0,7,-1)
  427.                                                     
  428.             while (!inputWaiting) delay(5)
  429.             freeBuf(buf54)
  430.             runKey(1099)
  431.             inputString(buf54)
  432.             goto label(96)
  433.         }
  434.         case(normal-F8) {                .. get hyper word of next index value
  435.             incNum(n93)
  436.             freebuf(buf54)
  437.             if (!hyper(buf52,buf54,n93,0)) {
  438.                 equateNum(n93,0)
  439.                 goto label(98)
  440.             }
  441.             equateNum(n55,1)
  442.         }
  443.         case(normal-F9) {                .. get hyper word of prev index value
  444.             if (gtNum(n93,0)) decNum(n93)
  445.             freeBuf(buf54)
  446.             if (!hyper(buf52,buf54,n93,0)) {
  447.                 goto label(98)
  448.             }
  449.             equateNum(n55,1)
  450.         }
  451.         case(normal-upArrow) {
  452.             moveCursor(curFile,upLine)
  453.             updateDisplay
  454.             
  455.             goto label(98)
  456.         }
  457.         case(normal-downArrow) {
  458.             moveCursor(curFile,downLine)
  459.             updateDisplay
  460.             goto label(98)
  461.         }
  462.         case(normal-leftArrow) {
  463.             moveCursor(curFile,sWord)
  464.             updateDisplay
  465.             goto label(98)
  466.         }
  467.         case(normal-rightArrow) {
  468.             moveCursor(curFile,eWord)
  469.             updateDisplay
  470.             goto label(98)
  471.         }
  472.         default { goto label(98) }
  473.     }
  474.     runKey(1099)
  475.     swapBuf(buf52,buf53)
  476.     
  477.     getFileName(buf55,buf53)
  478.     
  479.     if (eqNum(n55,1)) runKey(1084)
  480.     
  481.     refreshDisplay
  482.     goto label(98)
  483. >
  484.  
  485. Text() based help display
  486. <1084:
  487.  
  488.     do (n56,0,10) text(" ",n56,0,3,-1)
  489.  
  490.         text("MOUSE & ARROWS",2,58,4,0)
  491.             text(" PLACE CURSOR & SCROLL ",3,54,7,0)
  492.  
  493.         text("alt-buttonDown",5,53,4,0)
  494.             text(" or ",5,-1,1,0)
  495.                 text("RETURN",5,-1,4,0)
  496.                     text(" LOOK UP CURSOR WORD ",6,55,7,0)
  497.         
  498.         text("ESC",8,58,4,0)
  499.             text(" or ",8,-1,1,0)
  500.                 text("closeBox",8,-1,4,0)
  501.                         text(" QUIT HyperText MODE ",9,55,7,0)
  502.         
  503.         text(" F1 ",1,2,6,0)
  504.             text(" GO TO BEGINNING of LookUp TABLE ",1,-1,7,45)
  505.             
  506.         text(" F2 ",2,2,6,0)
  507.             text(" GO TO PARENT of CURRENT WORD ",2,-1,7,45)
  508.         
  509.         text(" F3 ",3,2,6,0)
  510.             text(" GO TO CHILD of CURRENT WORD ",3,-1,7,45)
  511.             
  512.         text(" F4 ",4,2,6,0)
  513.             text(" GO TO NEXT SIBLING of CURRENT WORD ",4,-1,7,45)
  514.             
  515.         text(" F5 ",5,2,6,0)
  516.             text(" GO TO PREVIOUS SIBLING of CURRENT WORD ",4,-1,7,45)
  517.             
  518.         text(" F6 ",6,2,6,0)
  519.             text(" STEP BACK THRU LAST 20 WORDS ",4,-1,7,45)
  520.             
  521.         text(" F7 ",7,2,6,0)
  522.             text(" GET WORD INPUT & LOOK IT UP ",7,-1,7,45)
  523.             
  524.         text(" F8 ",8,2,6,0)
  525.             text(" GO FORWARD TO NEXT WORD in LookUp TABLE",8,-1,7,45)
  526.             
  527.         text(" F9 ",9,2,6,0)
  528.             text(" GO BACKWARD TO NEXT WORD in LookUp TABLE",9,-1,7,45)
  529. >
  530.  
  531.