home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a070 / 3.ddi / FOXPRO / TEMPLGEN / AP1CALL.INC < prev    next >
Encoding:
Text File  |  1988-02-11  |  4.0 KB  |  177 lines

  1. <<* APPCALL.INC *>>
  2. <<#
  3.  
  4. function GetPrgName( prompt : string ) : string
  5. string fspec
  6. begin
  7.   input prompt to fspec
  8.   if fspec
  9.     filespec( fspec,fpath,fname,fext )
  10.     fspec := fpath + fname + '.PRG'      <<*Force '.PRG' extension*>>
  11.   end
  12.   RETURN fspec
  13. end <<*GetPrgName*>>
  14.  
  15. <<*Commented out for now. Only 1 product!*>>
  16. <<*procedure SelectProduct  
  17. integer choice
  18. begin
  19.   choice := 2
  20.   initmenu( ' A V A I L A B L E    P R O D U C T S ' )
  21.     'FoxBASE+ version 2.1'
  22.     'add FoxBASE versions here'
  23.   end
  24.   menu to choice
  25.   if choice = 0
  26.     set ProductCode to 1  
  27.   else
  28.     set ProductCode to choice
  29.   endif
  30. end *>> 
  31. <<*SelectProduct*>>
  32. #>>
  33.  
  34.  
  35. <<function OptionMenu( choice : integer;
  36.                        menuhdg : string;
  37.                        m0,m1,m2,m3,m4,m5,m6,m7 : string ) : integer>>
  38. <<#
  39. integer options
  40. string pic0,pic1,pic2,pic3,pic4,pic5,pic6,pic7
  41.  
  42.  
  43. function iftoggle( bitval : integer ) : string   <<*nested function*>>
  44. begin
  45.   if (options and bitval) <> 0   <<*Is the bit set?*>>
  46.     RETURN ' on '              <<*YES*>>
  47.   else
  48.     RETURN ' ── '              <<*NO*>>
  49.   endif
  50. end iftoggle
  51.  
  52.  
  53. begin <<*OptionMenu*>>
  54.   options := 0
  55.   repeat
  56.     options := options xor (1 shl (choice-1))   <<*Toggle bit value*>>
  57.     pic0 := iftoggle(  1 )
  58.     pic1 := iftoggle(  2 )
  59.     pic2 := iftoggle(  4 )
  60.     pic3 := iftoggle(  8 )
  61.     pic4 := iftoggle( 16 )
  62.     pic5 := iftoggle( 32 )
  63.     pic6 := iftoggle( 64 )
  64.     pic7 := iftoggle( 128 )
  65.     initmenu( menuhdg )
  66.       pic0 + m0 : 'Press RETURN to select or unselect;  ESC finishes'
  67.       pic1 + m1  <<*The above menu message defaults to next options*>>
  68.       pic2 + m2
  69.       pic3 + m3
  70.       pic4 + m4
  71.       pic5 + m5
  72.       pic6 + m6
  73.       pic7 + m7
  74.     end
  75.     menu to choice
  76.   until choice = 0
  77.   RETURN options
  78. end OptionMenu
  79.  
  80.  
  81. function SelectGroup : integer
  82. integer group
  83. begin
  84. #>>
  85.   <<group := OptionMenu( 0,'Program Groups to Generate',
  86.       'All program groups',
  87.       'MENU file',
  88.       'PROCEDURE file',
  89.       'MAIN-OPEN-APPE-EDIT',
  90.       'BROW-DISP-COND-EXPR-PHRA',
  91.       'HELP-LABE-PACK-REPO',
  92.       '<user-defined>',
  93.       '<user-defined>'
  94.     )>>
  95. <<#
  96.   RETURN group
  97. end SelectGroup
  98.  
  99.  
  100. function SubMenuType : integer
  101. integer menutype
  102. begin
  103.   menutype := 2
  104.   initmenu( ' S U B M E N U    S T Y L E S ' )
  105.   'Parentheses': 'Sub-menus using "(" and ")" characters'
  106.   'Bracketed'  : 'Sub-menus using "{" and "}" brackets'
  107.   'Lite-Bar'   : 'FoxBASE+ lite-bar Sub-menus'
  108.   end
  109.   menu to menutype
  110.   if menutype = 0
  111.     menutype := 1
  112.   endif
  113.   RETURN menutype
  114. end SubMenuType
  115.  
  116.  
  117. function MainMenuType : integer
  118. integer menutype
  119. begin
  120.   menutype := 1   <<*default*>>
  121.   initmenu( ' M E N U    S T Y L E S ' )
  122.   'Simple'    : 'Simple Main Menu'
  123.   'Lite-Bar'  : 'FoxBASE+ lite-bar menus'
  124.   <<* 'Style (a)' : 'Roll-your-own' *>>
  125.   <<* 'Style (b)' : 'Roll-your-own' *>>
  126.   <<* 'Style (c)' : 'Roll-your-own' *>>
  127.   <<* '...etc...' : '...etc...'     *>>
  128.   end
  129.   menu to menutype
  130.   RETURN menutype
  131. end MainMenuType
  132.  
  133.  
  134. procedure GenMainMenu( menutype : integer )
  135. string fspec
  136. begin
  137.   fspec := prgpath + fileprefix + '_MENU.PRG'
  138.   if OpenFile( fspec,'MENU program for ' + datafile + '.DBF' )
  139.     if menutype = 1
  140.       GenSimpleMenu
  141.     elsif menutype = 2
  142.       GenLiteBarMenu
  143. <<*
  144.     elsif menutype = 3
  145.       GenYourOwnMenu1
  146.     elsif menutype = 4
  147.       GenYourOwnMenu2
  148. *>>
  149.     else  <<*default menu style*>>
  150.       GenSimpleMenu
  151.     endif
  152.     GenFooter( fspec )
  153.   endif
  154. end <<*GenMainMenu*>>
  155.  
  156.  
  157. function SelectFeatures : integer
  158. integer features
  159. begin
  160. #>>
  161.   <<features := OptionMenu( 0,'Program Features to Include',
  162.       'All fields in one Query Table',
  163.       'Label/Report option in Append/Edit',
  164.       "Browse using Tom Rettig's Library",
  165.       '4th feature (none)',
  166.       '5th feature (none)',
  167.       '6rd feature (none)',
  168.       '7th feature (none)',
  169.       '8th feature (none)'
  170.     )>>
  171. <<#
  172.   RETURN features
  173. end SelectFeatures
  174.  
  175. <<* EOF: APPCALL.INC *>>
  176. #>>
  177.