Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- dBsee 4.6 - The Library - <b>dfmenuadd()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dfMenuAdd()
Adds a label to a menu
------------------------------------------------------------------------------
Syntax:

     dfMenuAdd( <a2Add>, <cOpt>,;
                [<nType>], [<bVal>], [<bRun>], [<cLab>],;
                [<cAct>], [<bMenu>], [<cHelp>] ) --> NIL

Parameters:

     <a2Add>    Array to which the labels are added.
     <cOpt>     Currently selected label. It is used if submenus must be
     added or as a return value for function dfMenu(). N.B. A
     menu label can be defined at the first level only if its
     cOpt is 1 char long .
     <nMnuType> Menu type, as defined in DFMENU.CH. Default is MN_LABEL.
     +-----------------------------------------+
     |  Label       | # | Description          |
     |--------------+---+----------------------|
     |  MN_LABEL    | 1 | Normal               |
     |  MN_LINE     | 2 | Separator            |
     |  MN_SYSTEM   | 3 | System menu          |
     +-----------------------------------------+
     <bVal>     CodeBlock to execute at definition time. Default is
     {||MN_ON}
     +-------------------------------------+
     |  Label       | # | Description      |
     |--------------+---+------------------|
     |  MN_ON       | 1 | Active label     |
     |  MN_SECRET   | 2 | Secret label     |
     |  MN_OFF      | 3 | Deactivated label|
     |  MN_HIDDEN   | 4 | Hidden label     |
     +-------------------------------------+
     <bRun>     CodeBlock to execute at RunTime, when the label is active.
     If it returns .T., the option is accepted. If .F., the
     label is not accepted even if it is selected. The default
     is {||.T.}.
     <cLab>     Label to display in the menu, in correspondence with cOpt.
     The default is "".
     <cAct>     Menu shortcut. The default is "".
     <bMenu>    CodeBlock associated with the menu label. It is returned if
     the label is selected. The default is {||NIL}.
     <cHelp>    Help line which will be displayed at the bottom of the
     screen. The default is "".

Returns:

     NIL

Description:

     Loads into the menu array the label which must be displayed. If the
     label type is MN_LABEL, the CodeBlock <bVal> is executed, and the
     label is classified according to its return value:
     
     . MN_ON   = Active label that can be selected. If it has no submenus,
     its value will be returned.
     
     . MN_SECRET = The label is active but is not displayed on the screen.
     
     . MN_OFF  = The label is displayed but it is not active.
     
     . MN_HIDDEN = The label is not displayed and it is also not active.
     
     If the label type is MN_LINE, a separator is displayed.

Example:

     LOCAL aMenu := {}
     dfMenuAdd( aMenu, "1", MN_LABEL ,;
                {||MN_ON}, {||.T.}, "Procedure"   ,;
                "ins",{||CliDeExe(DE_STATE_INK)}  ,;
                "Data Entry" )
     dfMenuAdd( aMenu, "2", MN_LABEL  ,;
                {||MN_ON}, {||.T.}, "Report"      ,;
                "add",{||CliPrnExe(DE_STATE_INK)} ,;
                "Report" )

See also:

     dfMenu(), dfMenuBlock(), dfMenuEval(), dfMenuSCut()

See Also: dfMenu() dfMenuBlock() dfMenuEval() dfMenuSCut()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson