home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / BOXMENU.ZIP / BOXMENU.DOC < prev    next >
Encoding:
Text File  |  1985-09-17  |  7.6 KB  |  163 lines

  1.  BoxMenu function: this function will do a box select menu.  the user is 
  2.                   allowed to select an item from  that  line  by  EITHER 
  3.                   using  the  Left  or  Up and Right or Down arrow keys, 
  4.                   followed  by  pressing  the   <Enter>   key   OR   may 
  5.                   alternately press any character that matches the first 
  6.                   character of one of the words in the menu  (case  does 
  7.                   not  matter).  The  function  returns  a byte argument 
  8.                   that corresponds to the number of the field  selected.  
  9.                   There may be from 1 to 10 fields.  
  10.  
  11.                   Special features to make it even easier for your users 
  12.                   are that the space-bar and tab act just like the right 
  13.                   arrow. The backspace and reverse-tab act just like the 
  14.                   left arrow.  Home jumps to beginning of the  list  and 
  15.                   End jumps to the end of the list.  
  16.  
  17.                   You may set options that either end the  menu  if  the 
  18.                   user presses the Escape key or,  alternately,  you may 
  19.                   trap the Funtion keys (unshifted f1 thru f10 only).  
  20.  
  21.                   If  Escape  is allowed,  the pressing Escape returns a 
  22.                   zero,  if  function  keys  are  allowed,   the  number 
  23.                   returned  is  the  item number as if selected from the 
  24.                   list.  
  25.  
  26.                   To test this program,  compile and run the BOXDEMO.PAS 
  27.                   program that should have been  distributed  with  this 
  28.                   function.  
  29.  
  30.  
  31.           Original Author:  Philip R. Burns
  32.           Highly Modified:  Randall L. Smith
  33.             Elkridge-All-Purpose    (301) 796-1223
  34.             Capital PC Stat SIG     (301) 596-3569
  35.             Forbin Project          (319) 266-8086
  36.                                                                        
  37.  
  38.  
  39.   My Apoligies, but the arguments for the functions get kind of complicated:
  40.  
  41.                   Parameters for BOXMENU
  42.  
  43.     Col      = Byte   : The screen position (1-80) that defines the top
  44.                         left corner column of the menu.  
  45.     Line     = Byte   : The screen line # (1-25) that defines the top 
  46.                         lefthand corner of the menu.
  47.     Width    = byte   : The width of the menu.
  48.     ItemCtr  = byte   : the number of menu items to use  (1-10). Max of ten.
  49.  
  50.     Forgrnd  = byte   : the forground color (0-15)
  51.     Bkgrnd   = byte   : the background color (0-7)
  52.                         Note: if Forground and background are the same (or
  53.                         obvious illegal combos) the NormVideo and LowVideo
  54.                         commands will be used instead of the TextColor and
  55.                         TextBackground commands.
  56.     Frame    = byte   : the foreground color of the frame drawn around the 
  57.                         window. The Bkgrnd is used for the background color.  
  58.     HiLight  = integer: The amount added to the Forgrnd color to create 
  59.                         the High lighted field color.  If the Bkgrnd is 
  60.                         not White (7) then the background of the 
  61.                         selected field will be set to White (7).  If the 
  62.                         Background color is White (7), the background of 
  63.                         the selected field will be set to Black (0).  
  64.  
  65.     Header   = String : Max length = Menu Width -4 : The non-menu 
  66.                         portion of the 1st line.  
  67.  
  68.     Code     = Byte   : Special code that defines and allows for special
  69.                         keys to terminate the menu.
  70.                         1 = End if user selects a field and also
  71.                             if user presses the <ESCape> key.
  72.                         2 = End only when user selects a field. Does not
  73.                             recognize Escape key or function keys.
  74.                         3 = End if user selects a field and also end if the
  75.                             user presses the Escape key or any of the 10
  76.                             function keys.
  77.                         4 = Like 3 above but Escape is not recognized.
  78.                         Note: if an invalid number is passed, the default is 1.
  79.  
  80.     Start    = byte   : the number of the menu item you want highlighted when
  81.                         the menu is first brought up.
  82.  
  83.     ExpN : Explanation fields Exp1 thru Exp10
  84.              = String : Max length = Menu Width - 4 characters :
  85.                         These fields hold the descriptions or whatever 
  86.                         you want displayed.  All of these strings must 
  87.                         be passed to the function, this is true even if 
  88.                         you don't want to use this field.  Just use 2 
  89.                         single quotes or something to define a null 
  90.                         field. If the ItemCtr is less than the ExpN 
  91.                         position, this line will not be displayed.  
  92.  
  93. Special Usage Note:     You may call the BoxMenuDisplay procedure to 
  94.                         display a blank menu and then "fill" the menu 
  95.                         with something else.  If you do this, the screen
  96.                         is not saved or restored however!
  97.  
  98.  
  99.                  Parameters for BOXMENUDISPLAY
  100.  
  101.     Col      = Byte   : The screen position (1-80) that defines the top
  102.                         left corner column of the menu.  
  103.     Line     = Byte   : The screen line # (1-25) that defines the top 
  104.                         lefthand corner of the menu.
  105.     Width    = byte   : The width of the menu.
  106.     ItemCtr  = byte   : the number of menu items to use  (1-10). Max of ten.
  107.  
  108.     Forgrnd  = byte   : the forground color (0-15) of the frame drawn around 
  109.                         the window.  
  110.     Bkgrnd   = byte   : the background color (0-7)
  111.                         Note: if Forground and background are the same (or
  112.                         obvious illegal combos) the NormVideo and LowVideo
  113.                         commands will be used instead of the TextColor and
  114.                         TextBackground commands.
  115.  
  116. Special Usage Note:     You may call the BoxMenuDisplay procedure to 
  117.                         display a blank menu and then "fill" the menu 
  118.                         with something else.  If you do this, the screen
  119.                         is not saved or restored however!
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                     Parameters for BoxString
  126.  
  127.     Col      = Byte   : The screen position (1-80) that defines the top
  128.                         left corner column of the menu.  
  129.     Line     = Byte   : The screen line # (1-25) that defines the top 
  130.                         lefthand corner of the menu.
  131.     Width    = byte   : The width of the menu.
  132.  
  133.     Depth    = byte   : The number of lines available for data display.
  134.  
  135.     Forgrnd  = byte   : the forground color (0-15)
  136.     Bkgrnd   = byte   : the background color (0-7)
  137.     Field    = byte   : the foreground color of the field input.           
  138.                         The Bkgrnd is used for the background color.  
  139.  
  140.     Header   = String : Max length = Menu Width -4 : The non-menu 
  141.                         portion of the 1st line.  
  142.     Initial  = String : A string supplied as an initial value.
  143.  
  144.     Position = byte   : the position on the line for the input field
  145.     Line     = byte   : the line for then input field  
  146.     Length   = byte   : The maximum length of the string to be returned.
  147.  
  148.              
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.