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

  1. setup ().
  2. &Top ().
  3.  
  4. (* <<<<<<<<<<<<<<<<<<<<<<< MENU ITEMS >>>>>>>>>>>>>>>>>>>>>>>>>>>> *)
  5.  
  6. topic '&Top'.
  7.    disable_menu_item (?m1,[&Back,&Top]).
  8.    list is [].
  9.    set_title (,'Introduction to KnowledgePro').
  10.    text ('#e
  11.  
  12.  Welcome to KnowledgePro (Windows), a unique development 
  13.  environment for Windows applications.
  14.  
  15.  Point and click your mouse to select information on the items 
  16.  below:
  17.                  #mDevelopment Environment#m
  18.                  #mHelp System#m
  19.                  #mSample Tools#m
  20.                  #mCode Included#m
  21.                  #mFeatures#m
  22.                  #mOrdering Information#m
  23.  
  24.     ⌐ Knowledge Garden Inc. 1990
  25.        473A Malden Bridge Road
  26.        Nassau, NY  12123
  27.        (518) 766-3000  FAX (518) 766-3003 ').
  28.  
  29.    if ?version is 3
  30.       then logo is load_icon ('kpwin.ico') and
  31.            icon (?logo,46,14).
  32. end.
  33.  
  34. topic select (item).
  35.   do (?item).
  36.  
  37.   topic &Back.
  38.      if list_length (?list) = 1
  39.         then &top ()
  40.      else 
  41.         list is sublist (?list, 1, list_length (?list) - 1) and
  42.         item is last (?list) and
  43.         list is sublist (?list, 1, list_length (?list) - 1) and
  44.         (if one_of (['Help System','Sample Tools'], ?item)
  45.             then do (?item)
  46.             else mark (?item)).
  47.    end. (* Back *)
  48.  
  49.    topic &Print.
  50.       print ([?get_title, get_text (?w1)]).
  51.    end. (*&Print*)
  52.  
  53.    topic &Quit.
  54.       clear ().
  55.    end. (* &Quit *)
  56.  
  57.    topic &Help.
  58.       if last (?list) is '&Help'
  59.          then exit ().
  60.       set_title (?w1,Help).
  61.       enable_menu_item (?m1,&Back).
  62.       list gets '&Help'.
  63.        text (#e,'
  64.  Reading Hypertext.
  65.  
  66.  The line below shows the font used for hypertext on your monitor.
  67.  
  68.  #mThis is the font for hypertext on the current monitor.#m
  69.  
  70.  To select hypertext, point and click with the mouse or, use TAB 
  71.  and SHIFT TAB to move the cursor among hypertext items and press 
  72.  ENTER to select the item.
  73.  
  74.  To go back to the previous screen, select BACK.
  75.  To return to the first screen, select TOP.
  76.  To print the current item, select PRINT.').
  77.  
  78.   topic 'This is the font for hypertext on the current monitor.'.
  79.     (* this is a dummy topic to catch the hypertext in the help screen.*)
  80.   end.
  81.  
  82.     end. (*&Help*)
  83.  
  84. end. (*select*)
  85.  
  86. (* <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> *)
  87.  
  88.  
  89. (* ////////////////////////////////////////////////  DEFINED HYPERTEXT TOPICS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *)
  90.  
  91. topic 'Help System'.
  92.    list gets 'Help System'.
  93.    set_title (?w1,'Help System').
  94.    enable_menu_item (?m1,[&Top,&Back,&Print]). 
  95.    text ('#e 
  96.  The help system gives you access to the complete syntax of 
  97.  all functions in KnowledgePro.  Syntax can be copied to the 
  98.  clipboard and pasted into your application. Help contains 
  99.  information about converting from KnowledgePro (DOS) and event 
  100.  handling. All of the help source code and text files are 
  101.  included, allowing you to customize Help in any way.  
  102.  
  103.  
  104.  #mSelect here to call the KnowledgePro Help System#m').
  105.  
  106.       topic 'Select here to call the KnowledgePro Help System'.
  107.           load ('kphelp.hkb',temp).
  108.           '!helpdir' is current_directory ( ).
  109.           temp ( ).
  110.           remove_topic (temp).
  111.           hyper_display (?hyperColor,,?hyperFont).
  112.           use_font (system_font).
  113.       end.
  114.  
  115. end. (* Help System *)
  116.  
  117. topic 'Sample Tools'.
  118.    list gets 'Sample Tools'.
  119.    set_title (?w1,'Sample Tools').
  120.    enable_menu_item (?m1,[&Top,&Back,&Print]).      
  121.    text ('#e There are several sample tools included with
  122.    this demo.  These include:
  123.  
  124.    #mCOLOR#m#x15used to find RBG values for screen colors
  125.    #mDESIGN#m#x15lets you interactively design screen interfaces.
  126.    #x15The code to create the interface is produced and can be 
  127.    #x15copied to a file or the clipboard
  128.    #mENGINE#m#x15an application for reading hypertext files
  129.    #mFONT#m#x15a tool for designing fonts 
  130.    #mPALETTE#m#x15shows the standard colors and their names
  131.    #mSETICON#m#x15installs icons on the Windows 3.0 program manager
  132.  
  133.  If you want to run one of these now, click on the file name.   
  134.  The code for each application is supplied in .SRC files on the 
  135.  demo disk.').
  136.  
  137.    topic mark (item).
  138.        choices is [COLOR,DESIGN,ENGINE,FONT,PALETTE,SETICON].
  139.        kbs is ['COLORdem.hKB','DESIGNde.hKB','ENGINEde.hKB','FONTdem.hKB',
  140.                    'PALETTEd.hKB','SETICONd.hKB'].
  141.        new_kb ( element (?kbs, where (?choices, ?item) ) ).
  142.    end. (*mark*)
  143.  
  144. end. (*Sample Tools*) 
  145.  
  146. topic 'click here'.
  147.   new_kb ('ddeshowd.hkb').
  148. end.
  149.  
  150. (* ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// *)
  151.  
  152.  
  153. (* ========================= MARK TOPIC ======================== *)
  154.  
  155. topic  mark (item).
  156.   if one_of ( ?loadChoices ,?item)
  157.      then loadSection ()
  158.      else displayText ().
  159.  
  160.   topic loadSection.
  161.      hide_window (?w1).
  162.      load ( element (?loadKbs, where (?loadChoices,?item) ) , temp).
  163.      temp ().
  164.      wait ().
  165.      remove_topic (temp).
  166.      set_display_window (?w1).
  167.      show_window (?w1).
  168.   end.
  169.  
  170.   topic displayText.     
  171.     list gets?item.
  172.     set_title (?w1,?item).
  173.     enable_menu_item (?m1,[&Top,&Back,&Print]). 
  174.     text (#e,read ('demo.hyp', concat ('//',?item) ,'//') ).
  175.     set_file_pos ('demo.hyp',0,beginning).
  176.   end.
  177.  
  178. end. (*mark*)
  179.  
  180. (* ==================================================================== *)  
  181.  
  182.  
  183. (* ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~ SETUP ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^ *)
  184.  
  185. topic setup.
  186.   displayInfo ().
  187.   if version is 3
  188.      then [width,height] is_c [85,22]
  189.      else [width,height] is_c [70,25].
  190.   !main:w1 is window (select:&Quit,5,1,?width,?height,,[PopUp,ThickFrame,MaximizeBox,ControlMenu,VertScroll,ShowChildren,Siblings],,,,close_event).
  191.   m1 is menu ([&Top,&Back,&Print,&Quit,&Help],select).
  192.   disable_menu_item (?m1,[&Back,&Top]).
  193.   show_window (?w1).
  194.   list is [].
  195.   loadChoices is ['Development Environment',Graphics,Hypertext].
  196.   loadKbs is ['develop.hkb','graphics.hkb','hyperex.hkb'].
  197.  
  198.   topic displayInfo.
  199.     system is system_info ().
  200.     if element (?system,4) is 12
  201.        then displayType is EGA and
  202.                smallFont is  [10,5,400,f,f,f,0,1,34,Helv] and
  203.                bigFont is [16,9,400,f,f,f,0,1,18,'Tms Rmn']
  204.        else displayType is VGA and
  205.                smallFont is [16,7,400,f,f,f,0,1,18,Helv] and
  206.                bigFont is [20,8,700,f,f,f,0,1,34,Helv].
  207.  
  208.     if last (?system) < 3
  209.        then HyperColor is black
  210.        else HyperColor is blue and
  211.                hyper_display (blue).
  212.      hyperFont is create_font ([12,8,400,f,t,f,0,1,2,System]).
  213.     version is string_copy (element (?system,9),1,1).
  214.   end.
  215.  
  216. end. (*setup*)
  217. (* ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^ *)