home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PULL20.ZIP / PULL20.DOC < prev    next >
Encoding:
Text File  |  1988-01-12  |  42.0 KB  |  860 lines

  1.                                                         January 12, 1988
  2.  
  3.                           MULTI-LEVEL PULL-DOWN MENUS
  4.                                   Version 2.0
  5.                           (c) 1987,1988 James H. LeMay
  6.  
  7.         PURPOSE:
  8.  
  9.         This utility creates incredibly quick multi-level pull-down 
  10.         menus  as units for Turbo Pascal 4.0 programs for ALL IBM 
  11.         compatibles, including PS/2 and 3270 PC on any video page or any 
  12.         text mode.  It features:
  13.  
  14.               - Work window(s) and complete interface for menus
  15.               - Pull-down menus with 5 menu modes and 7 line modes
  16. |             - Pull-down file directory
  17.               - Highlighted command letters
  18.               - Unlimited levels of submenus
  19. |             - Unlimited data entry windows for 9 types of data
  20.               - Data entry for the work window(s)
  21.               - Automatic NumLock for numerical data entry
  22.               - Right or left justification for data entry
  23.               - Error messages for invalid data entries
  24.               - Error messages for data entries out of range
  25.               - Allowance for null entries on text data entry
  26.               - Automatic and override configuration for sizes and
  27.                   locations for easier development
  28.               - Operation by cursor keys or command keys
  29.               - Pull/Pop between work window and nested submenu(s)
  30.               - Programmable control of pull and pop sequences
  31.               - Full system of self-titled help windows
  32.               - Message lines for prompts and processing
  33.               - Full working shell for user development
  34.               - Can be fully configured by the user including
  35.                   add-on features though units.
  36.  
  37.         They work on MDA, CGA, EGA, MCGA, VGA, 8514/A adapters in any 
  38.         column mode (40/80/etc.).  These procedures use the quick screen 
  39.         writing procedures of QWIK40A.TPU and the multi-level window 
  40.         procedures of WNDW40.TPU.
  41.  
  42.  
  43.         TEST DRIVE:
  44.  
  45.         Compile and run the program PULLDEMO.PAS to get a feeling for 
  46.         features and speed.  Be sure to use the Help function key "F1" 
  47.         everywhere for context-sensitive explanations.
  48.  
  49.         Be sure to copy QWIK40A.TPU, WNDW40.TPU, and PULL20.TPU to 
  50.         QWIK.TPU, WNDW.TPU, and PULL.TPU, respectively, before 
  51.         compiling.
  52.             
  53.         WNDW40.ARC and QWIK40.ARC are not included and have more 
  54.         documentation.  The demo is very similar to the TP4 environment.  
  55.         The operation should be intuitive.  If not, then I didn't do a 
  56.         very good job.
  57.  
  58.  
  59.         FILES:
  60.  
  61.         In this version, PULL20.ARC contains:
  62.  
  63.            !read   .me!:  File that insists you get a copy of                   
  64.                           WNDW40.ARC and QWIK40.ARC for further                   
  65.                           documentation.
  66.            Qwik40a .tpu:  Unit from QWIK40.ARC - comprehensive quick 
  67.                           screen writing utilities.
  68.            WndwVars.tpu:  Unit from WNDW40.ARC - WNDW variables.
  69.            Wndw40  .tpu:  Unit from WNDW40.ARC - multi-level windows.
  70.            Pull20  .doc:  This document.
  71.            PullVars.tpu:  Just interface for PULLVARS.TPU.
  72.            PullVars.tpu:  Variables used in PULL20.TPU.
  73.            Pull20- .pas:  Just interface for PULL20.PAS.
  74.            Pull20  .tpu:  Unit for your programs to use the pull-down 
  75.                           menus including data entry procedures.
  76.            PullDir-.pas:  Just interface for PULLDIR.PAS.
  77.            PullDir .tpu:  Unit for a pull-down file directory.
  78.            PullStat.pas:  Data to configure the menus.
  79.            PullProc.pas:  Procedures and Data Entry variables to be 
  80.                           executed in the menus including global keys.
  81.            PullWork.pas:  Procedures for the main work window(s).
  82.            PullDemo.pas:  Fully functional working demo.
  83.            License .arc:  ARC file containing license agreements.
  84.  
  85.  
  86.         IMPROVEMENTS:
  87.  
  88.         In this version there are several improvements over PULL15:
  89. |         . Converted to TP4 and incorporated QWIK40 and WNDW40.
  90. |         . Added pull-down directory with path and mask.
  91. |         . Added global keys like Alt-F and Alt-X in PULLSTAT.PAS.
  92. |         . Help windows disappear at any any keystroke and applies
  93. |             that key to the program.
  94. |         . Eliminated PULLUSER.INC and instead allow access to user 
  95. |             windows direct through PullProc.Process.
  96. |         . Menu partitions now use Wndw.BrdrRec.
  97. |         . Added TypeOfDataTypes Word and LongInt.
  98. |         . Added "ClearScreen" option in InitPull.
  99.  
  100.  
  101.         SHAREWARE:
  102.  
  103.         Due to the lack of participation and expense, I have decided to 
  104.         abandon the Teamware concept and instead make them into ShareWare.  
  105.         The cost may range from $9 to $53 depending on your application.  
  106.         I do enjoy assisting others in their programming, but lack of 
  107.         reimbursement is expensive for me!  Please help out.  See the 
  108.         STATMENT.LIC in LICENSE.ARC for details.  If the response will let 
  109.         me break even, I will continue support.
  110.  
  111.  
  112.         DEFINITIONS:
  113.               
  114.         So you can understand the program identifiers and this document, 
  115.         here's the definitions I'll use:
  116.               
  117.            Work window - The working window of the application program.
  118.            Top menu - The menu always shown (usually in row 1 or 2).
  119.            Main menu - The first menu pulled from the top menu.
  120.            Submenu - All subsequent menus pulled after the main menu.
  121.            Line - A row of text.
  122.            Menu - A list of selectable lines.
  123.            Window - Not a menu.
  124.            Data entry window - window for entering data into the
  125.                                application program.
  126.            Selection - A line selected in a menu with a CR.
  127.            "HiLited" - A line pointed at in a menu.
  128.            Message line - The bottom row to display key helps or
  129.                           processing status.
  130.            Error message - a short message for data out of range.
  131.            Link - A menu line showing a symbol (three-bar or dot) that 
  132.                   pulls another menu or window.  The symbol is also on 
  133.                   the same side where it is pulled.
  134.            PullDown - pulls menus down to the previous level.
  135.            Pop - removes menus and returns to the work window.
  136.                                       
  137.                                       
  138.         BASIC OPERATION:
  139.  
  140.         I'll just put a few words here just in case you may have missed 
  141.         some of the capabilities in the demo.
  142.  
  143.          . Status Line - Row 1 just holds the title of this program.  It 
  144.            can be used to for optional status info.
  145.  
  146.          . Top Menu Line - To access the top menu line, press F10 at any 
  147.            time.  The exceptions are when the Help window or Error 
  148.            messages are displayed.  The "/" key does the same thing 
  149.            except it is considered data in text data entry windows.
  150.  
  151.          . Main Menu - To access a main menu, press RETURN while the top 
  152.            menu is highlighted.
  153.  
  154.          . Submenu - To access a submenu, press RETURN when the HiLite 
  155.            is at a menu line with the three-bar symbol (which looks like 
  156.            a menu).
  157.  
  158.          . Data Entry Window - To access a data entry (pronounced "dot-
  159.            uh" entry?) window, press RETURN when the HiLite is at a menu 
  160.            line with a small dot symbol.  Pressing RETURN again will 
  161.            exit the window.  You can clear any data entered by pressing 
  162.            ESC which also removes the window.
  163.  
  164.          . Numerical Data Entry - Depending on the type of data, (byte, 
  165.            integer, etc.) only the valid characters can be typed in. 
  166.            Backspace can be used as well.  The "NumLock" is automatic 
  167.            and is interactive.  After return is pressed, the data is 
  168.            checked for validity (bytes less than 256, etc.) and then for 
  169.            a range check.  If it passes both checks, the data is then 
  170.            stored and the window is removed.  The "NumLock" status is 
  171.            then restored.  In "Exec-" type menus like "Files", the 
  172.            window may remain until processing is complete.  You can 
  173.            program this either way though.
  174.  
  175.          . Text Data Entry - ASCII 32 through 126 are valid characters 
  176.            for string and character data.  Only backspace can be used 
  177.            for editing.  The entry can be nulled by pressing DEL and 
  178.            then RETURN.
  179.  
  180.          . Work Window - This is the 20x78 window for the major part of 
  181.            your output and optional input.  You can also have multi-
  182.            level work windows.
  183.  
  184.          . Work Window Data Entry - The same procedures used for the 
  185.            data entry windows can be used for entering data in the work 
  186.            windows.  One important exception - after a CR to enter the 
  187.            data, the data always overwrites the previous value.  In case 
  188.            of a range error, you can restore the original value with 
  189.            RestoreData.
  190.  
  191.          . Help Windows - A help window is assigned to every window and 
  192.            menu.  It automatically shows it's title of that menu.  They 
  193.            can use the same info or different.
  194.  
  195.          . Message Line - The bottom line contains help or error 
  196.            messages.  
  197.  
  198.          . Function Keys - These are the keys assigned in the demo and 
  199.            what they control:
  200.                F1  - PullDown/Pop the Help windows
  201.                F2  - PullDown/Pop the pull-down menus
  202.                F10 - Pops to top menu for key commands
  203.                "/" - Same as F10, but not in text data entry windows.
  204.                ESC - Same as F2 in the Work window, but in the menus it 
  205.                      backs out of the current menu/window.
  206.                LTR - While in the menus, the HiLite will move to and 
  207.                      execute the menu line with that upper case letter.
  208. |              Cursor Keys - all of the cursor keys have assigned
  209. |                    functions, even the control keys.  Check their 
  210. |                    operation in PULLDEMO.EXE, or registered users can 
  211. |                    just examine the source code.
  212. |              Alt Keys - just like the TP4 environment, the Alt keys 
  213. |                    can  control the menus.  These must be manually  
  214. |                    assigned.  See the last part of PULLSTAT.PAS for  
  215. |                    the keys assigned for the demo.  Holding down the  
  216. |                    Alt key for 1/2 second will display the Alt key  
  217. |                    help message.
  218.  
  219.  
  220.         SCREEN DESIGN:
  221.               
  222.         PULL20.TPU is quite flexible and allows you to change the basic 
  223. |       screen design in your application program.  EGA/MCGA/VGA users 
  224.         will particularly like it because it will also work in any row 
  225.         mode and column mode.
  226.                                       
  227.         Status line - The demo shows how to place a title or status line 
  228.         in row 1.  Some applications may require a status line outside 
  229.         of the work window for file names or whatever.  But it is not 
  230.         required.  
  231.               
  232.         Work Window - The demo also shows a 20x78 work window but you 
  233.         can modify it to a full 80 columns by setting the MakeWindow to 
  234.         NoBrdr and create a 20x80 window.  The top and bottom lines 
  235.         could be added with a couple of Qfill statements.  You can also 
  236.         have multi-level work windows if you want.
  237.               
  238.         Main Menu Placement - This design seems to be the defacto 
  239.         standard that was started by the Macintosh and is currently 
  240.         being used by Microsoft.  The top menu row is inverse video 
  241.         while the highlight is normal.  The main menu is directly below 
  242.         and offset a few spaces.
  243.  
  244.         Submenu Placement - Press RETURN at a menu line with a linked 
  245.         submenu and notice that the top of a submenu is on the 
  246.         same row.  This menu line also serves as a title.  Let's say you 
  247.         nest 5 levels of submenus.  Will you still be able to see all of 
  248.         the titles?  Sure!  They won't over lap.  However, it's a good 
  249.         idea for operation if you keep the linking lines to submenus 
  250.         high up on the menu which keeps the subsequent submenus high as 
  251.         well.  The first pull using F2 in the demo shows how three 
  252.         levels of menus are kept high.  Keying Alt-I and "U" will show 
  253.         you how a submenu drops lower.  The Submenus that "bottom out" 
  254.         on the display will be automatically pushed up when they are 
  255.         located.  Also look for defaults that reduce keystrokes to get 
  256.         around in the menus.
  257.  
  258.         Symbols - the three-line symbol (looks like a menu) tags the 
  259. |       line that links a submenu or a user window (ToUserWndw).  A 
  260.         small dot tags the line that links a data window.  In addition, 
  261.         the symbol location also shows the direction of display - left 
  262.         or right.  Right is preferred unless there is no room when it is 
  263.         then placed to the left.
  264.  
  265.         Help Window - The help window is centered between the left and 
  266.         right margin.  The bottom row of the window has a constant 
  267.         number of rows below it and the bottom of screen.  This can be 
  268.         assigned with RowsBelowHelp.  It was also given a zoom and 
  269.         shadow effect so that it would look and feel separated from the 
  270.         working program which you can change with HelpWndwModes.
  271.  
  272.         Message Line - The message line is placed relative to the bottom 
  273.         of the screen.  It can be raised up a number of rows by setting 
  274.         RowsBelowMsg greater than zero.
  275.  
  276.         Limits - There are really very few requirements.  Two of which 
  277.         are:
  278.  
  279.          . All menus and data entry windows cannot use NoBrdr.
  280.          . Data entry windows are fixed with 2 lines.
  281.  
  282.         Keyboard Operation - The operation is designed to be as 
  283.         intuitive as possible.  The message lines should guide you 
  284.         through the options.  The idea was to make application programs 
  285.         as user friendly as possible. 
  286.  
  287.               
  288. |       PULL-DOWN DIRECTORY:
  289.  
  290. |       A new pull-down directory unit has been added.  A particular 
  291. |       emphasis was made on end-user human factors in its development.
  292.  
  293. |         . Single column - A single column, alphabetically sorted list 
  294. |           is the easiest to scan quickly.  I takes longer to locate a 
  295. |           file in multi-column lists such as the one provided in the 
  296. |           TP4 environment.
  297. |         . Cursor key scanning - Cursor keys are the expected way to 
  298. |           scan through the directory.  However, Home, ^Home, End, and 
  299. |           ^End keys only move the HiLite while PgUp, ^PgUp, PgDn, and 
  300. |           ^PgDn move only the page.
  301. |         . Letter key scanning - Any alpha-numeric key will scan for 
  302. |           the first file name starting with the same first letter.  
  303. |           The page is moved and the cursor is centered as much as 
  304. |           possible.
  305. |         . Lower-case text - Lower case text is more legible than the 
  306. |           standard upper-case text provided by DOS.
  307. |         . Right justified extension - Visual searches for extensions 
  308. |           are easier to read when aligned.  In addition, this also 
  309. |           facilitates proper alphabetic sorting.
  310. |         . High speed sort - The sorting routine used is a secondary 
  311. |           indexed quick sort which is the fastest kind for this 
  312. |           application.  Up to 250 file names are permitted.
  313. |         . High speed scroll - The display is expected to be fast when 
  314. |           scrolling and is.  Neither the HiLite nor the screen ever 
  315. |           flicker.
  316. |         . Default HiLite - If a value file name is passed to the 
  317. |           directory for the default other than '', the directory 
  318. |           searches for a close match to HiLite.  In either case, the 
  319. |           HiLite is centered as much as possible.
  320. |         . Picked file name - Pressing CR will replace the referenced 
  321. |           file name passed to the directory.
  322.  
  323.  
  324.         PROGRAMMING:
  325.  
  326.         Configuration - Virtually everything can be reconfigured by the 
  327.         user without having to modify PULL20.TPU.  It may require a 
  328.         little study, but the demo has most of the examples.
  329.  
  330.         Demo - PULLDEMO.PAS, PULLSTAT.PAS, PULLPROC.PAS, and 
  331.         PULLWORK.PAS are examples of a shell you can use for your own 
  332.         programs.  I used all the capabilities in the demo.  Even though 
  333.         the source code is lengthy, there are only a few procedures.  
  334.         Here is a summary of the 10 steps to get you through all of the 
  335.         procedures:
  336.  
  337. |           STEP 1: Using Units
  338.             STEP 2: GetUserPullStats         (in PULLSTAT.PAS)
  339.             STEP 3: GetOverrideStats         (in PULLSTAT.PAS)
  340. |           STEP 4: CheckGlobalKeys          (in PULLSTAT.PAS)  
  341.             STEP 5: DataTransfer             (in PULLPROC.PAS)
  342.             STEP 6: Application procedures   (in PULLPROC.PAS)
  343.             STEP 7: Process                  (in PULLPROC.PAS)
  344.             STEP 8: WorkWndw                 (in PULLWORK.PAS)
  345.             STEP 9: DisplayScreen            (in PULLDEMO.PAS)
  346.             STEP 10: Main program            (in PULLDEMO.PAS)
  347.  
  348.  
  349. |       STEP 1: Using Units
  350. |
  351. |       Uses Matrix - Here's a USES matrix so you can tell where the 
  352. |       files are used:
  353.         
  354. |                                  USES UNIT NUMBER:
  355. |        Unit              1  2  3  4  5  6  7  8  9  10 11 12
  356. |       -----------------  -- -- -- -- -- -- -- -- -- -- -- --
  357. |        1 - DOS           -
  358. |        2 - CRT              -
  359. |        3 - Qwik    .tpu        -
  360. |        4 - WndwVars.tpu     x  x  -
  361. |        5 - Wndw    .tpu        x  x  -
  362. |        6 - PullVars.tpu           x     -
  363. |        7 - Pull    .tpu     x  x  x  x  x  -     F  F  F
  364. |        8 - PullDir .tpu  x     x  x  x  x  x  -  F
  365. |        9 - PullStat.pas     x  x  x     x  x  x  -
  366. |       10 - PullProc.pas     x           x  x  x  x  -
  367. |       11 - PullWork.pas     x  x  x  x  x  x        x  -
  368. |       12 - PullDemo.pas     x  x  x  x  x  x        x  x  -
  369.  
  370. |       "F" - indicates that a forward indirect call is used to access 
  371. |       some procedures in the forward unit.  Be sure those units are 
  372. |       included in a uses statement as shown in the demo files.  They 
  373. |       will compile without them but will lock up your computer if you 
  374. |       try to execute it.  This call was suggested by Kim Kokkonen.
  375.  
  376. |       Editing Units - The *.PAS files listed above can be freely 
  377. |       edited and compiled without needing the source code for the 
  378. |       TPUs.
  379.  
  380. |       Constants - The constants in WNDWVARS.PAS and PULLVARS.PAS 
  381. |       allows the user to trim down data memory to only what is needed.  
  382. |       (Only registered users will have the source code to do this 
  383. |       otherwise the limit is preset.)  While developing an 
  384.         application, it's best to balloon these values a bit to keep 
  385.         from having to frequently change them.  For MaxWndw, be sure to 
  386.         use the maximum possibility of the deepest nested pull-down 
  387.         menu, plus all work windows, plus the help window.  
  388.  
  389.  
  390.         STEP 2: GetUserPullStats
  391.  
  392.         Automatic configuration - This is the most significant part.  
  393.         PULL20.TPU runs this procedure only once to get the basic data 
  394.         for the pull-down menus.  Much of the drudgery of locating, 
  395.         sizing, directing, coloring, command letters is done 
  396.         automatically.  If submenus are not given enough room to fit, an 
  397.         error message will indicate it.  If a data entry window won't 
  398.         fit, it will reassign it to be centered on the screen which you 
  399.         can override by assigning values to RowAlt and ColAlt in the 
  400.         "GetOverrideStats" procedure. 
  401.  
  402.         Menu Modes - Every menu can have just one of five modes:
  403.  
  404.              ExecChoice         - immediately executes a procedure (the 
  405.                                   default)
  406.              ExecSingleChoice   - executes a procedure first and then 
  407.                                   flags one line exclusively on the menu
  408.              ExecMultipleChoice - executes a procedure first and then 
  409.                                   toggles the line's boolean flag
  410.              SingleChoice       - flags one line exclusively on the menu
  411.              MultipleChoice     - toggles the line's boolean flag
  412.  
  413.         MenuMode tells how the selection will interact with the other 
  414.         and ONLY "Choice" selections on the menu (see below).  
  415.  
  416.         Line Modes - In addition, each line in the menu can have one of 
  417.         seven line modes:
  418.  
  419.              Choice     - will interact with the assigned menu mode 
  420.                           (the default)
  421.              ExecOnly   - will only execute a procedure in Process
  422.              Comment    - a line that can't be HiLited
  423.              Partition  - draws a horizontal line across window
  424.              ToDataWndw - links a data entry window when selected
  425.              ToSubMenu  - links a submenu when selected
  426. |            ToUserWndw - like ExecOnly and adds a Submenu symbol
  427.  
  428.         In "Choice" mode, the line is a valid selection.
  429.  
  430.           . For ExecSingleChoice..MultipleChoice menus, the boolean data 
  431.             for the choice is stored in the menu record for each line.  
  432.             And for this reason, all menus are unique; they cannot be 
  433.             linked again to another submenu unless you store a copy of 
  434.             the values before reusing it.
  435.           . For "Exec-" type menus, a selected line executes it's 
  436.             procedure through an interface procedure called "Process".  
  437.             This will let you do just about anything, including any 
  438.             changes to the menus; e.g., take you step-by-step through 
  439.             data entry windows using PopLevels and PullDown.
  440.           . If a data entry window is linked to an "Exec-" type menu, it 
  441. |           will execute AFTER the data is entered.  An example of this 
  442. |           is the "Mask for Directory" line in "Files".  Once you 
  443.             select the line, it prompts you for the file name and then 
  444.             executes.
  445.  
  446.         In "ExecOnly" mode, the line overrides the menu mode and runs  
  447.         through the Process procedure just like a Choice in an  "Exec-" 
  448.         type menu, but will not set any flags.
  449.  
  450.         In "Comment" mode, the HiLite will simply skip over the line.  
  451.         This allows the user to place descriptions or whatever in the 
  452.         menu without being a possible selection.  There are two lines in 
  453.         the "Files" menu that are comments.
  454.  
  455.         "Partition" is a horizontal line to separate menu lines into 
  456. |       groups.  The line drawing characters used for the partition are 
  457. |       set by the Brdr constant in WNDWVARS.PAS.  "Files" in the demo 
  458.         has a partition in the second line from the bottom.
  459.   
  460.         No matter what the menu mode is, if the line mode is a link 
  461.         (ToSubmenu, etc.), it will just pull the linking menu or window.  
  462.         However, a ToDataWndw line on an "Exec-" type menu will execute 
  463.         a procedure in Process after entry.
  464.  
  465.         Attributes - The definitions of the attribute identifiers are 
  466.         suffixes of:
  467.  
  468.            -Attr  - normal attribute
  469.            -Hattr - attribute for HiLite
  470.            -Wattr - attribute for Window area
  471.            -Battr - attribute for Border of window
  472.            -Lattr - attribute for the command Letter
  473.            -Cattr - attribute for a Comment line
  474.  
  475.         The attributes are handled by groups in PULL20.TPU.  For 
  476.         example, the value for SubMenuWattr sets all SubMenus with the 
  477.         same value.  For exceptions, use PullStat.GetOverrideStats.
  478.  
  479.         Monochrome - Keep in mind that different displays and monitors 
  480.         don't always appear comparable.  Monochrome modes and displays 
  481. |       require some special considerations.  See "Hatch Borders" in 
  482. |       WNDW40.ARC.
  483.  
  484.         Status Line - Keep in mind that there may develop several look-
  485.         alike programs, so it would be helpful to have a title for your 
  486.         program on row 1 or 2 (unless of course you place it in the work 
  487.         window).  You can easily delete the line by setting 
  488.         "TopMenuRow:=1" and "MainMenuRow:=2".
  489.  
  490.         Command Sequences - PULL20.TPU keeps track of the key strokes 
  491.         used to access a pull-down menu in the string "CmdSeq".  F10 is 
  492.         not included since it is understood.  When using "PullDown" and 
  493.         "Pop" (see below), the user can programmably change the sequence 
  494.         with string "MoreCmdSeq".  The word "More" means that there are 
  495.         additional keys yet to be executed.  (Be sure to leave "CmdSeq" 
  496.         untouched.)
  497.  
  498.         MainMenu Record - Here's a list of what's contained in each 
  499.         record:
  500.  
  501.           Title       - a string required to appear in the Top Menu.
  502.           CmdLtrs     - a string which is done automatically by 
  503.                         PULL20.TPU and contains the first letters of 
  504.                         each menu line.  If you want some other letter, 
  505.                         you can edit it in PullStat.GetOverrideStats.
  506.           Line        - string to appear on a menu line.
  507.           LineMode    - one of the 6 line modes for each line.
  508.           Flagged     - boolean for each line used for MultipleChoice 
  509.                         and SingleChoice menus.  
  510.           LinkNum     - the index number of the linking SubMenu or 
  511.                         DataWndw. 
  512.           LinkDir     - linking SubMenu or window to appear Left or
  513.                         Right, handled by PULL20.TPU.
  514.           MenuMode    - one of the 3 menu modes.
  515.           MenuLines   - quantity of lines in this menu.
  516.           NameCol     - the column of title in the top menu.
  517.           Row,Col,Rows,Cols - location and size of the menu which is 
  518.                         done by PULL20.TPU   
  519.           DefaultLine - the HiLite line at startup.
  520.           HiLiteLine  - line currently HiLited
  521.           SingleFlagLine - the only line flagged.  Needed only in 
  522.                         SingleChoice menus (only for "Choice" lines).  
  523.           Battr,Wattr,Hattr,Lattr,Cattr - attributes set for this menu.
  524.           Border      - one the 10 borders done by PULL20.TPU.
  525.           BackToDefault - if true, HiLite will return to DefaultLine 
  526.                         every time the menu is pulled.     
  527.           Changed     - set to true if SingleFlagLine or Flagged have 
  528.                         been altered.  The user must reset this back to 
  529.                         false to be useful.
  530.           MsgLineNum  - the index number of the MsgLine.
  531.           HelpWndwNum - the index number of the HelpWndw.
  532.  
  533.         SubMenu Record - The SubMenu record is identical to the MainMenu 
  534.         record.  There are some differences in use though:
  535.  
  536.           Title       - same string of the linking menu line supplied by 
  537.                         PULL20.TPU.
  538.           NameCol     - not used. 
  539.    
  540.         Practically speaking there is no limit to the number of submenus 
  541.         that can be linked (<256).  
  542.  
  543.         Data Entry Windows -  Data entry windows are different from 
  544.         menus because they are merely a scratch pad.  They don't save 
  545.         any data in the record.  The data it picks up is stored by user 
  546.         variables in another interface procedure called "DataTransfer".  
  547.         Even their locations on the screen are assigned at the time when 
  548.         the user presses RETURN on the menu.  So, the user can use a 
  549.         single window for any number of links.  I call them floating 
  550.         windows.  However, when the window won't fit, the program 
  551.         centers it on the screen.  The user can keep it from floating by 
  552.         assigning non-zero coordinates to RowAlt and ColAlt.  Setting 
  553.         them back to zero will allow them to float again.  Since data 
  554.         windows can float, there's no limit for the number of places 
  555.         they can be used.
  556.  
  557.         DataWndw Record -  Here's the content of the record:
  558.  
  559.           Line[1]     - label for the current value of the data.
  560.           Line[2]     - label for the new data entry.
  561.           TypeOfData  - type of data expected for this window.
  562.           Row,Col,Rows,Cols - location and size of the window which is 
  563.                         done by PULL20.TPU   
  564.           RowAlt,ColAlt - alternate location of window.
  565.           FirstCol    - first column of the data field, handled by 
  566.                         PULL20.TPU.
  567.           Field       - number of columns reserved for data entry.
  568.           Decimals    - number of decimal places for Reals only.  If 
  569.                         positive, uses R:F:D format.  If negative, uses 
  570.                         R:F.
  571.           Wattr,Hattr,Battr - attributes set for this window.
  572.           Border      - set equal to DataWndwBrdr by PULL20.TPU.
  573.           MsgLineNum  - the index number of the MsgLine.
  574.           HelpWndwNum - the index number of the HelpWndw.
  575.           
  576.         HelpWndw Record - The HelpWndw displays a number of HelpLines in 
  577.         sequence.  It starts with FirstLine and displays each successive  
  578.         HelpLine until the window is full set by LinesToShow.  The 
  579.         initialization default assumes LinesToShow is simply the   
  580.         difference between the first and last lines.   Here's the list:
  581.  
  582.           FirstLine   - the index number of HelpLine.
  583.           LastLine    - currently unused.
  584.           LinesToShow - number of lines to show.
  585.           Row,Col,Rows,Cols - location and size of the window which is 
  586.                         done by PULL20.TPU   
  587.           Wattr,Battr - attributes set for this window.
  588.           Border      - set equal to HelpWndwBrdr by PULL20.TPU.
  589. |         HelpWndwModes - allow zoom and shadow effects.  See 
  590.                           WNDW40.DOC.
  591.           MsgLineNum  - the index number of the MsgLine.
  592.  
  593. |       Wattr, Battr, Border, HelpWndwModes, and MsgLineNum for all 
  594.         HelpWndw's are handled as a group by PULL20.TPU with 
  595. |       HelpWndwWattr, HelpWndwBattr, HelpWndwBrdr, HelpWndwModes, and 
  596.         HelpMsgLineNum respectively.  Help windows are optional.  To 
  597.         delete them, assign #00 to HelpKey so they can't be accessed.
  598.  
  599.         HelpLine - This is the text for the help windows.  It was set up 
  600.         as an array rather than a record to help save memory space.  The 
  601.         length need not be the width of the window.
  602.  
  603.         MsgLine - These lines are intended to show a message to the 
  604.         user the number of commands or keys available at any step.  The 
  605.         length should fill one entire row.
  606.  
  607.         ErrMsgLine - These lines are shorter than MsgLines and 
  608.         temporarily overlays a MsgLine.  They need not fill one 
  609.         entire row.  They are intended of course to indicate errors.
  610.  
  611.  
  612.         STEP 3: GetOverrideStats
  613.  
  614.         Purpose - If the user wants to change any data that PULL20.TPU 
  615.         has handled as a group with GetUserPullStats, this is the 
  616.         procedure to do it.  See PULLSTAT.PAS for some examples.
  617.  
  618.  
  619.         STEP 4: DataTransfer
  620.  
  621.         Purpose - If the data entry is used, PullStat.DataTransfer will 
  622.         be needed to transfer data from the floating windows to the 
  623.         appropriate variables.  This is done with the DataPad.
  624.  
  625.         DataPad Record - Before I give an explanation, here's the 
  626.         description of the record:
  627.  
  628.           StoreMode  - if true, data will be stored from the data pad to 
  629.                        the user variable.  Otherwise, it reads the 
  630.                        variable and places it on the pad.
  631.           Valid      - if true, numerical data is within typed limits.
  632.           DataStored - if true, data was stored successfully without a 
  633.                        range error.
  634.           NewData    - if true, data will be overwritten on the pad.
  635.           TypeOfData - type of data on the pad.  TAG FIELD for VARIANT 
  636.                        record.
  637.           Bdata      - Bytes       identifier in field list.
  638. |         Wdata      - Words       identifier in field list.
  639.           Idata      - Integers    identifier in field list.
  640. |         Ldata      - LongInts    identifier in field list.
  641.           Rdata      - Reals       identifier in field list.
  642.           UNdata     - UserNums    identifier in field list.
  643.           Cdata      - Chars       identifier in field list.
  644.           Sdata      - Strings     identifier in field list.
  645.           USdata     - UserStrings identifier in field list.
  646.           
  647.         If you are not familiar with variant records, better read the 
  648.         manual again.  Simply speaking, all variables in the field list 
  649.         all occupy the same address.  The only way you know what type of 
  650.         data you have is by what is assigned to TypeOfData 
  651.         (Bytes..UserStrings).  You can check the value on the pad at 
  652.         anytime; just be sure to use the correct identifier.
  653.  
  654.         UserNums/UserStrings - These two types are actually strings.  
  655.         UserStrings appears with quotes and UserNums without.  These 
  656.         types allow you to customize the characters allowed at data 
  657.         entry with the use of UserCharSet.
  658.  
  659.         Menu coordinates - Matching variables with windows is easily 
  660.         done by identifying the menu line that pulled the data window.  
  661.         The variables used are:
  662.  
  663.           MPulled - index number of MainMenu pulled.
  664.           SPulled - index number of SubMenu pulled.  If equal to zero, 
  665.                     then only a MainMenu was pulled.
  666.           HiLited - menu line that links the data window.
  667.  
  668.         With these, the DataTransfer procedure is just one big case 
  669.         statement that narrows down the correct user variable.
  670.  
  671.         Range check - Please note that data is not stored in data 
  672.         windows unless it passes BOTH the validity check and an optional 
  673.         range check.  This is different from Pull.WorkWndwEntry.  The 
  674.         demo shows you how to use a field identifier on the DataPad to 
  675.         check for range on the variable PriceLimit.  Make SURE that the 
  676.         type of data MATCHES!  Turbo will not check it.
  677.  
  678.  
  679.         STEP 5: Application Procedures 
  680.  
  681.         This is a good place to put all your application procedures, 
  682.         both for procedures used by the menus (PullProc.Process).  The 
  683.         demo uses only one called DummyProcess which is just a one 
  684.         second delay.
  685.  
  686.  
  687.         STEP 6: Process
  688.  
  689.         Purpose - "Process" is the procedure accessed by:
  690.  
  691. |            1. "Exec-" menus with a "Choice" line.
  692. |            2. "ExecOnly" lines.
  693. |            3. "ToUserWndw" lines.  (like the pull-down directory)
  694.  
  695.         This is where you can make the menus do just about anything.
  696.  
  697.         Menu Coordinates - "Process" uses the same coordinate variables 
  698.         as DataTransfer and uses a case statement the same way to locate 
  699.         the correct procedure with MPulled, SPulled and HiLited.
  700.  
  701.         PullDown/Pop - Programmably you can PullDown or Pop menus in your 
  702.         procedures at any time.  Try Alt-I and "U" in the demo to see 
  703.         just a few of the possibilities of programmable control.  There 
  704.         are 5 flag variables and one function that hook into PULL20.TPU 
  705.         to do this:
  706.  
  707.           PopToWorkWndw - if set true, control is returned to the work 
  708.                           window.
  709.           PopToTop      - if set true, menus are popped only to the top 
  710.                           menu.
  711.           PopLevels     - the number of levels to pop.
  712.           Popped        - a function that will pop all menus before 
  713.                           processing.
  714.           MoreCmdSeq    - a string of pending command letters after 
  715.                           popping.
  716. |         PullDown      - if set true, menus will be pulled down after 
  717.                           pop as specified by MoreCmdSeq.
  718.  
  719.         You can combine these in several ways.  You can even make data 
  720.         windows enter data sequentially for records or to make it easier 
  721.         for end users automatically step through data entry.  An example 
  722.         of this is in the demo under "IRSaccounting" and "Date".  You'll 
  723.         notice how easy it is to roll through the data windows with 
  724.         RETURNs.
  725.  
  726.  
  727.         STEP 7: WorkWndw
  728.  
  729.         Work Window - When the menus are not pulled, this is where there 
  730.         is most of the programming activity.  You can even have multi-
  731.         level work windows.  Note also that you can work with two or 
  732.         more windows on the screen at the same time and can use 
  733. |       Wndw.AccessWindow to randomly access any window. 
  734.  
  735.         WorkWndwStep - Since each keystroke goes through the key 
  736.         dispatcher, the number of WorkWndwStep tells the program where 
  737.         to return upon re-entering WorkWndw.  You can change its value, 
  738.         even while in the menus.
  739.  
  740.         WorkWndwEntry - You can now use the same data entry procedures 
  741.         as the data entry windows for the work window with 
  742. |       WorkWndwEntry.  Set DataPad.NewData:=true to clear data on the 
  743. |       pad.  If WorkWndwStep is changed, the data is automatically 
  744. |       cleared.  There is one difference though; the data is stored 
  745.         right after it passes the validity test.  If it doesn't meet the 
  746.         range test, then the data must be restored with RestoreData.
  747.  
  748.  
  749.         STEP 8: DisplayScreen
  750.  
  751.         This procedure finally sets up your screen design.  
  752.  
  753.  
  754.         STEP 9: Main Program
  755.  
  756.         Initial Values - Here is where you place the initial values for 
  757.         user variables.
  758.  
  759.         GotoKeyDispatcher - Since each keystroke needs to be analyzed, 
  760.         the dispatcher decides whether it goes to the Menus or WorkWndw.  
  761.         Here's a flow chart for the dispatcher:
  762.  
  763.                                  +------------+
  764.                                  |   START    |
  765.                                  +------------+
  766.                                        |
  767.                                        /\
  768.                                      /    \
  769.           +-------------+     No   /        \   Yes     +-------------+
  770.           |    Work     |<--------< PullDown? >-------->|  Pull-down  |
  771.           |   Window    |          \        /           |    Menus    |
  772.           +-------------+            \    /             +-------------+
  773.                  |                     \/                       |
  774.                  |                    /|\                       |
  775.                  |                     |                        |
  776.                  |                     | No                     |
  777.                  |                     /\                       |
  778.                  |                   /    \                     |
  779.                  |                 /        \                   |
  780.                  ----------------><  Quit ?  ><------------------
  781.                                    \        /
  782.                                      \    / 
  783.                                        \/
  784.                                        | Yes
  785.                                       \|/
  786.                                  +------------+
  787.                                  |    END     |
  788.                                  +------------+
  789.  
  790.  
  791.         SUGGESTIONS:
  792.  
  793.         Full Demonstration - If you would like to see a fully working 
  794.         utility created from these procedures, you can get a file called 
  795.         WSX21A.ARC.  It is a WordStar Translator program for WordStar 
  796.         3.31/4.0, but you don't have to have WordStar to examine it.  It 
  797.         has pull-down directories, WYSIWYG color modifications, and other 
  798.         ideas.  The ARC file does not contain the source code, but it is 
  799.         available upon request.  WSX21A.ARC can be found on the 
  800.         CompuServe MicroPro (GO MICROPRO) in the WordStar 4.0 Data 
  801.         Library (DL3).  (WSX21A.ARC was created with TP3 not TP4.)
  802.  
  803.         On-line source - All updated files can be found on the CompuServe 
  804. |       Borland Forum (GO BPROGA) in the MSDOS Turbo Pascal Data Library 
  805. |       or on the IBM Software Forum (GO IBMSW).
  806.  
  807.         Fast Keyboard Repeat - The best utility I've found to double the 
  808.         typematic rate is a utility called HOTKEY.ARC, version 1.1.  
  809.         It's better than PC Magazine's QUICKEYS, because it doesn't "run 
  810.         away" in the buffer.  Available on CompuServe's IBM Hardware 
  811.         Forum.
  812.  
  813.  
  814.         LIABILITY:
  815.  
  816.         No liabilities are assumed in the use or misuse of these 
  817.         procedures.
  818.  
  819.  
  820.         AUTHOR:
  821.  
  822.         These procedures are now Shareware.  If there are any problems, 
  823.         please let me know.
  824.  
  825.           Copyright (c) 1987,1988 by James H. LeMay
  826.             All rights reserved
  827.             Jim LeMay, 6341 Klamath Rd., Ft. Worth, TX  76116
  828.             CIS 76011,217, 1-(817) 732-7150 (after 1730 PST)
  829.  
  830.  
  831.         CREDITS:
  832.  
  833.         Art Hill started some initial ideas on this with PullDown.arc
  834.  
  835.             Art Hill, 936 S. Kensington Ave., La Grange, IL 60525
  836.             CIS 72307,3570
  837.  
  838.  
  839.         REVISIONS:
  840.  
  841.         Version 1.1 (02-27-87): Initial release
  842.         Version 1.2 (04-08-87): limited release
  843.         Version 1.3 (04-20-87)
  844.         Version 1.4 (06-30-87): limited release
  845.         Version 1.5 (08-31-87):
  846.  
  847.         Version 2.0 (01-12-88):
  848.           . Converted to TP4 and incorporated QWIK40 and WNDW40.
  849.           . Added pull-down directory with path and mask.
  850.           . Added global keys like Alt-F and Alt-X in PULLSTAT.PAS.
  851.           . Eliminated PULLUSER.INC and instead allow access to user 
  852.               windows direct through PullProc.Process.
  853.           . Menu partitions now use Wndw.BrdrRec.
  854.           . Added TypeOfDataTypes Word and LongInt.
  855.           . Added "ClearScreen" option in InitPull.
  856.           . Deleted i and j variables in PULL20.PAS.
  857.           . Modified Pull.TempMsg; Deleted TempMsgArray.
  858.           . Top menu record is available from TopMenuRecPtr^.
  859.  
  860.