SP_BUNGOPTION

BUNGOPTION()
  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

 

2 responses to “SP_BUNGOPTION

  1. Pingback: SP Menu Functions | Viva Clipper !

  2. Pingback: SP Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.