home *** CD-ROM | disk | FTP | other *** search
- January 12, 1988
-
- MULTI-LEVEL PULL-DOWN MENUS
- Version 2.0
- (c) 1987,1988 James H. LeMay
-
- PURPOSE:
-
- This utility creates incredibly quick multi-level pull-down
- menus as units for Turbo Pascal 4.0 programs for ALL IBM
- compatibles, including PS/2 and 3270 PC on any video page or any
- text mode. It features:
-
- - Work window(s) and complete interface for menus
- - Pull-down menus with 5 menu modes and 7 line modes
- | - Pull-down file directory
- - Highlighted command letters
- - Unlimited levels of submenus
- | - Unlimited data entry windows for 9 types of data
- - Data entry for the work window(s)
- - Automatic NumLock for numerical data entry
- - Right or left justification for data entry
- - Error messages for invalid data entries
- - Error messages for data entries out of range
- - Allowance for null entries on text data entry
- - Automatic and override configuration for sizes and
- locations for easier development
- - Operation by cursor keys or command keys
- - Pull/Pop between work window and nested submenu(s)
- - Programmable control of pull and pop sequences
- - Full system of self-titled help windows
- - Message lines for prompts and processing
- - Full working shell for user development
- - Can be fully configured by the user including
- add-on features though units.
-
- They work on MDA, CGA, EGA, MCGA, VGA, 8514/A adapters in any
- column mode (40/80/etc.). These procedures use the quick screen
- writing procedures of QWIK40A.TPU and the multi-level window
- procedures of WNDW40.TPU.
-
-
- TEST DRIVE:
-
- Compile and run the program PULLDEMO.PAS to get a feeling for
- features and speed. Be sure to use the Help function key "F1"
- everywhere for context-sensitive explanations.
-
- Be sure to copy QWIK40A.TPU, WNDW40.TPU, and PULL20.TPU to
- QWIK.TPU, WNDW.TPU, and PULL.TPU, respectively, before
- compiling.
-
- WNDW40.ARC and QWIK40.ARC are not included and have more
- documentation. The demo is very similar to the TP4 environment.
- The operation should be intuitive. If not, then I didn't do a
- very good job.
-
-
- FILES:
-
- In this version, PULL20.ARC contains:
-
- !read .me!: File that insists you get a copy of
- WNDW40.ARC and QWIK40.ARC for further
- documentation.
- Qwik40a .tpu: Unit from QWIK40.ARC - comprehensive quick
- screen writing utilities.
- WndwVars.tpu: Unit from WNDW40.ARC - WNDW variables.
- Wndw40 .tpu: Unit from WNDW40.ARC - multi-level windows.
- Pull20 .doc: This document.
- PullVars.tpu: Just interface for PULLVARS.TPU.
- PullVars.tpu: Variables used in PULL20.TPU.
- Pull20- .pas: Just interface for PULL20.PAS.
- Pull20 .tpu: Unit for your programs to use the pull-down
- menus including data entry procedures.
- PullDir-.pas: Just interface for PULLDIR.PAS.
- PullDir .tpu: Unit for a pull-down file directory.
- PullStat.pas: Data to configure the menus.
- PullProc.pas: Procedures and Data Entry variables to be
- executed in the menus including global keys.
- PullWork.pas: Procedures for the main work window(s).
- PullDemo.pas: Fully functional working demo.
- License .arc: ARC file containing license agreements.
-
-
- IMPROVEMENTS:
-
- In this version there are several improvements over PULL15:
- | . Converted to TP4 and incorporated QWIK40 and WNDW40.
- | . Added pull-down directory with path and mask.
- | . Added global keys like Alt-F and Alt-X in PULLSTAT.PAS.
- | . Help windows disappear at any any keystroke and applies
- | that key to the program.
- | . Eliminated PULLUSER.INC and instead allow access to user
- | windows direct through PullProc.Process.
- | . Menu partitions now use Wndw.BrdrRec.
- | . Added TypeOfDataTypes Word and LongInt.
- | . Added "ClearScreen" option in InitPull.
-
-
- SHAREWARE:
-
- Due to the lack of participation and expense, I have decided to
- abandon the Teamware concept and instead make them into ShareWare.
- The cost may range from $9 to $53 depending on your application.
- I do enjoy assisting others in their programming, but lack of
- reimbursement is expensive for me! Please help out. See the
- STATMENT.LIC in LICENSE.ARC for details. If the response will let
- me break even, I will continue support.
-
-
- DEFINITIONS:
-
- So you can understand the program identifiers and this document,
- here's the definitions I'll use:
-
- Work window - The working window of the application program.
- Top menu - The menu always shown (usually in row 1 or 2).
- Main menu - The first menu pulled from the top menu.
- Submenu - All subsequent menus pulled after the main menu.
- Line - A row of text.
- Menu - A list of selectable lines.
- Window - Not a menu.
- Data entry window - window for entering data into the
- application program.
- Selection - A line selected in a menu with a CR.
- "HiLited" - A line pointed at in a menu.
- Message line - The bottom row to display key helps or
- processing status.
- Error message - a short message for data out of range.
- Link - A menu line showing a symbol (three-bar or dot) that
- pulls another menu or window. The symbol is also on
- the same side where it is pulled.
- PullDown - pulls menus down to the previous level.
- Pop - removes menus and returns to the work window.
-
-
- BASIC OPERATION:
-
- I'll just put a few words here just in case you may have missed
- some of the capabilities in the demo.
-
- . Status Line - Row 1 just holds the title of this program. It
- can be used to for optional status info.
-
- . Top Menu Line - To access the top menu line, press F10 at any
- time. The exceptions are when the Help window or Error
- messages are displayed. The "/" key does the same thing
- except it is considered data in text data entry windows.
-
- . Main Menu - To access a main menu, press RETURN while the top
- menu is highlighted.
-
- . Submenu - To access a submenu, press RETURN when the HiLite
- is at a menu line with the three-bar symbol (which looks like
- a menu).
-
- . Data Entry Window - To access a data entry (pronounced "dot-
- uh" entry?) window, press RETURN when the HiLite is at a menu
- line with a small dot symbol. Pressing RETURN again will
- exit the window. You can clear any data entered by pressing
- ESC which also removes the window.
-
- . Numerical Data Entry - Depending on the type of data, (byte,
- integer, etc.) only the valid characters can be typed in.
- Backspace can be used as well. The "NumLock" is automatic
- and is interactive. After return is pressed, the data is
- checked for validity (bytes less than 256, etc.) and then for
- a range check. If it passes both checks, the data is then
- stored and the window is removed. The "NumLock" status is
- then restored. In "Exec-" type menus like "Files", the
- window may remain until processing is complete. You can
- program this either way though.
-
- . Text Data Entry - ASCII 32 through 126 are valid characters
- for string and character data. Only backspace can be used
- for editing. The entry can be nulled by pressing DEL and
- then RETURN.
-
- . Work Window - This is the 20x78 window for the major part of
- your output and optional input. You can also have multi-
- level work windows.
-
- . Work Window Data Entry - The same procedures used for the
- data entry windows can be used for entering data in the work
- windows. One important exception - after a CR to enter the
- data, the data always overwrites the previous value. In case
- of a range error, you can restore the original value with
- RestoreData.
-
- . Help Windows - A help window is assigned to every window and
- menu. It automatically shows it's title of that menu. They
- can use the same info or different.
-
- . Message Line - The bottom line contains help or error
- messages.
-
- . Function Keys - These are the keys assigned in the demo and
- what they control:
- F1 - PullDown/Pop the Help windows
- F2 - PullDown/Pop the pull-down menus
- F10 - Pops to top menu for key commands
- "/" - Same as F10, but not in text data entry windows.
- ESC - Same as F2 in the Work window, but in the menus it
- backs out of the current menu/window.
- LTR - While in the menus, the HiLite will move to and
- execute the menu line with that upper case letter.
- | Cursor Keys - all of the cursor keys have assigned
- | functions, even the control keys. Check their
- | operation in PULLDEMO.EXE, or registered users can
- | just examine the source code.
- | Alt Keys - just like the TP4 environment, the Alt keys
- | can control the menus. These must be manually
- | assigned. See the last part of PULLSTAT.PAS for
- | the keys assigned for the demo. Holding down the
- | Alt key for 1/2 second will display the Alt key
- | help message.
-
-
- SCREEN DESIGN:
-
- PULL20.TPU is quite flexible and allows you to change the basic
- | screen design in your application program. EGA/MCGA/VGA users
- will particularly like it because it will also work in any row
- mode and column mode.
-
- Status line - The demo shows how to place a title or status line
- in row 1. Some applications may require a status line outside
- of the work window for file names or whatever. But it is not
- required.
-
- Work Window - The demo also shows a 20x78 work window but you
- can modify it to a full 80 columns by setting the MakeWindow to
- NoBrdr and create a 20x80 window. The top and bottom lines
- could be added with a couple of Qfill statements. You can also
- have multi-level work windows if you want.
-
- Main Menu Placement - This design seems to be the defacto
- standard that was started by the Macintosh and is currently
- being used by Microsoft. The top menu row is inverse video
- while the highlight is normal. The main menu is directly below
- and offset a few spaces.
-
- Submenu Placement - Press RETURN at a menu line with a linked
- submenu and notice that the top of a submenu is on the
- same row. This menu line also serves as a title. Let's say you
- nest 5 levels of submenus. Will you still be able to see all of
- the titles? Sure! They won't over lap. However, it's a good
- idea for operation if you keep the linking lines to submenus
- high up on the menu which keeps the subsequent submenus high as
- well. The first pull using F2 in the demo shows how three
- levels of menus are kept high. Keying Alt-I and "U" will show
- you how a submenu drops lower. The Submenus that "bottom out"
- on the display will be automatically pushed up when they are
- located. Also look for defaults that reduce keystrokes to get
- around in the menus.
-
- Symbols - the three-line symbol (looks like a menu) tags the
- | line that links a submenu or a user window (ToUserWndw). A
- small dot tags the line that links a data window. In addition,
- the symbol location also shows the direction of display - left
- or right. Right is preferred unless there is no room when it is
- then placed to the left.
-
- Help Window - The help window is centered between the left and
- right margin. The bottom row of the window has a constant
- number of rows below it and the bottom of screen. This can be
- assigned with RowsBelowHelp. It was also given a zoom and
- shadow effect so that it would look and feel separated from the
- working program which you can change with HelpWndwModes.
-
- Message Line - The message line is placed relative to the bottom
- of the screen. It can be raised up a number of rows by setting
- RowsBelowMsg greater than zero.
-
- Limits - There are really very few requirements. Two of which
- are:
-
- . All menus and data entry windows cannot use NoBrdr.
- . Data entry windows are fixed with 2 lines.
-
- Keyboard Operation - The operation is designed to be as
- intuitive as possible. The message lines should guide you
- through the options. The idea was to make application programs
- as user friendly as possible.
-
-
- | PULL-DOWN DIRECTORY:
-
- | A new pull-down directory unit has been added. A particular
- | emphasis was made on end-user human factors in its development.
-
- | . Single column - A single column, alphabetically sorted list
- | is the easiest to scan quickly. I takes longer to locate a
- | file in multi-column lists such as the one provided in the
- | TP4 environment.
- | . Cursor key scanning - Cursor keys are the expected way to
- | scan through the directory. However, Home, ^Home, End, and
- | ^End keys only move the HiLite while PgUp, ^PgUp, PgDn, and
- | ^PgDn move only the page.
- | . Letter key scanning - Any alpha-numeric key will scan for
- | the first file name starting with the same first letter.
- | The page is moved and the cursor is centered as much as
- | possible.
- | . Lower-case text - Lower case text is more legible than the
- | standard upper-case text provided by DOS.
- | . Right justified extension - Visual searches for extensions
- | are easier to read when aligned. In addition, this also
- | facilitates proper alphabetic sorting.
- | . High speed sort - The sorting routine used is a secondary
- | indexed quick sort which is the fastest kind for this
- | application. Up to 250 file names are permitted.
- | . High speed scroll - The display is expected to be fast when
- | scrolling and is. Neither the HiLite nor the screen ever
- | flicker.
- | . Default HiLite - If a value file name is passed to the
- | directory for the default other than '', the directory
- | searches for a close match to HiLite. In either case, the
- | HiLite is centered as much as possible.
- | . Picked file name - Pressing CR will replace the referenced
- | file name passed to the directory.
-
-
- PROGRAMMING:
-
- Configuration - Virtually everything can be reconfigured by the
- user without having to modify PULL20.TPU. It may require a
- little study, but the demo has most of the examples.
-
- Demo - PULLDEMO.PAS, PULLSTAT.PAS, PULLPROC.PAS, and
- PULLWORK.PAS are examples of a shell you can use for your own
- programs. I used all the capabilities in the demo. Even though
- the source code is lengthy, there are only a few procedures.
- Here is a summary of the 10 steps to get you through all of the
- procedures:
-
- | STEP 1: Using Units
- STEP 2: GetUserPullStats (in PULLSTAT.PAS)
- STEP 3: GetOverrideStats (in PULLSTAT.PAS)
- | STEP 4: CheckGlobalKeys (in PULLSTAT.PAS)
- STEP 5: DataTransfer (in PULLPROC.PAS)
- STEP 6: Application procedures (in PULLPROC.PAS)
- STEP 7: Process (in PULLPROC.PAS)
- STEP 8: WorkWndw (in PULLWORK.PAS)
- STEP 9: DisplayScreen (in PULLDEMO.PAS)
- STEP 10: Main program (in PULLDEMO.PAS)
-
-
- | STEP 1: Using Units
- |
- | Uses Matrix - Here's a USES matrix so you can tell where the
- | files are used:
-
- | USES UNIT NUMBER:
- | Unit 1 2 3 4 5 6 7 8 9 10 11 12
- | ----------------- -- -- -- -- -- -- -- -- -- -- -- --
- | 1 - DOS -
- | 2 - CRT -
- | 3 - Qwik .tpu -
- | 4 - WndwVars.tpu x x -
- | 5 - Wndw .tpu x x -
- | 6 - PullVars.tpu x -
- | 7 - Pull .tpu x x x x x - F F F
- | 8 - PullDir .tpu x x x x x x - F
- | 9 - PullStat.pas x x x x x x -
- | 10 - PullProc.pas x x x x x -
- | 11 - PullWork.pas x x x x x x x -
- | 12 - PullDemo.pas x x x x x x x x -
-
- | "F" - indicates that a forward indirect call is used to access
- | some procedures in the forward unit. Be sure those units are
- | included in a uses statement as shown in the demo files. They
- | will compile without them but will lock up your computer if you
- | try to execute it. This call was suggested by Kim Kokkonen.
-
- | Editing Units - The *.PAS files listed above can be freely
- | edited and compiled without needing the source code for the
- | TPUs.
-
- | Constants - The constants in WNDWVARS.PAS and PULLVARS.PAS
- | allows the user to trim down data memory to only what is needed.
- | (Only registered users will have the source code to do this
- | otherwise the limit is preset.) While developing an
- application, it's best to balloon these values a bit to keep
- from having to frequently change them. For MaxWndw, be sure to
- use the maximum possibility of the deepest nested pull-down
- menu, plus all work windows, plus the help window.
-
-
- STEP 2: GetUserPullStats
-
- Automatic configuration - This is the most significant part.
- PULL20.TPU runs this procedure only once to get the basic data
- for the pull-down menus. Much of the drudgery of locating,
- sizing, directing, coloring, command letters is done
- automatically. If submenus are not given enough room to fit, an
- error message will indicate it. If a data entry window won't
- fit, it will reassign it to be centered on the screen which you
- can override by assigning values to RowAlt and ColAlt in the
- "GetOverrideStats" procedure.
-
- Menu Modes - Every menu can have just one of five modes:
-
- ExecChoice - immediately executes a procedure (the
- default)
- ExecSingleChoice - executes a procedure first and then
- flags one line exclusively on the menu
- ExecMultipleChoice - executes a procedure first and then
- toggles the line's boolean flag
- SingleChoice - flags one line exclusively on the menu
- MultipleChoice - toggles the line's boolean flag
-
- MenuMode tells how the selection will interact with the other
- and ONLY "Choice" selections on the menu (see below).
-
- Line Modes - In addition, each line in the menu can have one of
- seven line modes:
-
- Choice - will interact with the assigned menu mode
- (the default)
- ExecOnly - will only execute a procedure in Process
- Comment - a line that can't be HiLited
- Partition - draws a horizontal line across window
- ToDataWndw - links a data entry window when selected
- ToSubMenu - links a submenu when selected
- | ToUserWndw - like ExecOnly and adds a Submenu symbol
-
- In "Choice" mode, the line is a valid selection.
-
- . For ExecSingleChoice..MultipleChoice menus, the boolean data
- for the choice is stored in the menu record for each line.
- And for this reason, all menus are unique; they cannot be
- linked again to another submenu unless you store a copy of
- the values before reusing it.
- . For "Exec-" type menus, a selected line executes it's
- procedure through an interface procedure called "Process".
- This will let you do just about anything, including any
- changes to the menus; e.g., take you step-by-step through
- data entry windows using PopLevels and PullDown.
- . If a data entry window is linked to an "Exec-" type menu, it
- | will execute AFTER the data is entered. An example of this
- | is the "Mask for Directory" line in "Files". Once you
- select the line, it prompts you for the file name and then
- executes.
-
- In "ExecOnly" mode, the line overrides the menu mode and runs
- through the Process procedure just like a Choice in an "Exec-"
- type menu, but will not set any flags.
-
- In "Comment" mode, the HiLite will simply skip over the line.
- This allows the user to place descriptions or whatever in the
- menu without being a possible selection. There are two lines in
- the "Files" menu that are comments.
-
- "Partition" is a horizontal line to separate menu lines into
- | groups. The line drawing characters used for the partition are
- | set by the Brdr constant in WNDWVARS.PAS. "Files" in the demo
- has a partition in the second line from the bottom.
-
- No matter what the menu mode is, if the line mode is a link
- (ToSubmenu, etc.), it will just pull the linking menu or window.
- However, a ToDataWndw line on an "Exec-" type menu will execute
- a procedure in Process after entry.
-
- Attributes - The definitions of the attribute identifiers are
- suffixes of:
-
- -Attr - normal attribute
- -Hattr - attribute for HiLite
- -Wattr - attribute for Window area
- -Battr - attribute for Border of window
- -Lattr - attribute for the command Letter
- -Cattr - attribute for a Comment line
-
- The attributes are handled by groups in PULL20.TPU. For
- example, the value for SubMenuWattr sets all SubMenus with the
- same value. For exceptions, use PullStat.GetOverrideStats.
-
- Monochrome - Keep in mind that different displays and monitors
- don't always appear comparable. Monochrome modes and displays
- | require some special considerations. See "Hatch Borders" in
- | WNDW40.ARC.
-
- Status Line - Keep in mind that there may develop several look-
- alike programs, so it would be helpful to have a title for your
- program on row 1 or 2 (unless of course you place it in the work
- window). You can easily delete the line by setting
- "TopMenuRow:=1" and "MainMenuRow:=2".
-
- Command Sequences - PULL20.TPU keeps track of the key strokes
- used to access a pull-down menu in the string "CmdSeq". F10 is
- not included since it is understood. When using "PullDown" and
- "Pop" (see below), the user can programmably change the sequence
- with string "MoreCmdSeq". The word "More" means that there are
- additional keys yet to be executed. (Be sure to leave "CmdSeq"
- untouched.)
-
- MainMenu Record - Here's a list of what's contained in each
- record:
-
- Title - a string required to appear in the Top Menu.
- CmdLtrs - a string which is done automatically by
- PULL20.TPU and contains the first letters of
- each menu line. If you want some other letter,
- you can edit it in PullStat.GetOverrideStats.
- Line - string to appear on a menu line.
- LineMode - one of the 6 line modes for each line.
- Flagged - boolean for each line used for MultipleChoice
- and SingleChoice menus.
- LinkNum - the index number of the linking SubMenu or
- DataWndw.
- LinkDir - linking SubMenu or window to appear Left or
- Right, handled by PULL20.TPU.
- MenuMode - one of the 3 menu modes.
- MenuLines - quantity of lines in this menu.
- NameCol - the column of title in the top menu.
- Row,Col,Rows,Cols - location and size of the menu which is
- done by PULL20.TPU
- DefaultLine - the HiLite line at startup.
- HiLiteLine - line currently HiLited
- SingleFlagLine - the only line flagged. Needed only in
- SingleChoice menus (only for "Choice" lines).
- Battr,Wattr,Hattr,Lattr,Cattr - attributes set for this menu.
- Border - one the 10 borders done by PULL20.TPU.
- BackToDefault - if true, HiLite will return to DefaultLine
- every time the menu is pulled.
- Changed - set to true if SingleFlagLine or Flagged have
- been altered. The user must reset this back to
- false to be useful.
- MsgLineNum - the index number of the MsgLine.
- HelpWndwNum - the index number of the HelpWndw.
-
- SubMenu Record - The SubMenu record is identical to the MainMenu
- record. There are some differences in use though:
-
- Title - same string of the linking menu line supplied by
- PULL20.TPU.
- NameCol - not used.
-
- Practically speaking there is no limit to the number of submenus
- that can be linked (<256).
-
- Data Entry Windows - Data entry windows are different from
- menus because they are merely a scratch pad. They don't save
- any data in the record. The data it picks up is stored by user
- variables in another interface procedure called "DataTransfer".
- Even their locations on the screen are assigned at the time when
- the user presses RETURN on the menu. So, the user can use a
- single window for any number of links. I call them floating
- windows. However, when the window won't fit, the program
- centers it on the screen. The user can keep it from floating by
- assigning non-zero coordinates to RowAlt and ColAlt. Setting
- them back to zero will allow them to float again. Since data
- windows can float, there's no limit for the number of places
- they can be used.
-
- DataWndw Record - Here's the content of the record:
-
- Line[1] - label for the current value of the data.
- Line[2] - label for the new data entry.
- TypeOfData - type of data expected for this window.
- Row,Col,Rows,Cols - location and size of the window which is
- done by PULL20.TPU
- RowAlt,ColAlt - alternate location of window.
- FirstCol - first column of the data field, handled by
- PULL20.TPU.
- Field - number of columns reserved for data entry.
- Decimals - number of decimal places for Reals only. If
- positive, uses R:F:D format. If negative, uses
- R:F.
- Wattr,Hattr,Battr - attributes set for this window.
- Border - set equal to DataWndwBrdr by PULL20.TPU.
- MsgLineNum - the index number of the MsgLine.
- HelpWndwNum - the index number of the HelpWndw.
-
- HelpWndw Record - The HelpWndw displays a number of HelpLines in
- sequence. It starts with FirstLine and displays each successive
- HelpLine until the window is full set by LinesToShow. The
- initialization default assumes LinesToShow is simply the
- difference between the first and last lines. Here's the list:
-
- FirstLine - the index number of HelpLine.
- LastLine - currently unused.
- LinesToShow - number of lines to show.
- Row,Col,Rows,Cols - location and size of the window which is
- done by PULL20.TPU
- Wattr,Battr - attributes set for this window.
- Border - set equal to HelpWndwBrdr by PULL20.TPU.
- | HelpWndwModes - allow zoom and shadow effects. See
- WNDW40.DOC.
- MsgLineNum - the index number of the MsgLine.
-
- | Wattr, Battr, Border, HelpWndwModes, and MsgLineNum for all
- HelpWndw's are handled as a group by PULL20.TPU with
- | HelpWndwWattr, HelpWndwBattr, HelpWndwBrdr, HelpWndwModes, and
- HelpMsgLineNum respectively. Help windows are optional. To
- delete them, assign #00 to HelpKey so they can't be accessed.
-
- HelpLine - This is the text for the help windows. It was set up
- as an array rather than a record to help save memory space. The
- length need not be the width of the window.
-
- MsgLine - These lines are intended to show a message to the
- user the number of commands or keys available at any step. The
- length should fill one entire row.
-
- ErrMsgLine - These lines are shorter than MsgLines and
- temporarily overlays a MsgLine. They need not fill one
- entire row. They are intended of course to indicate errors.
-
-
- STEP 3: GetOverrideStats
-
- Purpose - If the user wants to change any data that PULL20.TPU
- has handled as a group with GetUserPullStats, this is the
- procedure to do it. See PULLSTAT.PAS for some examples.
-
-
- STEP 4: DataTransfer
-
- Purpose - If the data entry is used, PullStat.DataTransfer will
- be needed to transfer data from the floating windows to the
- appropriate variables. This is done with the DataPad.
-
- DataPad Record - Before I give an explanation, here's the
- description of the record:
-
- StoreMode - if true, data will be stored from the data pad to
- the user variable. Otherwise, it reads the
- variable and places it on the pad.
- Valid - if true, numerical data is within typed limits.
- DataStored - if true, data was stored successfully without a
- range error.
- NewData - if true, data will be overwritten on the pad.
- TypeOfData - type of data on the pad. TAG FIELD for VARIANT
- record.
- Bdata - Bytes identifier in field list.
- | Wdata - Words identifier in field list.
- Idata - Integers identifier in field list.
- | Ldata - LongInts identifier in field list.
- Rdata - Reals identifier in field list.
- UNdata - UserNums identifier in field list.
- Cdata - Chars identifier in field list.
- Sdata - Strings identifier in field list.
- USdata - UserStrings identifier in field list.
-
- If you are not familiar with variant records, better read the
- manual again. Simply speaking, all variables in the field list
- all occupy the same address. The only way you know what type of
- data you have is by what is assigned to TypeOfData
- (Bytes..UserStrings). You can check the value on the pad at
- anytime; just be sure to use the correct identifier.
-
- UserNums/UserStrings - These two types are actually strings.
- UserStrings appears with quotes and UserNums without. These
- types allow you to customize the characters allowed at data
- entry with the use of UserCharSet.
-
- Menu coordinates - Matching variables with windows is easily
- done by identifying the menu line that pulled the data window.
- The variables used are:
-
- MPulled - index number of MainMenu pulled.
- SPulled - index number of SubMenu pulled. If equal to zero,
- then only a MainMenu was pulled.
- HiLited - menu line that links the data window.
-
- With these, the DataTransfer procedure is just one big case
- statement that narrows down the correct user variable.
-
- Range check - Please note that data is not stored in data
- windows unless it passes BOTH the validity check and an optional
- range check. This is different from Pull.WorkWndwEntry. The
- demo shows you how to use a field identifier on the DataPad to
- check for range on the variable PriceLimit. Make SURE that the
- type of data MATCHES! Turbo will not check it.
-
-
- STEP 5: Application Procedures
-
- This is a good place to put all your application procedures,
- both for procedures used by the menus (PullProc.Process). The
- demo uses only one called DummyProcess which is just a one
- second delay.
-
-
- STEP 6: Process
-
- Purpose - "Process" is the procedure accessed by:
-
- | 1. "Exec-" menus with a "Choice" line.
- | 2. "ExecOnly" lines.
- | 3. "ToUserWndw" lines. (like the pull-down directory)
-
- This is where you can make the menus do just about anything.
-
- Menu Coordinates - "Process" uses the same coordinate variables
- as DataTransfer and uses a case statement the same way to locate
- the correct procedure with MPulled, SPulled and HiLited.
-
- PullDown/Pop - Programmably you can PullDown or Pop menus in your
- procedures at any time. Try Alt-I and "U" in the demo to see
- just a few of the possibilities of programmable control. There
- are 5 flag variables and one function that hook into PULL20.TPU
- to do this:
-
- PopToWorkWndw - if set true, control is returned to the work
- window.
- PopToTop - if set true, menus are popped only to the top
- menu.
- PopLevels - the number of levels to pop.
- Popped - a function that will pop all menus before
- processing.
- MoreCmdSeq - a string of pending command letters after
- popping.
- | PullDown - if set true, menus will be pulled down after
- pop as specified by MoreCmdSeq.
-
- You can combine these in several ways. You can even make data
- windows enter data sequentially for records or to make it easier
- for end users automatically step through data entry. An example
- of this is in the demo under "IRSaccounting" and "Date". You'll
- notice how easy it is to roll through the data windows with
- RETURNs.
-
-
- STEP 7: WorkWndw
-
- Work Window - When the menus are not pulled, this is where there
- is most of the programming activity. You can even have multi-
- level work windows. Note also that you can work with two or
- more windows on the screen at the same time and can use
- | Wndw.AccessWindow to randomly access any window.
-
- WorkWndwStep - Since each keystroke goes through the key
- dispatcher, the number of WorkWndwStep tells the program where
- to return upon re-entering WorkWndw. You can change its value,
- even while in the menus.
-
- WorkWndwEntry - You can now use the same data entry procedures
- as the data entry windows for the work window with
- | WorkWndwEntry. Set DataPad.NewData:=true to clear data on the
- | pad. If WorkWndwStep is changed, the data is automatically
- | cleared. There is one difference though; the data is stored
- right after it passes the validity test. If it doesn't meet the
- range test, then the data must be restored with RestoreData.
-
-
- STEP 8: DisplayScreen
-
- This procedure finally sets up your screen design.
-
-
- STEP 9: Main Program
-
- Initial Values - Here is where you place the initial values for
- user variables.
-
- GotoKeyDispatcher - Since each keystroke needs to be analyzed,
- the dispatcher decides whether it goes to the Menus or WorkWndw.
- Here's a flow chart for the dispatcher:
-
- +------------+
- | START |
- +------------+
- |
- /\
- / \
- +-------------+ No / \ Yes +-------------+
- | Work |<--------< PullDown? >-------->| Pull-down |
- | Window | \ / | Menus |
- +-------------+ \ / +-------------+
- | \/ |
- | /|\ |
- | | |
- | | No |
- | /\ |
- | / \ |
- | / \ |
- ---------------->< Quit ? ><------------------
- \ /
- \ /
- \/
- | Yes
- \|/
- +------------+
- | END |
- +------------+
-
-
- SUGGESTIONS:
-
- Full Demonstration - If you would like to see a fully working
- utility created from these procedures, you can get a file called
- WSX21A.ARC. It is a WordStar Translator program for WordStar
- 3.31/4.0, but you don't have to have WordStar to examine it. It
- has pull-down directories, WYSIWYG color modifications, and other
- ideas. The ARC file does not contain the source code, but it is
- available upon request. WSX21A.ARC can be found on the
- CompuServe MicroPro (GO MICROPRO) in the WordStar 4.0 Data
- Library (DL3). (WSX21A.ARC was created with TP3 not TP4.)
-
- On-line source - All updated files can be found on the CompuServe
- | Borland Forum (GO BPROGA) in the MSDOS Turbo Pascal Data Library
- | or on the IBM Software Forum (GO IBMSW).
-
- Fast Keyboard Repeat - The best utility I've found to double the
- typematic rate is a utility called HOTKEY.ARC, version 1.1.
- It's better than PC Magazine's QUICKEYS, because it doesn't "run
- away" in the buffer. Available on CompuServe's IBM Hardware
- Forum.
-
-
- LIABILITY:
-
- No liabilities are assumed in the use or misuse of these
- procedures.
-
-
- AUTHOR:
-
- These procedures are now Shareware. If there are any problems,
- please let me know.
-
- Copyright (c) 1987,1988 by James H. LeMay
- All rights reserved
- Jim LeMay, 6341 Klamath Rd., Ft. Worth, TX 76116
- CIS 76011,217, 1-(817) 732-7150 (after 1730 PST)
-
-
- CREDITS:
-
- Art Hill started some initial ideas on this with PullDown.arc
-
- Art Hill, 936 S. Kensington Ave., La Grange, IL 60525
- CIS 72307,3570
-
-
- REVISIONS:
-
- Version 1.1 (02-27-87): Initial release
- Version 1.2 (04-08-87): limited release
- Version 1.3 (04-20-87)
- Version 1.4 (06-30-87): limited release
- Version 1.5 (08-31-87):
-
- Version 2.0 (01-12-88):
- . Converted to TP4 and incorporated QWIK40 and WNDW40.
- . Added pull-down directory with path and mask.
- . Added global keys like Alt-F and Alt-X in PULLSTAT.PAS.
- . Eliminated PULLUSER.INC and instead allow access to user
- windows direct through PullProc.Process.
- . Menu partitions now use Wndw.BrdrRec.
- . Added TypeOfDataTypes Word and LongInt.
- . Added "ClearScreen" option in InitPull.
- . Deleted i and j variables in PULL20.PAS.
- . Modified Pull.TempMsg; Deleted TempMsgArray.
- . Top menu record is available from TopMenuRecPtr^.
-