home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 02a / pull55.zip / PULLREF.DOC < prev    next >
Text File  |  1989-08-24  |  82KB  |  1,626 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                                    MULTI-LEVEL PULL-DOWN MENUS
  21.                                          REFERENCE GUIDE
  22.  
  23.                                            Version 5.5
  24.                                          August 24, 1989
  25.  
  26.  
  27.                        Copyright (C) 1987-1989 Eagle Performance Software
  28.                                       All Rights Reserved.
  29.  
  30.  
  31.  
  32.                                        _______
  33.                                   ____|__     |               (tm)
  34.                                --|       |    |-------------------
  35.                                  |   ____|__  |  Association of
  36.                                  |  |       |_|  Shareware
  37.                                  |__|   o   |    Professionals
  38.                                -----|   |   |---------------------
  39.                                     |___|___|    MEMBER
  40.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  41.  
  42.  
  43.  
  44.                                T A B L E   O F   C O N T E N T S
  45.  
  46.                 1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 3
  47.                      Purpose . . . . . . . . . . . . . . . . . . . . . . . 3
  48.                      Fill-in-the-Blank . . . . . . . . . . . . . . . . . . 3
  49.  
  50.                 2. PROCEDURES AND FUNCTIONS  . . . . . . . . . . . . . . . 4
  51.                      CheckForPop . . . . . . . . . . . . . . . . . . . . . 4
  52.                      CheckForPullDown  . . . . . . . . . . . . . . . . . . 4
  53.                      CheckGlobalKeys . . . . . . . . . . . . . . . . . . . 4
  54.                      DisplayFields . . . . . . . . . . . . . . . . . . . . 4
  55.                      Enter . . . . . . . . . . . . . . . . . . . . . . . . 5
  56.                      EnterSeq  . . . . . . . . . . . . . . . . . . . . . . 5
  57.                      GetOverrideStats  . . . . . . . . . . . . . . . . . . 5
  58.                      GetUserPullStats  . . . . . . . . . . . . . . . . . . 5
  59.                      GotoKeyDispatcher . . . . . . . . . . . . . . . . . . 5
  60.                      HelpKeyPressed  . . . . . . . . . . . . . . . . . . . 6
  61.                      HiLiteRow . . . . . . . . . . . . . . . . . . . . . . 6
  62.                      InitPull  . . . . . . . . . . . . . . . . . . . . . . 6
  63.                      InRangeW  . . . . . . . . . . . . . . . . . . . . . . 6
  64.                      Popped  . . . . . . . . . . . . . . . . . . . . . . . 6
  65.                      PullDirectory . . . . . . . . . . . . . . . . . . . . 7
  66.                      PullHelpWndw  . . . . . . . . . . . . . . . . . . . . 7
  67.                      ReadKbd . . . . . . . . . . . . . . . . . . . . . . . 7
  68.                      SetCmdSeq . . . . . . . . . . . . . . . . . . . . . . 7
  69.                      ShowErrMsg  . . . . . . . . . . . . . . . . . . . . . 8
  70.                      ShowMsg . . . . . . . . . . . . . . . . . . . . . . . 8
  71.                      ShowTopLine . . . . . . . . . . . . . . . . . . . . . 8
  72.                      StrSL . . . . . . . . . . . . . . . . . . . . . . . . 8
  73.                      StrSR . . . . . . . . . . . . . . . . . . . . . . . . 9
  74.                      TopKeyPressed . . . . . . . . . . . . . . . . . . . . 9
  75.                      TurnArrows  . . . . . . . . . . . . . . . . . . . . . 9
  76.                      WorkWndw  . . . . . . . . . . . . . . . . . . . . . . 9
  77.  
  78.                 3. DATA STRUCTURE  . . . . . . . . . . . . . . . . . . . . 10
  79.                      Configuration Constants . . . . . . . . . . . . . . . 10
  80.                      Main Menu Declarations  . . . . . . . . . . . . . . . 11
  81.                      Submenu Declarations  . . . . . . . . . . . . . . . . 17
  82.                      Message Line Declarations . . . . . . . . . . . . . . 17
  83.                      Help Window Declarations  . . . . . . . . . . . . . . 18
  84.                      Data Window/Entry Declarations  . . . . . . . . . . . 20
  85.  
  86.                 APPENDIX A:  MEMORY ALLOCATION . . . . . . . . . . . . . . 25
  87.                      Global vs. Dynamic  . . . . . . . . . . . . . . . . . 25
  88.                      Global Memory . . . . . . . . . . . . . . . . . . . . 25
  89.                      Dynamic Memory  . . . . . . . . . . . . . . . . . . . 25
  90.                      Code Size . . . . . . . . . . . . . . . . . . . . . . 26
  91.  
  92.                 APPENDIX B:  ERROR MESSAGES  . . . . . . . . . . . . . . . 27
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.                                                2
  101.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  102.  
  103.  
  104.            1.  I N T R O D U C T I O N
  105.  
  106.  
  107.            PURPOSE
  108.  
  109.            This document is a technical reference manual describing each routine and
  110.            variable in detail in a format similar to the TP manual.  The routines are
  111.            described in alphabetical order.  Since this manual is on disk, you can
  112.            find your interest easily with any search utility.
  113.  
  114.            Application - Because PULL uses QWIK and WNDW, all routines will perform in
  115.            the following applications:
  116.  
  117.              . All video text modes - 0, 1, 2, 3 and 7.
  118.              . Any column mode - 40, 80, or variable.
  119.              . For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and
  120.                compatibles.
  121.              . With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
  122.              . Perform routines in both absolute and window-relative coordinates.
  123.  
  124.            Please note that the demonstration files are set to work on an 80 column
  125.            mode on video page 0 in a non-multi-tasking environment.  However, these
  126.            can be changed with the source code.
  127.  
  128.  
  129.            FILL-IN-THE-BLANK
  130.  
  131.            Since most of PULL is based on the fill-in-the-blank concept for records,
  132.            there are only a few procedures and functions that you would need to know
  133.            about data entries and specialized programming of user windows.  Most of
  134.            your interest will probably be in the Data Structure section that follows
  135.            later, so you know which "blanks" you can fill.
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.            Chapter 1, Introduction                                             Page 3
  162.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  163.  
  164.  
  165.            2.  P R O C E D U R E S   A N D   F U N C T I O N S
  166.  
  167.            In this section, a detailed description is provided for each procedure and
  168.            function.
  169.  
  170.  
  171.            ---------------------------------------------------------------------------
  172.            CheckForPop procedure                                                  Pull
  173.            ---------------------------------------------------------------------------
  174.            Function       Sets Pop true if menu(s) need to be removed.
  175.            Declaration    CheckForPop
  176.            Remarks        This procedure is primarily used in user windows that to
  177.                           interface with the pull-down menus.  It analyzes the current
  178.                           status of the menu control flags to see if one or more menus
  179.                           need to be removed.
  180.            See also       CheckForPullDown
  181.            Example        See the User Window section in PULL55.DOC.
  182.  
  183.            ---------------------------------------------------------------------------
  184.            CheckForPullDown procedure                                             Pull
  185.            ---------------------------------------------------------------------------
  186.            Function       Displays help message, reads keyboard input, and permits
  187.                           background processing while keyboard is idle.
  188.            Declaration    CheckForPullDown (MsgLineNum: byte)
  189.            Remarks        This procedure is primarily used in user windows that to
  190.                           interface with the pull-down menus.  It analyzes the current
  191.                           status of the menu control flags to see if it has reached
  192.                           its destination menu/window.  If WaitForKbd is false when
  193.                           entering this procedure, it will assume that Key and ExtKey
  194.                           are set correctly and not wait for the keyboard input for
  195.                           just one pass.  ReadKbd and KbdIdle are subroutines.
  196.            Example        See the User Window section in PULL55.DOC.
  197.            See also       CheckForPop, KbdIdle, ReadKbd
  198.  
  199.            ---------------------------------------------------------------------------
  200.            CheckGlobalKeys procedure                                          PullStat
  201.            ---------------------------------------------------------------------------
  202.            Function       Provides a case of global keystrokes to access any part
  203.                           of the program at any time.
  204.            Declaration    Called indirectly by PULL.
  205.            Remarks        Global keys can be any extended key.  The contents are
  206.                           optional, but the procedure must exist.  You must include
  207.                           PullStat in at least on USES statement in the program even
  208.                           though it can compile without it.
  209.            See also       GetUserPullStats, GetOverrideStats
  210.  
  211.            ---------------------------------------------------------------------------
  212.            DisplayFields procedure                                                Pull
  213.            ---------------------------------------------------------------------------
  214.            Function       Displays the contents of a sequence of data entry fields
  215.                           given the first and last record numbers.
  216.            Declaration    DisplayFields (First,Last: word)
  217.            Remarks        Fields are displayed in window-relative coordinates.
  218.            See also       Enter, EnterSeq
  219.  
  220.  
  221.  
  222.            Chapter 2, Procedures and Functions                                 Page 4
  223.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  224.  
  225.  
  226.            ---------------------------------------------------------------------------
  227.            Enter procedure                                                        Pull
  228.            ---------------------------------------------------------------------------
  229.            Function       Edits a field for a single data entry given the Data Entry
  230.                           record.
  231.            Declaration    Enter (RecNum: word);
  232.            Remarks        This procedure is used if you want to customize your own
  233.                           sequence of entry.  RecNum is the record number of the data
  234.                           entry.  This procedure only shows the string being edited
  235.                           for input.  For output display, use DisplayFields.
  236.            See also       DisplayFields, EnterSeq
  237.  
  238.            ---------------------------------------------------------------------------
  239.            EnterSeq procedure                                                     Pull
  240.            ---------------------------------------------------------------------------
  241.            Function       Edits a sequence of fields for data entry given the Data
  242.                           Entry records.
  243.            Declaration    EnterSeq (First,Last: word; VAR Start: word);
  244.            Remarks        This procedure handles full editing of a sequence of data
  245.                           entries handled by smart HiLite algorithms.  The sequence of
  246.                           entry is the order of DataEntryNames in PULLDATA.PAS.
  247.                           First/Last are the first and last record numbers in the
  248.                           sequence.  Start is where you want the HiLite to start, and
  249.                           keeps up with the current record.  Use DisplayFields once
  250.                           before editing.
  251.            See also       DisplayFields, Enter
  252.  
  253.            ---------------------------------------------------------------------------
  254.            GetOverrideStats procedure                                         PullStat
  255.            ---------------------------------------------------------------------------
  256.            Function       Overrides any default configurations set by GetUserPullStats
  257.                           and InitPull.
  258.            Declaration    Called indirectly by PULL.
  259.            Remarks        If you have any exceptions for your menu records, place your
  260.                           assignments in this procedure.  The contents are optional,
  261.                           but the procedure must exist.  You must include PullStat in
  262.                           at least one USES statement in the program even though it
  263.                           can compile without it.
  264.            See also       CheckGlobalKeys, GetUserPullStats
  265.  
  266.            ---------------------------------------------------------------------------
  267.            GetUserPullStats procedure                                         PullStat
  268.            ---------------------------------------------------------------------------
  269.            Function       Initializes all menus, windows and message lines for the
  270.                           pull-down environment.
  271.            Declaration    Called indirectly by PULL.
  272.            Remarks        You must include the PullStat in at least one USES statement
  273.                           in the program even though it can compile without it.
  274.            See also       CheckGlobalKeys, GetOverrideStats
  275.  
  276.            ---------------------------------------------------------------------------
  277.            GotoKeyDispatcher procedure                                            Pull
  278.            ---------------------------------------------------------------------------
  279.            Function       Turns control over to PULL.
  280.            Declaration    GotoKeyDispatcher
  281.  
  282.  
  283.            Chapter 2, Procedures and Functions                                 Page 5
  284.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  285.  
  286.  
  287.            Remarks        This procedure is called by your main program after all the
  288.                           data record have been initialized.
  289.            Example        See PULLDEMO.PAS.
  290.  
  291.            ---------------------------------------------------------------------------
  292.            HelpKeyPressed function                                                Pull
  293.            ---------------------------------------------------------------------------
  294.            Function       Trivial function returns true if the context-sensitive help
  295.                           key has been pressed.
  296.            Declaration    HelpKeyPressed
  297.            Result type    boolean
  298.            Remarks        PULL is currently assigned the F1 key for the help window.
  299.            See also       TopKeyPressed, PullHelpWndw
  300.  
  301.            ---------------------------------------------------------------------------
  302.            HiLiteRow procedure                                                    Pull
  303.            ---------------------------------------------------------------------------
  304.            Function       Highlights a line in a menu.
  305.            Declaration    HiLiteRow (Row: byte; Attr: integer)
  306.            Remarks        This procedure can be used in any user menu to show the
  307.                           HiLite bar by simply changing the attribute.  Row is a
  308.                           window-relative row and Attr is the attribute for the
  309.                           HiLite.
  310.  
  311.            ---------------------------------------------------------------------------
  312.            InitPull procedure                                                     Pull
  313.            ---------------------------------------------------------------------------
  314.            Function       Initializes WNDW and PULL records.
  315.            Declaration    InitPull (Attr: integer; ClearScr: boolean)
  316.            Remarks        Attr is the attribute of Window0 and is also assigned to the
  317.                           global variable InitAttr.  If ClearScr is true, it will
  318.                           clear the screen which is not necessary for PermMode
  319.                           windows.  This procedure is required and is only used once.
  320.  
  321.            ---------------------------------------------------------------------------
  322.            InRangeW function                                                      Pull
  323.            ---------------------------------------------------------------------------
  324.            Function       Returns true if a word test value is between the high and
  325.                           low limits inclusive.
  326.            Declaration    InRangeW (Low,Value,High: word)
  327.            Result type    boolean
  328.            Remarks        The function will swap Low and High before testing if they
  329.                           are not in the correct order.
  330.            Restrictions   Negative values cannot be used.
  331.  
  332.            ---------------------------------------------------------------------------
  333.            Popped function                                                        Pull
  334.            ---------------------------------------------------------------------------
  335.            Function       Used to detect if all menus have all been removed before
  336.                           executing menu procedures.
  337.            Declaration    Popped
  338.            Result type    boolean
  339.            Remarks        This function is used in procedures called by the menu
  340.                           ProcPtr.  PULL executes the ProcPtr procedure twice when
  341.                           Popped is used.  It sets several flags for you including
  342.  
  343.  
  344.            Chapter 2, Procedures and Functions                                 Page 6
  345.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  346.  
  347.  
  348.                           PopAndProcess.  The first time Popped is tested it returns
  349.                           false and sets the appropriate flags.  When the menus are
  350.                           removed and ProcPtr is executed again, Popped will be true.
  351.                           This allows your statement to read like plain English.
  352.            Example        This far procedure is called by a ProcPtr in a menu:
  353.  
  354.                             procedure MyProc;
  355.                             begin
  356.                               if Popped then DoMyProc;
  357.                             end;
  358.  
  359.            ---------------------------------------------------------------------------
  360.            PullDirectory procedure                                             PullDir
  361.            ---------------------------------------------------------------------------
  362.            Function       Displays the contents of the current disk directory.
  363.            Declaration    PullDirectory (VAR NameToChange: FileNameStr;
  364.                                              NameToHiLite: FileNameStr);
  365.            Remarks        Pressing RETURN on the HiLited item will be assigned to
  366.                           NameToChange.  If NameToHiLite is given, the menu will be
  367.                           displayed initially with the HiLite centered in the menu on
  368.                           NameToHiLite.  If NameToHiLite is null, the HiLite will just
  369.                           be centered on the first page.
  370.            Example        See PULLSTAT.PAS for PULLDEMO.PAS.
  371.  
  372.            ---------------------------------------------------------------------------
  373.            PullHelpWndw procedure                                                 Pull
  374.            ---------------------------------------------------------------------------
  375.            Function       Displays a context-sensitive help window.
  376.            Declaration    PullHelpWindow (WndwNum: byte);
  377.            Remarks        This procedure can be used in any procedure where keyboard
  378.                           input is tested.  WndwNum is the HelpWndw record number, but
  379.                           using the ordinal value of HelpWndwNames is easier to use.
  380.            See also       HelpKeyPressed
  381.  
  382.            ---------------------------------------------------------------------------
  383.            ReadKbd procedure                                                      Pull
  384.            ---------------------------------------------------------------------------
  385.            Function       Reads keyboard input and permits background processing while
  386.                           keyboard is idle.
  387.            Declaration    ReadKbd (VAR ExtKey: boolean; VAR Key: char);
  388.            Remarks        ExtKey is true if the key is extended.  Key is the character
  389.                           of the key entered.  In addition, holding down the Alt key
  390.                           will display the global key combination message.  Also,
  391.                           while the keyboard is idle, the KbdIdle procedure is being
  392.                           continually executed.
  393.            See also       CheckForPullDown, KbdIdle
  394.  
  395.            ---------------------------------------------------------------------------
  396.            SetCmdSeq procedure                                                    Pull
  397.            ---------------------------------------------------------------------------
  398.            Function       Sets PULL control flags to shortest path to the new menu.
  399.            Declaration    SetCmdSeq (NewCmdSeq: SeqStr)
  400.            Remarks        NewCmdSeq is the sequence of command letters pressed after
  401.                           F10 to arrive at a new menu or window.  NewCmdSeq and the
  402.                           current position, CmdSeq, are compared to create an new path
  403.  
  404.  
  405.            Chapter 2, Procedures and Functions                                 Page 7
  406.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  407.  
  408.  
  409.                           by setting MoreCmdSeq and PopLevels.
  410.  
  411.            ---------------------------------------------------------------------------
  412.            ShowErrMsg procedure                                                   Pull
  413.            ---------------------------------------------------------------------------
  414.            Function       Shows an error message on the message line.
  415.            Declaration    ShowErrMsg (ErrMsgNum: word);
  416.            Remarks        ErrMsgNum is the index of the ErrMsgLine to display.  It is
  417.                           easier to use the ordinal value of ErrMsgNames to identify
  418.                           the message to display.  This message is usually used by
  419.                           data entry routines.  After pressing ESC to acknowledge the
  420.                           message, the original message is restored.
  421.            See also       ShowMsg
  422.            Example        Show the error message line named MyErrMsg:
  423.  
  424.                             ShowErrMsg (ord(MyErrMsg));
  425.  
  426.            ---------------------------------------------------------------------------
  427.            ShowMsg procedure                                                      Pull
  428.            ---------------------------------------------------------------------------
  429.            Function       Shows a message on the message line.
  430.            Declaration    ShowMsg (MsgNum: byte)
  431.            Remarks        MsgNum is the index of the MsgLine to display.  It is easier
  432.                           to use the ordinal value of MsgLineNames to identify the
  433.                           message to display.
  434.            See also       CheckForPullDown, ShowErrMsg
  435.            Example        Show the message line named MyMsg:
  436.  
  437.                             ShowMsg (ord(MyMsg));
  438.  
  439.  
  440.            ---------------------------------------------------------------------------
  441.            ShowTopLine procedure                                                  Pull
  442.            ---------------------------------------------------------------------------
  443.            Function       Simply displays the unhighlighted Top Line Menu.
  444.            Declaration    ShowTopLine
  445.            Remarks        This procedure is used to initially display the Top Line
  446.                           menu for the screen design in PULLWORK.PAS or PULLSHEL.PAS.
  447.                           It writes the string TopLineStr to the screen which is
  448.                           assembled by InitPull.
  449.  
  450.            ---------------------------------------------------------------------------
  451.            StrSL function                                                         Pull
  452.            ---------------------------------------------------------------------------
  453.            Function       Returns a string left justified in a field of spaces.
  454.            Declaration    StrSL (S: string; Field: byte)
  455.            Result type    string
  456.            Remarks        If Field is less than the length of the string, the string
  457.                           is simply returned.
  458.            See also       StrSR
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.            Chapter 2, Procedures and Functions                                 Page 8
  467.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  468.  
  469.  
  470.            ---------------------------------------------------------------------------
  471.            StrSR function                                                         Pull
  472.            ---------------------------------------------------------------------------
  473.            Function       Returns a string right justified in a field of spaces.
  474.            Declaration    StrSR (S: string; Field: byte)
  475.            Result type    string
  476.            Remarks        If Field is less than the length of the string, the string
  477.                           is simply returned.
  478.            See also       StrSL
  479.  
  480.            ---------------------------------------------------------------------------
  481.            TopKeyPressed function                                                 Pull
  482.            ---------------------------------------------------------------------------
  483.            Function       Trivial function returns true if the top line menu key has
  484.                           been pressed.
  485.            Declaration    TopKeyPressed
  486.            Result type    boolean
  487.            Remarks        PULL is currently assigned the F10 key for the top line
  488.                           menu.
  489.            See also       HelpKeyPressed
  490.  
  491.            ---------------------------------------------------------------------------
  492.            TurnArrows procedure                                                   Pull
  493.            ---------------------------------------------------------------------------
  494.            Function       Displays or removes arrows on the highlighted line of a
  495.                           menu that pulls down a submenu or user window.
  496.            Declaration    TurnArrows (Switch: Toggle)
  497.            Remarks        This procedure is used primarily to interface with user
  498.                           windows that require the arrows to be turned on or off.
  499.            Example        See the User Window section in PULL55.DOC.
  500.  
  501.            ---------------------------------------------------------------------------
  502.            WorkWndw procedure                                                 PullWork
  503.            ---------------------------------------------------------------------------
  504.            Function       Provides a case of steps for the work window as the main
  505.                           part of the program.
  506.            Declaration    Called indirectly by PULL.
  507.            Remarks        The contents are optional, but the procedure must exist.
  508.                           You must include PullWork in the USES statement of the main
  509.                           program even though it can compile without it.
  510.            Example        See PULLSHEL.PAS and PULLDEMO.PAS.
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.            Chapter 2, Procedures and Functions                                 Page 9
  528.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  529.  
  530.  
  531.            3.  D A T A   S T R U C T U R E
  532.  
  533.            This section will help describe the data structure of PULL and how it can
  534.            be adjusted.  The variables in P55-VAR.INC are allocated according to the
  535.            conditional directives and constants set at the beginning of the file.
  536.            There are several basic variables, but if desired, there are additional
  537.            variables for virtual windows and multiple video pages.  Please refer to
  538.            the source code in P55-VAR.INC for the exact listing.
  539.  
  540.  
  541.            CONFIGURATION CONSTANTS
  542.  
  543.            These constants configure the size of the data structure.  If you have the
  544.            complete source code, the constants can be trimmed to fit the requirements
  545.            of your application program.  While developing the program, you can balloon
  546.            these values so that PULL does not need to be recompiled every time the
  547.            program expands.
  548.  
  549.              Constant          Value  Description
  550.              ----------------  -----  ------------------------------------------------
  551.              NumOfMainMenus    1-255  Sets the maximum number of main menu records to
  552.                                       be held in the heap.
  553.  
  554.              NumOfSubMenus     1-255  Sets the maximum number of submenu records to be
  555.                                       held in the heap.
  556.  
  557.              MaxMenuLines      1-253  Sets the maximum number of menu lines in each
  558.                                       menu record.
  559.  
  560.              MaxCharsPerLine   1-247  Sets the maximum number of characters per line
  561.                                       in all menu lines.  It also limits the size of
  562.                                       the title for the data windows.
  563.  
  564.              NumOfDataWndws    1-255  Sets the maximum number of data window records
  565.                                       to be held in the heap.
  566.  
  567.              NumOfDataEntries  1-255  Sets the maximum number of data entry records to
  568.                                       be held in the heap.
  569.  
  570.              DataStrSize       1-255  Sets the maximum number of characters that can
  571.                                       be entered in a data entry of any kind.
  572.  
  573.              NumOfHelpWndws    1-255  Sets the maximum number of help window records
  574.                                       to be held in global data.
  575.  
  576.              TotalHelpLines    1-255  Sets the maximum number of help lines in the
  577.                                       HelpLine array.  A greater number of lines can
  578.                                       be used if TP5 enumerated types are not used for
  579.                                       the index.
  580.  
  581.              HelpCharsPerLine  1-241  Sets the maximum number of characters per line
  582.                                       in all help windows.  Remember this excludes the
  583.                                       two extra spaces between border and text.
  584.  
  585.              NumOfMsgLines     1-255  Sets the maximum number of message lines to be
  586.  
  587.  
  588.            Chapter 3, Data Structure                                           Page 10
  589.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  590.  
  591.  
  592.                                       allocated in the MsgLine array.
  593.  
  594.              CrtStrSize        1-255  Sets the maximum number of characters that can
  595.                                       appear on a CRT.
  596.  
  597.              NumOfErrMsgLines  1-up   Sets the maximum number of message lines to be
  598.                                       allocated in the ErrMsgLine array.
  599.  
  600.              ErrStrSize        1-255  Sets the maximum number of characters in a
  601.                                       single ErrStrLine message.  This is usually less
  602.                                       than CrtStrSize, but cannot be greater.
  603.  
  604.  
  605.            MAIN MENU DECLARATIONS
  606.  
  607.            The following types, variables and constants are used for primarily for the
  608.            main menus.  The variables are described in the order of their appearance
  609.            in the file P55-VAR.INC.
  610.  
  611.  
  612.            Types - These types are used to structure variables for the main menus:
  613.  
  614.              Type          Description
  615.              ------------  -----------------------------------------------------------
  616.              MenuModeType  This enumerated type gives a name for three different menu
  617.                            modes.  Each mode controls how each line will interact with
  618.                            the other lines.
  619.  
  620.                              Name            Description
  621.                              --------------  --------------------------------------
  622.                              ExecChoice      Executes the procedures indicated by
  623.                                              ProcPtr and does not interact with the
  624.                                              other menu lines.  This is the default.
  625.                              SingleChoice    Flags only the selected line in the menu
  626.                                              and turns off all other flags.  If
  627.                                              ProcPtr is not nil, it will also execute
  628.                                              the procedure before flagging.
  629.                              MultipleChoice  Toggles the flag on any line in the menu.
  630.                                              If ProcPtr is not nil, it will also
  631.                                              execute the procedure before flagging.
  632.  
  633.              LineModeType  This enumerated type gives a name for seven different line
  634.                            modes for any one line in the menu.
  635.  
  636.                              Name        Description
  637.                              ----------  ------------------------------------------
  638.                              Choice      Interacts with the rest of the menu
  639.                                          according to the given menu mode.
  640.                              ExecOnly    Only executes ProcPtr and ignores flagging.
  641.                              NoChoice    Disables line as a valid choice, but can be
  642.                                          restored by replacing the original line mode.
  643.                              Comment     Places text on the line with a different
  644.                                          attribute and passed by the highlight.
  645.                              Partition   Places a horizontal border through the menu
  646.                                          and is passed by the highlight.
  647.  
  648.  
  649.            Chapter 3, Data Structure                                           Page 11
  650.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  651.  
  652.  
  653.                              ToDataWndw  Places a dot symbol on the line and pulls
  654.                                          down a data entry window.
  655.                              ToSubMenu   Places a three-bar symbol on the line and
  656.                                          pulls down a submenu.
  657.                              ToUserWndw  Places a three-bar symbol on the line and
  658.                                          executes ProcPtr.
  659.  
  660.              ProcPtrType   This is the type established for procedure pointers and is
  661.                            a generic pointer type.
  662.  
  663.              Toggle        This enumerated type is just a practical way of
  664.                            understanding the source code to indicate the common binary
  665.                            conditions of On/Off and Yes/No.
  666.  
  667.              CrtStrType    Combined with CrtStrSize, this type will limit the size of
  668.                            strings needed to display data onto the screen.  It is
  669.                            usually used for message lines.
  670.  
  671.              SeqStrType    This type is used for strings that keep a record of the
  672.                            command sequence.  Since the sequence is not greater than
  673.                            the number of windows on the screen at any one time,
  674.                            Wndw.MaxWndw is used.
  675.  
  676.              MenuRec       This record is used to fully describe any menu.  Each field
  677.                            is worth describing.
  678.  
  679.                              Title - For main menus, this name will appear on the Top
  680.                              Line menu.
  681.  
  682.                              CmdLtrs - InitPull assigns the first letter of each menu
  683.                              line to be its corresponding command letter.  This string
  684.                              keeps these assignments in sequence so that the line 1
  685.                              letter is position 1, line 2 is position 2, etc.
  686.  
  687.                              Line - This is the array of the actual text that will
  688.                              appear on each menu line.  The default is ''.
  689.  
  690.                              LineMode - This array is the line mode corresponding to
  691.                              each line.  The default is Choice.
  692.  
  693.                              Flagged - This array is the status of the boolean flag
  694.                              corresponding to each line.  The default is false.
  695.  
  696.                              LinkNum - This array has the byte value of submenu or
  697.                              data window names of records to be linked.  The default
  698.                              is 0.
  699.  
  700.                              ProcPtr - This array has the pointers for executing far
  701.                              procedures when the menu line is selected.  The default
  702.                              is nil which executes nothing.
  703.  
  704.                              ParentDir - This is the linking direction assigned to the
  705.                              parent menu of this menu (which would be a submenu).  For
  706.                              main menus, this value is NoDir.
  707.  
  708.  
  709.  
  710.            Chapter 3, Data Structure                                           Page 12
  711.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  712.  
  713.  
  714.                              LinkDir - This is the linking direction assigned to all
  715.                              submenus on this menu which is determined by InitPull.
  716.  
  717.                              MenuMode - This is the menu mode.
  718.  
  719.                              MenuLines - This is the number of lines contained in this
  720.                              menu and is determined by InitPull.
  721.  
  722.                              NameCol - For main menus, this is the column that the
  723.                              HiLite is to appear on the Top Line menu which would
  724.                              highlight the title.
  725.  
  726.                              Row .. Cols - These variables locate and size the window
  727.                              for the menu.
  728.  
  729.                              DefaultLine - This is the line to be highlighted when the
  730.                              program first starts.
  731.  
  732.                              HiLiteLine - This is the current position of the HiLite
  733.                              on this menu.
  734.  
  735.                              SingleFlagLine - This is the line that has the only flag
  736.                              in SingleChoice menu mode.
  737.  
  738.                              The following variables control the attributes in the
  739.                              menus.  SameAttr is not permitted.
  740.  
  741.                                Battr - Border
  742.                                Wattr - entire Window contents
  743.                                Hattr - HiLite
  744.                                Lattr - command Letter
  745.                                Cattr - Comment line
  746.  
  747.                              Border - This is the border style used for the menu.
  748.  
  749.                              BackToDefault - If true, the HiLite will return to the
  750.                              DefaultLine every time the menu is pulled down.  The
  751.                              default is false.
  752.  
  753.                              Changed - PULL will toggle this to true if any of the
  754.                              flags have been altered.  It is up to the programmer to
  755.                              reset it to false if it is needed.
  756.  
  757.                              MsgLineNum - This is the index number of the MsgLine to
  758.                              be displayed concurrently with this menu.
  759.  
  760.                              HelpWndwNum - This is the index number of the HelpWndw
  761.                              record to be displayed for this menu when context-
  762.                              sensitive help is requested.
  763.  
  764.              MenuRecs      This array allocates the total number of main menu records
  765.                            needed for the heap.  They do not all have to be used.
  766.  
  767.  
  768.            Variables - The following are the global variables used to create and
  769.  
  770.  
  771.            Chapter 3, Data Structure                                           Page 13
  772.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  773.  
  774.  
  775.            control the pull-down menus:
  776.  
  777.              Variable      Description
  778.              ------------  -----------------------------------------------------------
  779.              MainMenu      (Type: ^MenuRecs) This is the pointer of the array of main
  780.                            menu records in the heap.
  781.  
  782.              TopMenu       (Type: MenuRec)  As each menu record is accessed, main menu
  783.                            or submenu, a copy of the record is made in TopMenu to
  784.                            increase speed and save code.  The record is saved back in
  785.                            the heap after use.
  786.  
  787.              MRI           (Type: word)  When a menu is copied into TopMenu, the array
  788.                            index of the record is saved in this variable for later
  789.                            reference.
  790.  
  791.              LastMainMenu  (Type: byte)  This is the index of the last main menu
  792.                            displayed on the far right of the Top Line menu.  It is
  793.                            <=NumOfMainMenus.
  794.  
  795.              TopLineStr    (Type: CrtStrType)  This is the actual string that appears
  796.                            as the Top Line menu when ShowTopLine is used.
  797.  
  798.              TopLineRow    (Type: byte) This is the row on which TopLineStr appears.
  799.  
  800.              MainMenuRow   (Type: byte) This is the row on which the top border of the
  801.                            main menus appears.
  802.  
  803.  
  804.            Attributes - The following variables control the default attributes and
  805.            border in all the main menus and the top line menu.  SameAttr is not
  806.            permitted in byte types.
  807.  
  808.              Name           Type      Description
  809.              -------------  --------  -------------------------------------
  810.              InitAttr       integer   base screen, set by Attr in InitPull.
  811.              TopLineAttr    byte      top line menu.
  812.              TopLineHattr   byte      HiLite on top line menu.
  813.              TopLineLattr   byte      command Letters on top line menu.
  814.              MainMenuWattr  byte      entire Window contents.
  815.              MainMenuBattr  byte      main menu Border.
  816.              MainMenuHattr  byte      HiLite in main menu.
  817.              MainMenuLattr  byte      command Letters in main menu.
  818.              MainMenuCattr  byte      Comment line.
  819.              MainMenuBrdr   Borders   main menu Border style.
  820.  
  821.  
  822.            Keyboard - The following variables and constant contain the last keyboard
  823.            input from ReadKbd or CheckForPullDown.
  824.  
  825.              Variable      Description
  826.              ------------  -----------------------------------------------------------
  827.              Key           (Type: char) Contains the key code of the input.
  828.  
  829.              ExtKey        (Type: boolean) Set true if extended key.
  830.  
  831.  
  832.            Chapter 3, Data Structure                                           Page 14
  833.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  834.  
  835.  
  836.  
  837.              WaitForKbd    (Type: boolean = true) This typed constant causes a wait
  838.                            for keyboard input when executing CheckForPullDown.  If it
  839.                            is false, then the current values of Key and ExtKey are
  840.                            considered valid and execution continues.
  841.  
  842.  
  843.            Control Flags - The following variables programmably control the pull-down
  844.            menus in lieu of the end user.
  845.  
  846.              Variable      Description
  847.              ------------  -----------------------------------------------------------
  848.              PullDown      (Type: boolean)  When set true, the menus will be pulled
  849.                            down from their current position according to the sequence
  850.                            in MoreCmdSeq.
  851.  
  852.              Pop           (Type: boolean)  This flag is controlled by CheckForPop and
  853.                            sets it true if the program needs to pop out of the current
  854.                            menu.
  855.  
  856.              PopToWorkWndw (Type: boolean)  If true, the menus will all pop and return
  857.                            control to the work window.
  858.  
  859.              PopToTop      (Type: boolean)  If true, control is set to highlight the
  860.                            Top Line menu.
  861.  
  862.              PopAndProcess (Type: boolean)  This flag is controlled by the Popped
  863.                            function to execute a ProcPtr in the menus after all the
  864.                            menus have been popped.
  865.  
  866.              PopLevels     (Type: byte)  This flag is controlled by SetCmdSeq or can
  867.                            be used manually.  It simply pops the number of levels of
  868.                            menus/windows.
  869.  
  870.              Quit          (Type: boolean = false)  This typed constant controls
  871.                            execution of the program.  If set true, the program will
  872.                            terminate with all menus popped.
  873.  
  874.  
  875.            Menu Sequence - The following variables indicate the current status of the
  876.            menus and work windows.  You can know what the current menu is and the
  877.            current sequence of letter commands to get there.
  878.  
  879.              Variable      Description
  880.              ------------  -----------------------------------------------------------
  881.              TopCmdLtrs    (Type: string[NumOfMainMenus])  This is the counterpart of
  882.                            Menu.CmdLtrs for the Top Line menu.  It holds the command
  883.                            letters for the Top Line menu where character 1 corresponds
  884.                            to the first main menu, character 2 to the second, etc.
  885.  
  886.              CmdSeq        (Type: SeqStrType)  This is the current sequence of letters
  887.                            used to arrive at the current menu/window where the last
  888.                            character is the last menu.  While in the work window, this
  889.                            string is null.  Do not change this string.
  890.  
  891.  
  892.  
  893.            Chapter 3, Data Structure                                           Page 15
  894.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  895.  
  896.  
  897.              MoreCmdSeq    (Type: SeqStrType)  When performing a programmed pull down,
  898.                            this is the sequence of letters yet to be executed in the
  899.                            same order as CmdSeq.
  900.  
  901.              MPulled       (Type: byte)  This is the index of the current main menu
  902.                            pulled.
  903.  
  904.              SPulled       (Type: byte)  This is the index of the current submenu
  905.                            pulled.  If no submenu is pulled, this value is 0.
  906.  
  907.              HiLited       (Type: byte)  This is the row number of the currently
  908.                            highlighted line.
  909.  
  910.              AccessedWorkWndw  (Type: boolean)  This is a handy flag available for
  911.                            testing in your program.  If you are in the menus and you
  912.                            run your custom routine with ProcPtr to set this false, the
  913.                            next time the work window is accessed, this variable will
  914.                            be true.
  915.  
  916.              AccessedMenus (Type: boolean)  This is a handy flag available for
  917.                            testing in your program.  If you are in the work window and
  918.                            set this false, the next time the menus are accessed, this
  919.                            variable will be true.
  920.  
  921.              WorkWndwStep  (Type: byte)  This is the current step number assigned to
  922.                            the work windows in PULLWORK.PAS.
  923.  
  924.              TopWorkWndwName (Type: WindowNames)  This is the name of the work window
  925.                            to be selected for access or the current one on top.
  926.  
  927.              InWorkWndw    (Type: boolean = true)  When true, this typed constant
  928.                            indicates if the program is in the work window.  It is
  929.                            otherwise in the menus.
  930.  
  931.  
  932.            Addresses for Calls - The following pointers are used indirectly by
  933.            indirect calls in PULL.TPU so that TP5 units can make calls forward outside
  934.            of a unit and also be compatible with TP4.  These are far addresses and are
  935.            accessed as pointers with inline calls.
  936.  
  937.              Address variable      Unit.Procedure
  938.              --------------------  -------------------------
  939.              AddrGetUserPullStats  PullStat.GetUserPullStats
  940.              AddrGetOverrideStats  PullStat.GetOverrideStats
  941.              AddrWorkWndw          PullWork.WorkWndw
  942.              AddrCheckGlobalKeys   PullStat.CheckGlobalKeys
  943.              AddrKbdIdle           PullWork.KbdIdle
  944.  
  945.  
  946.            Untyped Key Constants - Several key constants have already been provided
  947.            for frequently used keys.  Please refer to P55-VAR.INC for the listing.
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.            Chapter 3, Data Structure                                           Page 16
  955.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  956.  
  957.  
  958.            SUBMENU DECLARATIONS
  959.  
  960.            The following type and variables are used for the sub menus.  The variables
  961.            are described in the order of their appearance in the file P55-VAR.INC.
  962.            The program was carefully planned so that main menu records would match
  963.            that of the submenus.
  964.  
  965.  
  966.            Type - This type is used to structure variables in the heap for the
  967.            submenus:
  968.  
  969.              Type          Description
  970.              ------------  -----------------------------------------------------------
  971.              SubMenus      This array allocates the total number of submenu records
  972.                            needed for the heap.  They do not all have to be used.
  973.  
  974.            The Row/Col fields in the menu record for submenus default to zero so that
  975.            PULL can locate them at run time for the slide-up configuration.  If they
  976.            are set to non-zero values in PULLSTAT, then the menu will be located
  977.            absolutely to the screen at (Row,Col).
  978.  
  979.            Variables - The following are the global variables used to allocate and
  980.            configure the submenus:
  981.  
  982.              Variable      Description
  983.              ------------  -----------------------------------------------------------
  984.              SubMenu       (Type: ^MenuRecs) This is the pointer of the array of
  985.                            submenu menu records in the heap.
  986.  
  987.              LastSubMenu   (Type: byte)  This is the index of the highest submenu
  988.                            record number in use.  It is <=NumOfSubMenus.
  989.  
  990.  
  991.            Attributes - The following variables control the default attributes and
  992.            border in all the submenus.  SameAttr is not permitted in byte types.
  993.  
  994.              Name          Type      Description
  995.              ------------  --------  -------------------------------------
  996.              SubMenuWattr  byte      entire Window contents.
  997.              SubMenuBattr  byte      submenu Border.
  998.              SubMenuHattr  byte      HiLite in submenu.
  999.              SubMenuLattr  byte      command Letters in submenu.
  1000.              SubMenuCattr  byte      Comment line.
  1001.              SubMenuBrdr   Borders   submenu Border style.
  1002.  
  1003.  
  1004.            MESSAGE LINE DECLARATIONS
  1005.  
  1006.            The following type, constant and variables are used to generate normal key
  1007.            messages or error messages on the message line.
  1008.  
  1009.            Type - The following type is the only one needed for error messages:
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.            Chapter 3, Data Structure                                           Page 17
  1016.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1017.  
  1018.  
  1019.              Type           Description
  1020.              -------------  -----------------------------------------------------------
  1021.              ErrMsgStrType  This is the type used to size the length for all error
  1022.                             messages based on ErrMsgSize.  Since they are usually
  1023.                             short, they can be trimmed to the length of the longest
  1024.                             one.
  1025.  
  1026.            Constants - The following constants are given initial values to process the
  1027.            messages on the message line.
  1028.  
  1029.              Constant           Description
  1030.              -----------------  ------------------------------------------------------
  1031.              CurrentMsgLineNum  (Type: word = 0)  This is the index of the current
  1032.                                 MsgLine displayed on the screen.
  1033.  
  1034.              EnableKeyStatus    (Type: boolean = true)  When true, the status of
  1035.                                 NumLock, ScollLock, and CapsLock will appear on the
  1036.                                 message line.
  1037.  
  1038.            Variables - The following variables allocate space for the messages in
  1039.            global data and control the location of the messages and the key status
  1040.            indicators:
  1041.  
  1042.              Variable      Description
  1043.              ------------  -----------------------------------------------------------
  1044.              MsgLine       (Type: array of CrtStrType)  This array allocates global
  1045.                            data space for the messages.  If you intend to have several
  1046.                            messages, you should consider making this data in the heap.
  1047.  
  1048.              ErrMsgLine    (Type: array of ErrMsgStrType)  This array allocates global
  1049.                            data space for the error messages.  If you intend to have
  1050.                            several messages, you should consider making this data in
  1051.                            the heap.
  1052.  
  1053.              MsgLineRow    (Type: byte) This is the absolute row on which all messages
  1054.                            and error messages are to appear.
  1055.  
  1056.              CapsLockCol   (Type: byte) This is the column on the message line row on
  1057.                            which the status indicators will appear.
  1058.  
  1059.            Attributes - The following variables control the attributes on the message
  1060.            line.  SameAttr is not permitted in byte types.
  1061.  
  1062.              Name           Type  Description
  1063.              ------------   ----  ------------------------------
  1064.              ErrMsgAttr     byte  For error messages.
  1065.              KeyStatusAttr  byte  For the key status indicators.
  1066.              MsgLineAttr    byte  For the normal messages.
  1067.  
  1068.  
  1069.            HELP WINDOW DECLARATIONS
  1070.  
  1071.            The following types and variables are used to create context-sensitive help
  1072.            windows.
  1073.  
  1074.  
  1075.  
  1076.            Chapter 3, Data Structure                                           Page 18
  1077.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1078.  
  1079.  
  1080.            Type - The following record is the only one needed for help windows:
  1081.  
  1082.              Type          Description
  1083.              ------------  -----------------------------------------------------------
  1084.              HelpWndwRec   This record is used to fully describe any help window.
  1085.                            Each field is described below:
  1086.  
  1087.                              FirstLine/LastLine - This is the first and last indexes
  1088.                              in the HelpLines array that has the messages to appear in
  1089.                              the help window.
  1090.  
  1091.                              LinesToShow - For now, the help window is a single page
  1092.                              display and so this value is simply the number of lines
  1093.                              from FirstLine to LastLine.
  1094.  
  1095.                              Row .. Cols - These variables locate and size the help
  1096.                              window.  HelpBottomRow and HelpCharsPerLine are used to
  1097.                              calculate these values.
  1098.  
  1099.                              The following variables control the attributes in the
  1100.                              menus.  SameAttr is not permitted.
  1101.  
  1102.                                Battr - Border set by HelpWndwBattr
  1103.                                Wattr - entire Window contents set by HelpWndwWattr
  1104.  
  1105.                              Border - This is the border style used around the window
  1106.                              and set to HelpWndwBrdr by default.
  1107.  
  1108.                              HWmodes - This is the window modes used to create the
  1109.                              window on the screen.  HelpWndwModes is used to set this
  1110.                              value by default.
  1111.  
  1112.                              MsgLineNum - This is the index number of the MsgLine to
  1113.                              be displayed concurrently with the help window and is set
  1114.                              by default to HelpMsgLineNum.
  1115.  
  1116.            Variables - The following variables allocate space for the records and help
  1117.            lines in global data and control the location and appearance of the window:
  1118.  
  1119.              Variable        Description
  1120.              --------------  ---------------------------------------------------------
  1121.              HelpWndw        (Type: array of HelpWndwRec)  This array allocates global
  1122.                              data space for the help windows.  If you intend to have
  1123.                              several help window, you should consider making this data
  1124.                              disk based.
  1125.  
  1126.              HelpLine        (Type: array of ErrMsgStrType)  This array allocates
  1127.                              global data space for all the help lines.  If you intend
  1128.                              to have several lines, you should consider making this
  1129.                              data disk based.
  1130.  
  1131.              HelpBottomRow   (Type: byte)  This is the default row on which the bottom
  1132.                              row of the help window is to appear.  This keeps help
  1133.                              windows down lower.
  1134.  
  1135.  
  1136.  
  1137.            Chapter 3, Data Structure                                           Page 19
  1138.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1139.  
  1140.  
  1141.              HelpWndwModes   (Type: byte)  This is the default used to set
  1142.                              HelpWndw.HWmodes.  See WNDW.DOC for setting this
  1143.                              variable.
  1144.  
  1145.              HelpMsgLineNum  (Type: byte)  This is the index of MsgLine for the
  1146.                              message to appear concurrently with the help window.  The
  1147.                              index HelpML has been reserved as the default, but new
  1148.                              ones can be used as well.
  1149.  
  1150.            Attributes - The following variables control the default attributes and
  1151.            border in all the submenus.  SameAttr is not permitted in byte types.
  1152.  
  1153.              Name           Type      Description
  1154.              -------------  --------  -------------------------------------
  1155.              HelpWndwWattr  byte      entire Window contents.
  1156.              HelpWndwBattr  byte      help window Border.
  1157.              HelpWndwBrdr   Borders   help window Border style.
  1158.  
  1159.  
  1160.            DATA WINDOW / ENTRY DECLARATIONS
  1161.  
  1162.            The following types, constants and variables are used to create data entry
  1163.            windows and work window data entry fields.
  1164.  
  1165.  
  1166.            Types - The following types are used to structure the data window/entry
  1167.            records:
  1168.  
  1169.              Type            Description
  1170.              --------------  ---------------------------------------------------------
  1171.              TypeOfDataType  This enumerated type is used to indicate the type of data
  1172.                              being processed.  Although the identifier list is
  1173.                              intuitive, here is the list indicating its corresponding
  1174.                              type:
  1175.  
  1176.                                Name       Type
  1177.                                ---------  ---------
  1178.                                Bytes      byte
  1179.                                Words      word
  1180.                                ShortInts  shortint
  1181.                                Integers   integer
  1182.                                LongInts   longint
  1183.                                Reals      real
  1184.                                UserNums   DataStrType
  1185.                                Chars      char
  1186.                                Strings    DataStrType
  1187.  
  1188.  
  1189.              SetNames        This enumerated type identifies character sets to be used
  1190.                              for filtering each keystroke.  The names up to CharSet
  1191.                              are reserved, but the list can be appended.
  1192.  
  1193.              EntrySetArray   This is the structure for allocating the data entry
  1194.                              filter sets for the constant EntrySet.
  1195.  
  1196.  
  1197.  
  1198.            Chapter 3, Data Structure                                           Page 20
  1199.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1200.  
  1201.  
  1202.              DataEntryRec    This record is used to fully describe any data entry.
  1203.                              Each field is described below:
  1204.  
  1205.                                VarAddr - This is the absolute address where the
  1206.                                contents of the entry is stored.
  1207.  
  1208.                                TypeOfData - This declares the type of data located at
  1209.                                VarAddr.  It is up to your programming skills to make
  1210.                                sure that VarAddr and TypeOfData agree.
  1211.  
  1212.                                Row .. Col - For data windows, if these values default
  1213.                                to (1,2) for the field location.  For data entry, this
  1214.                                is the window-relative location of the field.
  1215.  
  1216.                                Field - This is the number of columns designated for
  1217.                                the input and output to be displayed.
  1218.  
  1219.                                MaxField - This is the maximum number of characters
  1220.                                that can appear in a field.  They can be less than or
  1221.                                greater than Field which creates a flex-field entry.
  1222.                                For strings, be sure that MaxField is no longer than
  1223.                                the string destination or DataStrSize.
  1224.  
  1225.                                Decimals - For reals, this value is used to format the
  1226.                                output output display which is Real:Field:Decimals.  If
  1227.                                Decimals is negative then the format is Real:Field.
  1228.  
  1229.                                SetName - This is the name of the set used to filter
  1230.                                the keystrokes into the field.  This variable is set by
  1231.                                default according to TypeOfData.
  1232.  
  1233.                                TranslateProc - This procedure pointer is used to
  1234.                                execute a procedure to intercept the keystroke for
  1235.                                translation.  The default is nil.
  1236.  
  1237.                                CheckRangeProc - This procedure pointer is used to
  1238.                                execute a procedure for checking the range or content
  1239.                                of the entry before it is stored in the assigned
  1240.                                variable.  The default is nil.
  1241.  
  1242.                                JustifyOutput - The justification of the output in data
  1243.                                entry fields can be displayed by DisplayFields either
  1244.                                right or left justified.  By default, numbers are right
  1245.                                justified and strings left.
  1246.  
  1247.                                The following variables control the attributes in the
  1248.                                menus.  SameAttr is not permitted.
  1249.  
  1250.                                  Iattr - Input  default set by DataWndwIattr
  1251.                                  Oattr - Output default set by DataWndwOattr
  1252.  
  1253.                                MsgLineNum - This is the index number of the MsgLine to
  1254.                                be displayed concurrently with this entry during input.
  1255.  
  1256.                                HelpWndwNum - This is the index number of the HelpWndw
  1257.  
  1258.  
  1259.            Chapter 3, Data Structure                                           Page 21
  1260.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1261.  
  1262.  
  1263.                                record to be displayed when context-sensitive help is
  1264.                                requested.
  1265.  
  1266.              DataWndwRec     This record is used to fully describe any data window.
  1267.                              Each field is described below:
  1268.  
  1269.                                Title - This is the title to appear centered on the top
  1270.                                row of the border.  The default is ''.
  1271.  
  1272.                                DWrow / DWcol - If these values are the default zero,
  1273.                                PULL will locate the window at run time for the slide-
  1274.                                under configuration.  Non-zero values will override
  1275.                                PULL and locate the window absolute to the screen.
  1276.  
  1277.                                Battr - This is the attribute of the data window
  1278.                                border.
  1279.  
  1280.                                Border - This is the border style of the border.
  1281.  
  1282.                                Entry - (Type: DataEntryRec) This is a record within
  1283.                                the DataWndwRec that fully describes the field inside
  1284.                                the window.
  1285.  
  1286.              DataWndws       This sets the structure for all of the data window
  1287.                              records to be allocated in the heap.
  1288.  
  1289.              DataEntries     This sets the structure for all of the data entry records
  1290.                              in a work/user window to be allocated in the heap.
  1291.  
  1292.              DataStrType     Combined with DataStrSize, this type will limit the size
  1293.                              of strings that can be entered/read from any data entry.
  1294.  
  1295.              DataPadRec      This record conveniently groups all of the data needed
  1296.                              for the Data Pad.  Each one of the fields is described
  1297.                              below.
  1298.  
  1299.                                StoreMode - If true, the Data Pad will store the data
  1300.                                to its destination variable, else the Data Pad reads
  1301.                                the contents of the variable.
  1302.  
  1303.                                Valid - The result saved from the validity check for
  1304.                                numbers is true if it passes.
  1305.  
  1306.                                DataStored - If the data passes the validity check, the
  1307.                                range check, and is stored, this variable is set true
  1308.                                which is later used to set TopMenu.Changed to true.
  1309.  
  1310.                                NewData - This flag is used internally to indicate an
  1311.                                untampered entry has been displayed for editing.  Once
  1312.                                edited, this value is false.
  1313.  
  1314.                                PullDW - This flag indicates that a pull-down data
  1315.                                window is being used for data entry.
  1316.  
  1317.                                FieldIndex - This is the index of DataStr for the first
  1318.  
  1319.  
  1320.            Chapter 3, Data Structure                                           Page 22
  1321.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1322.  
  1323.  
  1324.                                character shown in the field.
  1325.  
  1326.                                CursorOfs - This is the offset from FieldIndex for the
  1327.                                position of the cursor.
  1328.  
  1329.                                Hattr - The attribute for the HiLite used to move from
  1330.                                field to field in the work window or user window can be
  1331.                                any attribute.  If SameAttr is used, only the cursor is
  1332.                                moved and the output attribute remains unchanged.
  1333.  
  1334.                                ErrMsg - After a range check, if this value is zero,
  1335.                                the entry value is in range.  If not, it is the number
  1336.                                of the error message to be displayed.
  1337.  
  1338.                                Flex - If MaxField does not equal Field, this value is
  1339.                                set to 1 to indicate a flex field.
  1340.  
  1341.                                Justify - This indicates the type of justification for
  1342.                                the input and output display of the field.  Input is
  1343.                                always left, but output can either be left or right.
  1344.  
  1345.                                TypeOfDataType - The last field in the data pad is the
  1346.                                scratch pad for placing any type of data.  To access
  1347.                                the data, use one of the following variant field
  1348.                                identifiers:
  1349.  
  1350.                                  Identifier Type
  1351.                                  ---------- ---------
  1352.                                  Bdata      Bytes
  1353.                                  Wdata      Words
  1354.                                  SIdata     ShortInts
  1355.                                  Idata      Integers
  1356.                                  Ldata      LongInts
  1357.                                  Rdata      Reals
  1358.                                  UNdata     UserNums
  1359.                                  Cdata      Chars
  1360.                                  Sdata      Strings
  1361.  
  1362.  
  1363.            Typed Constant - EntrySet is the array of the actual sets used for
  1364.            filtering the keystrokes before being entered into the field.  Along with
  1365.            each index name is the application of the set.  The sets up to CharSet are
  1366.            reserved.  Other sets can be appended.
  1367.  
  1368.              Index name   Application
  1369.              -----------  -----------------------------------------
  1370.              UnsignedSet  For Bytes and Words
  1371.              SignedSet    For ShortInts, Integers, and LongInts
  1372.              RealSet      For Reals
  1373.              CharSet      For Chars, Strings and misc. entry
  1374.              HexSet       For UserNums and Hex
  1375.              FileNameSet  For DOS file names
  1376.              PathSet      For DOS full path file names
  1377.              MaskSet      For DOS full path file names with wildcard
  1378.  
  1379.  
  1380.  
  1381.            Chapter 3, Data Structure                                           Page 23
  1382.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1383.  
  1384.  
  1385.            Variables - The following variables allocate space for data windows, data
  1386.            entries, and the data pad:
  1387.  
  1388.              Variable      Description
  1389.              ------------  ---------------------------------------------------------
  1390.              DWI           (Type: word)  Data Window Index used to save the current
  1391.                            data window record number currently in TopDataWndw.
  1392.  
  1393.              DEI           (Type: word)  Data Entry Index used to save the current
  1394.                            data entry record number currently in TopEntry.
  1395.  
  1396.              TopDataWndw   (Type: DataWndwRec)  This is a copy of the record from the
  1397.                            heap of the current DataWndwRec.  This saves code.
  1398.  
  1399.              TopEntry      (Type: DataEntryRec)  This is a copy of the record from the
  1400.                            heap of the current DataEntryRec.  This saves code.
  1401.  
  1402.              DataWndw      (Type: ^DataWndws) This pointer accesses the array of
  1403.                            data window records in the heap.
  1404.  
  1405.              DataEntry     (Type: ^DataEntry) This pointer accesses the array of
  1406.                            data entry records in the heap.
  1407.  
  1408.              DataStr       (Type: DataStrType)  This is the actual string edited on
  1409.                            the screen during an entry into a field.  The length of the
  1410.                            string is limited by DataStrSize.
  1411.  
  1412.              DataStrL      (Type: byte)  This is the current string length of DataStr
  1413.                            by accessing DataStr[0].
  1414.  
  1415.              DataPad       (Type: DataPadRec)  This is the data pad used to transfer
  1416.                            data between the destination variable and the screen.
  1417.  
  1418.              AutoTab       (Type: boolean)  When set true for EnterSeq, the HiLite
  1419.                            will advance to the next field automatically after entry.
  1420.  
  1421.              AutoNumLock   (Type: boolean)  For numerical entries, this flag will
  1422.                            automatically turn on NumLock and is shown on the message
  1423.                            line with the key status indicator.
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.            Chapter 3, Data Structure                                           Page 24
  1443.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1444.  
  1445.  
  1446.            A P P E N D I X  A :   M E M O R Y   A L L O C A T I O N
  1447.  
  1448.            This section covers the memory requirements for global data in the data
  1449.            segment and dynamic data in the heap.  This will give you the figures on
  1450.            how to estimate the memory needed for your program.
  1451.  
  1452.  
  1453.            CHOOSING GLOBAL VS. DYNAMIC
  1454.  
  1455.            As is, PULL uses both global and dynamic memory for records and messages.
  1456.            The menus and data window/entry records are dynamic while the help window
  1457.            and messages use global memory.  Depending on the needs of your application
  1458.            program, you can change where these records are located by removing or
  1459.            adding the ^ symbol, if you have the source code, along with the usual
  1460.            HeapOK/GetMem instructions.
  1461.  
  1462.            PULLDEMO - In the demonstration, it was chosen to use the messages and help
  1463.            windows as global memory since the program was so small.  In larger
  1464.            programs that need more global data, these records can be shifted to
  1465.            dynamic memory or even to disk.
  1466.  
  1467.  
  1468.            GLOBAL MEMORY
  1469.  
  1470.            Global Memory - The following values reflect both the approximate minimum
  1471.            data requirements when global memory is a premium, and the allocation used
  1472.            in PULL.TPU using the current configuration constants:
  1473.  
  1474.                                              Min    Demo
  1475.              Features                        Bytes  Bytes  Comments
  1476.              ------------------------------- -----  -----  -------------------
  1477.              Basic pull-down menus             652    652
  1478.              Submenus                           12     12
  1479.              Data window/entry, filter sets    579    675
  1480.              Help windows                       34   4611  Used global in demo
  1481.              Messages                           16   1326  Used global in demo
  1482.                                              -----  -----
  1483.              Total allocation                 1293   7276
  1484.  
  1485.            Of course your application will vary, but these figures give you a good
  1486.            estimate of the amount of memory being used.  The demo figures for the help
  1487.            windows and message are higher because the text strings were placed in
  1488.            global memory.
  1489.  
  1490.  
  1491.            DYNAMIC MEMORY
  1492.  
  1493.            Dynamic Variables - To alleviate using global data, dynamic variables are
  1494.            used for permanent and temporary use.  The allocation for menus and data
  1495.            window/entry records are permanent throughout the program.  Many other
  1496.            procedures such as pulling down menus temporarily use the heap to perform
  1497.            operations.
  1498.  
  1499.            Permanent Variables - If the directives have been defined, the following
  1500.            allocation can be calculated:
  1501.  
  1502.  
  1503.            Appendix A: Memory Allocation                                       Page 25
  1504.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1505.  
  1506.  
  1507.  
  1508.              Records       Calculation                                     Demo Bytes
  1509.              ------------  ----------------------------------------------  ----------
  1510.              Menus         SizeOf(TopMenu)*(NumOfMainMenus+NumOfSubMenus)   7664
  1511.              Data windows  SizeOf(TopDataWndw)*(NumOfDataWndws)              658
  1512.              Data entries  SizeOf(TopEntry)*(NumOfDataEntries)               240
  1513.  
  1514.            Again, this is just a general idea of what your program would allocate.
  1515.            This is totally dependent on the configuration constants you choose.
  1516.  
  1517.            Temporary Variables - When pulling down menus, the underlays are accessed
  1518.            in a serial fashion, so your calculations can be exact.  There is no need
  1519.            to double the size of the heap needed as you would for random access.  For
  1520.            a further discussion on dynamic memory allocation for windows, please refer
  1521.            to the appendix in WNDWREF.DOC.
  1522.  
  1523.  
  1524.            CODE SIZE
  1525.  
  1526.            Code Size - PULL is also very frugal with with code.  Here is the
  1527.            breakdown for code usage (this may vary slightly):
  1528.  
  1529.              Code Description                Bytes
  1530.              ------------------------------- -----
  1531.              Basic pull-down menus            4320
  1532.              Additional for submenus          1056
  1533.              Additional for data wndw/entry   3952
  1534.              Additional for help windows       704
  1535.              Additional for messages           880
  1536.                                              -----
  1537.              Total code                      10912
  1538.  
  1539.            Of course the TP5 smart compiler will optimize the code leaving out unused
  1540.            procedures.  But this gives you a good idea of how small the code really
  1541.            is!
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.            Appendix A: Memory Allocation                                       Page 26
  1565.            PULL Multi-level Pull-Down Menus              Reference Guide, Version 5.5
  1566.  
  1567.  
  1568.            A P P E N D I X  B :   E R R O R   M E S S A G E S
  1569.  
  1570.            PULL uses the same GOOF unit as WNDW does.  Should you make a mistake in
  1571.            programming with windows or PULL,  the program will terminate with an error
  1572.            message window on the CRT to reveal any problem.  The program terminates
  1573.            through the GOOF unit which can be freely edited.
  1574.  
  1575.  
  1576.            WNDW
  1577.  
  1578.            The following error messages occur when a mistake has been made in creating
  1579.            or controlling windows:
  1580.  
  1581.            "Not enough heap space" - The minimum heap size is too small.  Increase the
  1582.            size as required in APPENDIX A of WNDW55.DOC.
  1583.  
  1584.            "Too many windows" - Tried to create more windows than MaxWndw allows.
  1585.            Either remove windows or increase MaxWndw.
  1586.  
  1587.            "Too many virtual windows" - Tried to create more virtual windows than
  1588.            MaxVirtualWndw allows.  Either remove windows or increase MaxVirtualWndw.
  1589.  
  1590.            "Perm window out of order" - Tried to create a PermMode window while a
  1591.            normal window is the top window.  Remove or hide window before making a
  1592.            permanent window.  Routinely, all PermMode windows are created first.
  1593.  
  1594.            "No window to remove" - Tried to remove the initial window Window0 which is
  1595.            permanent.
  1596.  
  1597.            "Hidden window not found" - Tried to write to a hidden window that does not
  1598.            exist.  Check for the correct name.
  1599.  
  1600.            "Virtual screen not found" - Tried to write to a virtual screen that does
  1601.            not exist.  Check for the correct name.
  1602.  
  1603.            "Video page not available" - Tried to write to a video page that has not
  1604.            been allocated or does not exist for the hardware as expected.  Be sure to
  1605.            use MaxValidPage.
  1606.  
  1607.  
  1608.            PULL
  1609.  
  1610.            Only the following error message will occur in PULL:
  1611.  
  1612.            "A Submenu could not fit" - Tried to fit a menu that was too wide to fit in
  1613.            the slide-up configuration.  Set LocationWarning false and test all
  1614.            submenus to see if the slide-under alternative is acceptable.  If not,
  1615.            override the default location by manually assigning the Row and Col values
  1616.            of the menu record in GetUserPullStats.
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.            Appendix B: Error Messages                                          Page 27
  1626.