Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SuperLib 3.50 - function bungoption() *new* http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FUNCTION BUNGOPTION()                            *new*

  Short:
  ------
  BUNGOPTION() Adds option during a BUNGEE() menu definition sequence

  Returns:
  --------
  NIL

  Syntax:
  -------
  BUNGOPTION(cPrompt,expAction,bActive)

  Description:
  ------------
  BUNGOPTION() adds an option during a BUNGEE() menu initialization
  sequence.

  [cPrompt] is the menu prompt, a character prompt, which is what will be
            displayed. i.e. "Files", "Edit". Imbed a tilde (~) to determine
            the trigger character which will be highlighted i.e.
            "Files","e~xit". The default trigger is the first letter.

            A specialized form of the character prompt is
            "CROSSBAR". If you include "CROSSBAR" as the text,
            a crossbar will be drawn joining the left and right sides of the
            dropdown box.

  [expAction] can be one of 3 things:
            1. a codeblock. this is simply evaluated
               when the option is selected
            2. An array (or nil) if the action is a dropdown box
               Creates a dropdown box when the prompt is selected.
               (this option must be then followed by a BUNGDROP()..
                BUNGUNDROP() sequence to define the dropdown menu. )
            3. NIL for CROSSBAR types

  [bActive] is the "is this option active?" codeblock
            This can either be NIL (always active)
            or is a codeblock which _must_ return type L
            (logical). This will determine if the prompt
            is active (available) or not (disabled). If disabled,
            the prompt is show in the disabled color.


  Use BUNGSTART(), BUNGEND(), BUNGOPTION(),
  BUNGDROP(), BUNGUNDROP() together to create a menu definition
  array for BUNGEE(). While it is not necessary to use these
  functions to create the array, it is helpful when you have
  a complex, multi-level dropdown structure.

  See BUNGEE for more information.

  Examples:
  ---------

  bungstart()

     bungoption("Files")
     bungdrop()
          bungoption("Open" ,{} ,{||!lFileIsOpen} )
          bungoption("Close",{||nil},{||lFileIsOpen } )
     bungundrop()
     bungoption("Edit")
     bungdrop()
          bungoption("DBF"  ,{||nil},nil )
          bungoption("Ascii",{||nil},nil )
     bungundrop()
     bungoption("Quit",{||bungeequit()},nil)

  aMenu := bungend()
  bungee(0,0,79,aMenu)

  Source:
  -------
  S_BUNGDEF.PRG


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