home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PULL55.ZIP / PULLREF.DOC < prev    next >
Encoding:
Text File  |  1989-08-24  |  80.3 KB  |  1,626 lines

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