[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|        ON SELECTION MENU        |
+---------------------------------+
ON SELECTION MENU <menu name>
        | ALL  [<command>]

-----------------------------------
Assigns routine to menu bar.
-----------------------------------

ON SELECTION MENU lets you assign a routine to a menu bar.  When you
choose any pad from the menu bar, the routine is executed.  The routine
may be a command, a program or a procedure.  The ON SELECTION MENU
command should be placed between the DEFINE MENU and ACTIVATE MENU
commands.

<menu name>
        Include the <menu name> to execute the <command> for a specific menu
bar.

ALL
        Include the keyword ALL to execute the <command> for every active menu
bar.

<command>
        Use ON SELECTION MENU <menu name> without a <command> to release a
routine assigned to a specific menu bar, or use ON SELECTION MENU ALL
without a <command> to release routines assigned to all menu bars.

        Routines may be assigned to individual menu pads with the ON SELECTION
PAD command; menu bars and menu popups may be assigned to individual
menu bar pads with the ON PAD command.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In example below, a menu bar is defined containing four menu pads.  When
any of the menu pads is chosen, ON SELECTION MENU executes the TMENU
routine.  The TMENU routine then uses MENU() and PAD() to display the
name of the menu and the menu pad that was chosen.

*** ON SELECTION MENU EXAMPLE ***

CLEAR
DEFINE MENU mainmenu
DEFINE PAD invoices  OF mainmenu PROMPT ' \<INVOICES '  AT 0,00
DEFINE PAD customers OF mainmenu PROMPT ' \<CUSTOMERS ' AT 0,20
DEFINE PAD inventory OF mainmenu PROMPT ' I\<NVENTORY ' AT 0,40
DEFINE PAD quit      OF mainmenu PROMPT ' \<QUIT '      AT 0,60

ON SELECTION MENU mainmenu DO tmenu

ACTIVATE MENU mainmenu
PROCEDURE tmenu
WAIT WINDOW 'Selected menu pad of ' + MENU() + ' is ' + PAD() NOWAIT
IF PAD() = 'QUIT'
        DEACTIVATE MENU
ENDIF
RETURN

-----------------------------------

See Also:  DEFINE MENU, DEFINE PAD, MENU(), ON PAD, ON SELECTION PAD,
PAD()

-----------------------------------

See Also: DEFINE MENU DEFINE PAD MENU() ON PAD ON SELECTION PAD
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson