home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ENHMEN.ZIP / ENHMENUS.DOC < prev    next >
Encoding:
Text File  |  1991-03-29  |  32.6 KB  |  698 lines

  1.  
  2.                                 EnhMenus ver 1.0
  3.                      An Enhanced Menu System for TurboVision
  4.                  Copyright 1991 Software Applications of Wichita
  5.  
  6.      OVERVIEW
  7.      --------
  8.      EnhMenus is a menu system designed to replace the MENUS.TPU included
  9.      with TurboVision.  EnhMenus provides the same functionality as the
  10.      standard Menus unit and is fully compatible with it.  However,
  11.      EnhMenus extends past Menus in many important respects by being
  12.      completely object-oriented.  All data structures (MenuItem, MenuBar,
  13.      MenuBox, etc) have been changed to objects instead of records.
  14.      Because of this, EnhMenus can be changed in any way you like without
  15.      extensive recoding, unlike the standard Menus unit.  Furthermore,
  16.      EnhMenus provides exactly the same procedures and functions that Menus
  17.      does, thus you're existing code should not require any modification.
  18.  
  19.      In addition to extending it, EnhMenus also corrects some bugs in the
  20.      Menus unit.  For example, select the the File menu in the IDE, press
  21.      F1 for help, and then close the Help window using the close icon and
  22.      the mouse.  The menu disappears!
  23.  
  24.      SHAREWARE
  25.      ---------
  26.      Please note that EnhMenus is not free software.  It is distributed
  27.      under the ShareWare concept of marketing.  This allows to see and use
  28.      the software before buying.  If you decide to use EnhMenus for your
  29.      own purposes, you must register it.  Registration involves sending in
  30.      the accompanying order form (in the file Order.Frm) along with the
  31.      payment of $15.00.  Upon registration you will receive the non-
  32.      shareware version of EnhMenus and its source code.  Registration
  33.      entitles you to link EnhMenus to any end product you like so long as
  34.      the source code, nor the TPU file is redistributed.
  35.  
  36.      FILES INCLUDED
  37.      --------------
  38.      This ZIP includes the following files:
  39.           EnhMenus.Tpu   - This unit contains the menu routines and objects
  40.           EnhMenus.Doc   - This file.
  41.           Demo.Exe       - Demo program for EnhMenus.
  42.           Demo.Pas       - Source code for Demo.Exe
  43.           Demo.Doc       - Please read this file while looking at the Demo,
  44.                            it highlights features of EnhMenus to look for.
  45.           Order.Frm      - An order form to receive the non-shareware
  46.                            version of EnhMenus and its source code.
  47.           Read.Me        - Introductory text file.
  48.  
  49.      INSTALLATION AND USE
  50.      --------------------
  51.      To use EnhMenus, the Uses clause in the App unit must be changed to
  52.      use EnhMenus instead of Menus.  So, instead of
  53.         uses Objects, Drivers, Memory, HistList, Views, Menus;
  54.      It will read:
  55.         uses Objects, Drivers, Memory, HistList, Views, EnhMenus;
  56.  
  57.  
  58.      ______________________________________________________________________
  59.      Turbo Pascal, TurboVision are trademarks or registered trademarks of
  60.      Borland International, Inc.  Portions of this documentation are taken
  61.      from TurboVision Guide and are copyrighted by Borland International.
  62.      The App unit must then be recompiled and any units that use the App
  63.      must similarly be recompiled.
  64.      Don't forget to keep a backup of the original App.Pas and App.Tpu
  65.      files!
  66.  
  67.      SIMILARITIES AND DIFFERENCES
  68.      ----------------------------
  69.      As far as strict TurboVision programming is concerned, there is no
  70.      difference between the EnhMenus and Menus units.  Status line and menu
  71.      functions,
  72.           NewItem        \
  73.           NewLine         \______ Menu routines
  74.           NewSubMenu      /
  75.           NewMenu        /
  76.           DisposeMenu   /
  77.           NewStatusDef \_________ Status line routines
  78.           NewStatusKey /
  79.      all work exactly the same in EnhMenus as they do in Menus.  This
  80.      ensures that your source units will not require any change if you
  81.      access the status line and menus with these routines.  However, if you
  82.      deal directly with the various menu and status line data structures,
  83.      some modification of the code will be required.
  84.  
  85.      NOTE:  Although EnhMenus uses the same registration codes for the
  86.      menus and status line objects as Menus, they are NOT compatible!  An
  87.      attempt to read Menus objects from a stream by EnhMenus will result in
  88.      an error.
  89.  
  90.      EnhMenus also defines three new constants, sfPulled, sfUpdate, and
  91.      ofPull.  These are used as flags in the State and Options fields of
  92.      the View object.  They are defined so they don't interfere with use of
  93.      other flags included in TurboVision.  The flags are described in
  94.      detail below.
  95.  
  96.      The only other major difference between EnhMenus and Menus is the
  97.      fully object nature of EnhMenus which is described below.
  98.  
  99.      ENHMENUS OBJECTS
  100.      ----------------
  101.      TMenuItem - Descended from TObject
  102.           This object is only instantiated for a divider line.  More often,
  103.           the objects TMenuCommand and TMenuSubMenu will be used.
  104.  
  105.           FIELDS
  106.           ------
  107.           Next : PMenuItem                                        READ ONLY
  108.                Points to the next item in the menu.  It is nil if here is
  109.                no next item.
  110.           Name : PString                                          READ ONLY
  111.                Points to the name of the menu item.  It is nil if the item
  112.                is a divider line.
  113.           Param : PString                                         READ ONLY
  114.                Points to the paramater list of the item.  Displayed only in
  115.                a MenuBox and as right-justified.
  116.  
  117.  
  118.  
  119.                                      - 2 -
  120.  
  121.           View : PView                                            READ ONLY
  122.                Points to the view that the item generates.  For example a
  123.                sub-menu's View field will point to the sub-menu view.
  124.           KeyCode : Word                                         READ/WRITE
  125.                Stores the scan code for item's associated hotkey.  KeyCode
  126.                is zero if no hotkey exists.
  127.           HelpCtx : Word                                         READ/WRITE
  128.                Contains the menu item's help context number.
  129.  
  130.           METHODS
  131.           -------
  132.           Constructor Init(aName, aParam:TMenuStr; aHelpCtx:Word;
  133.                            aNext:PMenuItem);
  134.                Calls TObject.Init and then initializes the Name, Param,
  135.                HelpCtx, and Next fields.
  136.           Constructor Load(var S:TStream);
  137.                Creates a TMenuItem object and loads it from the stream.
  138.           Destructor Done; virtual;                     Override: Sometimes
  139.                Disposes of Name and Param and sets them to nil.
  140.           Function Command:Word; virtual;               Override: Sometimes
  141.                The default Command method returns cmValid.  If Command
  142.                returns anything other than cmValid, when the item is
  143.                activated, that command will be placed into the event queue
  144.                and the menu aborted.  If cmValid is returned, no command is
  145.                placed into the event queue and the menu is not aborted.  In
  146.                this way, it is possible for the menu structure to perform
  147.                other functions by overriding the Execute method.
  148.           Function Execute(ParentMenu:PMenuMetaView:Word); virtual;
  149.                                                         Override: Sometimes
  150.                Returns the command constant associated with the menu item
  151.                by calling Command.  By overriding this method, it is
  152.                possible for an item to perform many different purposes such
  153.                as issuing a Message.
  154.           Procedure HotKey(aKeyCode:Word):PMenuItem; virtual;
  155.                                                             Override: Often
  156.                The default HotKey method returns nil.
  157.           Procedure Pull(ParentMenu:PMenuMetaView; On:Boolean); virtual;
  158.                                                         Override: Sometimes
  159.                The default Pull method does nothing.  This method is called
  160.                whenever the use pulls down a menu from the menubar.
  161.           Procedure Store(var S:TStream); virtual;      Override: Sometimes
  162.                Saves the menu item on the stream.
  163.  
  164.      TMenuCommand - Descended from TMenuItem
  165.           Used for menu items that return a command to the application.
  166.           Most often TMenuCommand objects are created using the NewItem
  167.           function.
  168.  
  169.           METHODS
  170.           -------
  171.           Constructor Init(aName, aParam:TMenuStr; aKeyCode, aCommand,
  172.                            aHelpCtx:Word; aNext:PMenuItem);
  173.  
  174.  
  175.  
  176.  
  177.  
  178.                                      - 3 -
  179.  
  180.                Calls TMenuItem.Init to initialize Name, Param, HelpCtx, and
  181.                Next.  Then KeyCode and Command are initialized to their
  182.                respective values.
  183.           Constructor Load(var S:TStream);
  184.                Creates a TMenuCommand object by reading its information
  185.                from the stream.
  186.           Function Command:Word; virtual;                  Override: Seldom
  187.                Returns the command associated with this item.
  188.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  189.                Stores information about the menu command on the stream.
  190.  
  191.      TMenuSubMenu - Descnded from TMenuItem
  192.           TMenuSubMenu is used for menu items that create a submenu when
  193.           selected, or pulled from the parent menu.  Normally, TMenuSubMenu
  194.           objects are created using the NewSubMenu function.
  195.  
  196.           FIELDS
  197.           ------
  198.           SubMenu : PMenu                                         READ ONLY
  199.                Points to the list structure of menu items contained in the
  200.                submenu.
  201.  
  202.           METHODS
  203.           -------
  204.           Constructor Init(aName, aParam:TMenuStr; aHelpCtx:Word;
  205.                            aSubMenu:PMenu; aNext:PMenuItem);
  206.                Calls TMenuItem to initialize Name, Param, HelpCtx, and
  207.                Next.  Then SubMenu is set to aSubMenu.
  208.           Constructor Load(var S:TStream);
  209.                Creates a TMenuSubMenu object from the information on the
  210.                stream.
  211.           Destructor Done; virtual;                        Override: Seldom
  212.                Disposes of SubMenu and then calls TMenuItem.Done.
  213.           Function Execute(ParentMenu:PMenuMetaView):Word; virtual;
  214.                                                            Override: Seldom
  215.                If not already pulled, the submenu is pulled by calling
  216.                Pull(ParentMenu, True).  ParentMenu^.Owner^.ExecView is
  217.                called with the submenu's associated view.  Finally, if the
  218.                menu had to be pulled it is put back, Pull(ParentMenu,
  219.                False).
  220.           Procedure HotKey(aKeyCode:Word):PMenuItem; virtual;
  221.                                                            Override: Seldom
  222.                Calls SubMenu^.HotKey to search the associated menu for
  223.                aKeyCode.
  224.           Procedure Pull(ParentMenu:PMenuMetaView; On:Boolean);
  225.                                                            Override: Seldom
  226.                Pull is used to create the submenu's view which is stored in
  227.                the inherited field, View.  If On is true, coordinates are
  228.                calculated and View is inserted into ParentMenu^.Owner.  If
  229.                On is false, View is deleted from ParentMenu^.Owner, View is
  230.                then disposed of and set to nil.
  231.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  232.                Stores the submenu item onto the stream.
  233.  
  234.  
  235.  
  236.  
  237.                                      - 4 -
  238.  
  239.      TMenu - Descended from TObject
  240.           This contains the items in the menu along with the default menu
  241.           item.  It is most often created by NewMenu.
  242.  
  243.           FIELDS
  244.           ------
  245.           Items : PMenuItem                                       READ ONLY
  246.                A linked list of all the items in the menu.
  247.           Default : PMenuItem                                     READ ONLY
  248.                Points to the default item in the menu.
  249.  
  250.           METHODS
  251.           -------
  252.           Constructor Init(aItems:PMenuItem);
  253.                Assigns both Items and Default to aItems.
  254.           Constructor Load(var S:TStream);
  255.                Creates a TMenu object and then loads its menu items from
  256.                the stream.
  257.           Destructor Done; virtual;                        Override: Seldom
  258.                Disposes of every item in the menu.
  259.           Function HotKey(aKeyCode:Word):PMenuItem; virtual;
  260.                                                            Override: Seldom
  261.                Cycles through the items in the menu until it finds an item
  262.                with the aKeyCode as its hotkey.
  263.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  264.                Stores each of the items in the menu on the stream.
  265.  
  266.      TStatusDef - Descended from TMenu
  267.           TStatusDef is a stores the menu of items available on a status
  268.           line given a range of help contexts.  It is normally instantiated
  269.           using the NewStatusDef function.
  270.  
  271.           FIELDS
  272.           ------
  273.           Min : Word                                              READ ONLY
  274.                The minimum help context to which this particular status
  275.                definition applies.
  276.           Max : Word                                              READ ONLY
  277.                The maximum help context to which this particular status
  278.                definition applies.
  279.           Next : PStatusDef                                       READ ONLY
  280.                Points to the next status definition, nil if this definition
  281.                is the last.
  282.  
  283.           METHODS
  284.           -------
  285.           Constructor Init(aMin, aMax:Word; aItems:PMenuItem;
  286.                            aNext:PStatusDef);
  287.                Calls TMenu.Init to initialize Items.  Min, Max, and Next
  288.                are then set to their respective values.
  289.           Constructor Load(var S:TStream);
  290.                Creates a TStatusDef object and initializes it from the
  291.                information stored on the stream.
  292.           Procedure Store(var S:TStream);
  293.  
  294.  
  295.  
  296.                                      - 5 -
  297.  
  298.                Stores the status definition onto the stream.
  299.  
  300.      TMenuMetaView - Descended from TView
  301.           TMenuMetaView is the backbone of the EnhMenus units; all menu
  302.           views are descended from this object.  Normally this object is
  303.           not instantiated.
  304.  
  305.           FIELDS
  306.           ------
  307.           Current : PMenuItem                                     READ ONLY
  308.                While the menu is in a modal state, Current points to the
  309.                highlighted item.  Otherwise, Current is nil.
  310.           ParentMenu : PMenuMetaView                              READ ONLY
  311.                ParentMenu points to the TMenuMetaView that owns this menu.
  312.  
  313.           METHODS
  314.           -------
  315.           Constructor Init(var Bounds:TRect);
  316.                Calls TView.Init to set Bounds and sets EventMask to include
  317.                evBroadcast.
  318.           Constructor Load(var S:TStream);
  319.                Creates a TMenuMetaView object and initializes its fields
  320.                from the stream.
  321.           Procedure Activate(Item:PMenuItem); virtual;     Override: Seldom
  322.                The Item^.Execute called with a pointer to Self given as the
  323.                ParentMenu.  If cmCancel is returned and the ParentMenu is
  324.                nil, then the menu structure is aborted with cmCancel.  If
  325.                cmValid is returned, no operation is performed.  If any
  326.                command other than cmCancel or cmValid is returned, EndModal
  327.                is called with the result.
  328.           Procedure ChangeCurrent(Item:PMenuItem); virtual;
  329.                                                            Override: Seldom
  330.                Changes Current to Item and displays a submenu if the
  331.                sfPulled flag is set.
  332.           Procedure EndModal(Command:Word); virtual;        Override: Never
  333.                EndModal ends the current modal state and returns Command as
  334.                result of the caller's ExecView.
  335.           Function Execute:Word; virtual;                   Override: Never
  336.                Executes a menu until the user selects a menu item or
  337.                cancels the menu.  Returns the command assigned to the menu
  338.                item or cmCancel if the menu was cancelled.
  339.           Function FindItem(Ch:Char):PMenuItem;
  340.                Returns a pointer to the menu item that has Ch as its
  341.                shortcut key the highlighted character).  Returns nil if no
  342.                such menu item is found or if the menu item is disabled.
  343.                Note that Ch is case-insensitive.
  344.           Function GetHelpCtx:Word; virtual;            Override: Sometimes
  345.                This method returns the help context of the current menu
  346.                selection.  If this is hcNoContext, the parent menu's
  347.                current context is checked.  If there is no parent menu,
  348.                GetHelpCtx returns hcNoContext.
  349.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  350.                                                            Override: Always
  351.  
  352.  
  353.  
  354.  
  355.                                      - 6 -
  356.  
  357.                This method returns the rectangle occupied by the given menu
  358.                item in R.  Descendants of TMenuView must override this
  359.                method in order to produce the correct rectangle in R.
  360.           Procedure HandleEvent(var Event:TEvent); virtual;
  361.                                                             Override: Often
  362.                Handle keyboard, mouse, and broadcast events for the menu.
  363.                Keyboard events are handled by position the highlighted bar
  364.                on the menu item with that highlighted character, then the
  365.                item is activated.
  366.                Mouse events are handled by tracking the mouse cursor while
  367.                the left mouse button is pressed by the MouseEvent function.
  368.                Broadcast events with the cmCommandSetChanged command causes
  369.                the menu to redraw itself.
  370.                Any object that overrides HandleEvent MUST chain back to
  371.                this method.
  372.           Function HotKey(aKeyCode:Word):PMenuItem; virtual;
  373.                                                            Override: Seldom
  374.                This method checks the current menu for the hotkey, no such
  375.                item is found, it checks the ParentMenu.
  376.           Function ItemAt(P:TPoint):PMenuItem; virtual;    Override: Always
  377.                This method returns the item located at point P, or nil if
  378.                no item exists there.  Descendants of TMenuView must
  379.                override ItemAt in order to produce the correct result.
  380.           Function Menu:PMenu; virtual;                    Override: Always
  381.                This is an abstract method that must be overriden.
  382.           Function MouseInMenus(Where:TPoint):Boolean;
  383.                Returns if the point in Where is located somewhere in the
  384.                currently displayed menu chain.
  385.  
  386.  
  387.      TMenuView - Descended from TMenuMetaView
  388.           TMenuBar and TMenuBox are descended from this object.  It is not
  389.           intended to be instantiated.
  390.  
  391.           FIELDS
  392.           ------
  393.           TrapKeys : Byte                                        READ/WRITE
  394.                TrapKeys contains the keyboard shift mask that the menu
  395.                should respond to.  By default, only TMenuBar uses this and
  396.                sets it to kbAltShift.
  397.  
  398.           METHODS
  399.           -------
  400.           Constructor Init(var Bounds:TRect; aMenu:PMenu;
  401.                            aParentMenu:PMenuMetaView);
  402.                Calls TMenuMetaView to initialize the bounds parameter, then
  403.                initializes Menu and ParentMenu to their respective
  404.                parameters.  TrapKeys is set to zero.
  405.           Constructor Load(var S:TStream);
  406.                Creates a TMenuView object and initializes it to the
  407.                information read from the stream.
  408.           Destructor Done; virtual;                        Override: Seldom
  409.                Calls TMenuMetaView.Done and disposes of Menu if ParentMenu
  410.                is nil.
  411.  
  412.  
  413.  
  414.                                      - 7 -
  415.  
  416.           Function GetPalette:PPalette; virtual;        Override: Sometimes
  417.                Returns a pointer to the defualt CMenuView palette.
  418.           Procedure HandleEvent(var Event:TEvent); virtual;
  419.                                                             Override: Often
  420.                Handles keyboard and command events.  Keyboard events with
  421.                the shift state included in the TrapKeys mask cause the menu
  422.                to focus on that menu item.
  423.                Command events with the command cmMenu toggle the menu
  424.                between a modal and non-modal state.
  425.                Any object that overrides HandleEvent MUST chain back to
  426.                this method.
  427.           Function Menu:PMenu; virtual;                 Override: Sometimes
  428.                Returns the list structure of the menu that the view is
  429.                currently using.
  430.           Procedure Store(var S:TStream); virtual;         Override: Seldom
  431.                Stores the object onto the stream.
  432.  
  433.      TMenuBar - Descended from TMenuView
  434.           TMenuBar draws itself as a list of horizontal menu items.
  435.  
  436.           METHODS
  437.           -------
  438.           Constructor Init(var Bounds:TRect; aMenu:PMenu);
  439.                Calls TMenuView.Init with Bounds and aMenu and nil as the
  440.                ParentMenu.  GrowMode is set to gfGrowHiX and Options is set
  441.                to include ofPull and ofPreProcess.  TrapKeys defaults to
  442.                kbAltShift to respond to alternate quick-keys.
  443.           Procedure Draw; virtual;                         Override: Seldom
  444.                Uses the palette to draw the menu bar horizontally across
  445.                the screen.  The focused menu item is highlighted again
  446.                using the default palette.
  447.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  448.                                                            Override: Seldom
  449.                Returns the rectangle containing Item.
  450.           Procedure HandleEvent(var Event:TEvent); virtual;
  451.                                                            Override: Seldom
  452.                If the menubar is in a modal state, it will respond to right
  453.                arrow, left arrow, end, and home keys.   A down key will
  454.                cause the current menu item to be 'pulled' down if not
  455.                already pulled.
  456.                Any object that overrides HandleEvent MUST chain back to
  457.                this method.
  458.  
  459.      TMenuBox - Descended from TMenuView
  460.           TMenuBox is a rectangle that is automatically sized to include
  461.           its menu items.  It can be used as submenus for a menu bar, as a
  462.           standalone menu, or as a pop-up menu.
  463.  
  464.           METHODS
  465.           -------
  466.           Constructor Init(var Bounds:TRect; aMenu:PMenu;
  467.                            aParentMenu:PMenuMetaView);
  468.                Calls TMenuView.Init with the Bounds, aMenu, aParentMenu.
  469.                The State is set to include a shadow and options is set to
  470.  
  471.  
  472.  
  473.                                      - 8 -
  474.  
  475.                include ofPreProcess.  Bounds is altered to adjust for the
  476.                width and length of the menu.
  477.           Procedure Draw; virtual;                         Override: Seldom
  478.                Draws a box containing the menu items using the default
  479.                palette.  The focused menu item is highlighted.
  480.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  481.                                                            Override: Seldom
  482.                Returns the rectangle containing Item in R.
  483.           Procedure HandleEvent(var Event:TEvent); virtual;
  484.                                                            Override: Seldom
  485.                HandleEvent responds to the down arrow, up arrow, page-down,
  486.                and page-up keys as expected.
  487.                Any object which overrides HandleEvent MUST chain back to
  488.                this method.
  489.  
  490.      TStatusLine - Descended from TMenuMetaView
  491.           The status line is essentially a linked list of menus, one of
  492.           which is displayed depending on the current help context.  As a
  493.           menu itself, the status line can contain TMenuCommands and
  494.           TMenuSubMenus.   Also, because TMenuMetaView is TStatusLine's
  495.           ancestor, TStatusLine can become focused and modal just like any
  496.           other menu.
  497.  
  498.           FIELDS
  499.           ------
  500.           Defs : PStatusDef                                       READ ONLY
  501.                Defs is the start of the linked list of menus.  Defs is
  502.                normally initialized through a series of calls to
  503.                NewStatusDef.
  504.           CurrentDef : PStatusDef                                 READ ONLY
  505.                Returns the status definition current being displayed
  506.                according to the current help context.
  507.  
  508.           METHODS
  509.           -------
  510.           Constructor Init(var Bounds:TRect; aDefs:PStatusDef);
  511.                Calls TMenuMetaView.Init with the Bounds parameter.  Options
  512.                is set to include ofPreProcess and GrowMode is set to
  513.                gfGrowLoY+gfGrowHiX+gfGrowHiY.  Defs is set to aDefs and
  514.                CurrentDef is also set to Defs.
  515.           Constructor Load(var S:TStream);
  516.                Reads the status line and all associated status line
  517.                definitions from the stream.
  518.           Destructor Done; virtual;                        Override: Seldom
  519.                Calls TMenuMetaView.Done and then disposes of all of the
  520.                status line definitions.
  521.           Procedure Activate(Item:PMenuItem); virtual;     Override: Seldom
  522.                The Item^.Execute called with a pointer to Self given as the
  523.                ParentMenu.  If cmCancel is returned and the ParentMenu is
  524.                nil, then the menu structure is aborted with cmCancel.  If
  525.                cmValid is returned, no operation is performed.  If any
  526.                command other than cmCancel or cmValid is returned, EndModal
  527.                is called with the result.  Differs from
  528.                TMenuMetaView.Activate in that a disabled item (an item with
  529.  
  530.  
  531.  
  532.                                      - 9 -
  533.  
  534.                an associated command which has been disabled) won't remain
  535.                highlighted.
  536.           Procedure Draw; virtual;                         Override: Seldom
  537.                Draws the status line as a horizontal bar containing the
  538.                current definitions using the status line palette.  The
  539.                focused item is highlighted, also using the palette.
  540.           Procedure GetItemRect(Item:PMenuItem; var R:TRect); virtual;
  541.                                                            Override: Seldom
  542.                Returns the rectangle occupied by Item in R.
  543.           Function GetPalette:PPalette; virtual;        Override: Sometimes
  544.                Returns the default CStatusLine palette.
  545.           Procedure Hint(aHelpCtx:Word):String; virtual;    Override: Often
  546.                Returns a hint string for the current help context.  This
  547.                string is displayed at the end of the status line after a
  548.                vertical divider bar.  The current Hint returns an empty
  549.                string and must be overriden to provide any useful
  550.                information.
  551.           Function Menu:PMenu; virtual;                    Override: Seldom
  552.                Returns the current status definition contained in
  553.                CurrentDef.
  554.           Procedure Store(var S:TStream);
  555.                Writes the status line and all of its status line
  556.                definitions to the stream.
  557.           Procedure Update; virtual;                       Override: Seldom
  558.                Updates the status line to display the definition for the
  559.                current help context.  Normally never called except by the
  560.                TApp.Idle method.
  561.  
  562.      OBJECT HIERARCHY
  563.      ----------------
  564.      Linked list objects and storage objects:
  565.      TObject____TMenuItem_____TMenuCommand
  566.           \         \
  567.            \         \________TMenuSubMenu
  568.             \
  569.              \___TMenu________TStatusDef
  570.  
  571.      Menu view objects:
  572.      TView______TMenuMetaView_TMenuView
  573.                     \              \
  574.                      \              \______TMenuBar
  575.                       \              \
  576.                        \              \____TMenuBox
  577.                         \
  578.                          \____TStatusLine
  579.  
  580.      OTHER TYPES
  581.      -----------
  582.           TMenuStr       =    String[31]
  583.           PMenu          =    ^TMenu
  584.           PMenuMetaView  =    ^TMenuMetaView
  585.           PMenuItem      =    ^TMenuItem
  586.           PMenuCommand   =    ^TMenuCommand
  587.           PMenuSubMenu   =    ^TMenuSubMenu
  588.  
  589.  
  590.  
  591.                                      - 10 -
  592.  
  593.           PStatusDef     =    ^TStatusDef
  594.           PMenuView      =    ^TMenuView
  595.           PMenuBar       =    ^TMenuBar
  596.           PMenuBox       =    ^TMenuBox
  597.           PStatusLine    =    ^TStatusLine
  598.  
  599.  
  600.      OTHER ROUTINES
  601.      --------------
  602.      Procedure DisposeMenu(Menu:PMenu)
  603.           Reclaims the memory used by Menu's items and any submenus that
  604.           exist in Menu.
  605.      Function NewItem(Name, Param:TMenuStr; KeyCode:Word; Command:Word;
  606.                       aHelpCtx:Word; Next:PMenuItem):PMenuItem
  607.           Creates and returns a pointer to a new PMenuCommand object
  608.           initialized with the proper parameters.
  609.      Function NewLine(Next:PmenuItem):PMenuItem
  610.           Creates and returns a pointer to a new PMenuItem object.  The
  611.           PMenuItem object has its Name and Param fields initialized to an
  612.           empty string and HelpCtx is set to hcNoContext.
  613.      Function NewMenu(Items:PMenuItem):PMenu
  614.           Creates and returns a pointer to a TMenu object which contains
  615.           Items.  Items is normally created by nesting calls to NewItem,
  616.           NewSubMenu, and NewLine.
  617.      Function NewStatusDef(aMin, aMax:Word; aItems:PMenuItem;
  618.                            aNext:PStatusDef):PStatusDef
  619.           Creates and returns a pointer to a new TStatusDef object
  620.           initialized with the proper parameters.  Normally, aItems is a
  621.           set of nested calls to NewStatusKey, NewItem, or NewSubMenu.
  622.      Function NewStatusKey(aText:String; aKeyCode:Word; aCommand:Word;
  623.                            aNext:PMenuItem):PMenuItem
  624.           Creates and returns a pointer to a new TStatusKey object
  625.           initialized with the proper parameters.
  626.      Function NewStatusMenu(aText:String; aHelpCtx, aKeyCode:Word;
  627.                             SubMenu:PMenu; aNext:PMenuItem):PMenuItem
  628.           Creates a submenu specifically for the status line.  Notice that
  629.           a status line submenu also takes on a KeyCode value so that it
  630.           can be activated from the keyboard.
  631.      Function NewSubMenu(Name:TMenuStr; aHelpCtx:Word; SubMenu:PMenu;
  632.                          Next:PMenuItem)
  633.           Creates and returns a pointer to a new TMenuSubMenu object
  634.           initialized to the proper parameters.
  635.  
  636.      CONSTANTS
  637.      ---------
  638.           CMenuView      =    #2#3#4#5#6#7
  639.           CStatusLine    =    #2#4#4#5#6#7
  640.           ofPull         =    $0400
  641.                When the ofPull bit is set in a menu's Options field, the
  642.                menu's items will automatically pull their submenus when
  643.                selected.  An example of such a menu would be the menu bar.
  644.           sfPulled       =    $1000
  645.  
  646.  
  647.  
  648.  
  649.  
  650.                                      - 11 -
  651.  
  652.                If this state bit is set, the one of the items in the menu
  653.                currently has its submenu pulled.  Note that the setting of
  654.                this bit is not necessarily related to the ofPull bit.
  655.           sfUpdate       =    $2000
  656.                Used only on the TStatusLine object when the status line
  657.                needs to be updated.
  658.  
  659.      SUPPORT
  660.      -------
  661.      Registered users can receive free support for EnhMenus via CompuServe
  662.      account number 71441,2402.  Any questions or comments should also be
  663.      directed through CompuServe at the same account number.
  664.  
  665.      Thanks for using EnhMenus!
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.                                      - 12 -
  710.