home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / kpwdemo.zip / ENGINEDE.SRC < prev    next >
Text File  |  1990-06-28  |  2KB  |  91 lines

  1. displayInfo ().
  2.  
  3. if ?version is 3 then width is 83 else :width is 70.
  4. w1 is window (,5,2,?width,23,,[PopUp,ThickFrame,TitleBar,VertScroll,ShowChildren,Siblings],,,,close_event).
  5.  
  6. m1 is menu ([&Read,&Top,&Back,&Print,&Quit,&Help],select).
  7. disable_menu_item (?m1,[&Top,&Back,&Print]). 
  8. show_window (?w1).
  9.  
  10. topic select (item).
  11.   do (?item).
  12.  
  13.   topic &Read.
  14.     close_all ().
  15.     temp is file_menu ('*.hyp',,'Text File to Read').
  16.     if ?temp is []
  17.        then exit ().
  18.     txtfile is ?temp.
  19.     message is read (?txtfile,'//','//').
  20.     close (?txtfile).
  21.     top is string_replace (first (?message),'//').
  22.     enable_menu_item (?m1,[&Top,&Back,&Print]).
  23.     mark (?top).
  24.   end.
  25.  
  26.   topic &Quit.
  27.     new_kb ('demo.ckb').
  28.   end. (* mQuit *)
  29.  
  30.   topic &Top.
  31.     list is [].
  32.     mark (?top).
  33.   end.
  34.  
  35.   topic &Back.
  36.     list is remove (?list,last (?list)).
  37.     if ?list is []
  38.        then mark (?top)
  39.        else item is last (?list) and
  40.             list is remove (?list,?item) and
  41.             mark (?item).
  42.   end. (* Back *)
  43.  
  44.   topic &Print.
  45.     print (get_text ()).
  46.   end.
  47.  
  48.   topic &help.
  49.     text (#e,'
  50.     Reading Hypertext.
  51.  
  52.     The line below shows the font used for hypertext
  53.     on your monitor.
  54.  
  55.     #mThis is the font for hypertext on the current monitor.#m
  56.  
  57.     To select hypertext, point and click with the mouse
  58.     or, use TAB and SHIFT TAB to move the cursor among 
  59.     hypertext items and press ENTER to select the item.
  60.  
  61.     To go back to the previous screen, select BACK.
  62.     To return to the first screen, select TOP.
  63.     To print the current item, select PRINT.').
  64.  
  65.     topic 'This is the font for hypertext on the current monitor.'.
  66.       (* this is a dummy topic to catch the hypertext in the help screen.*)
  67.     end.
  68.  
  69.   end.
  70.  
  71. end. (* select *)
  72.  
  73. topic mark (item).
  74.   list gets (?item).    
  75.   set_title (,?item).
  76.   link is read  (?txtfile, concat ('//',?item),'//') .
  77.   if ?link is number_to_char (26)
  78.      then link is '
  79.      There is no further information for this item'.
  80.   text (#e,?link).
  81.   close (?txtfile).
  82. end. (* mark *)
  83.  
  84. topic displayInfo.
  85.   system is system_info ().
  86.  
  87.   if last (?system) > 2
  88.      then hyper_display (blue).
  89.   version is string_copy (element (?system,9),1,1).
  90.  
  91. end.