[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| ON PAD |
+---------------------------------+
ON PAD <pad name> OF <menu name1>
[ACTIVATE POPUP <popup name>
| ACTIVATE MENU <menu name2>]
-----------------------------------
Activates popup or menu bar when menu bar pad is chosen.
-----------------------------------
When a menu pad is chosen from a menu bar, several events may occur - a
menu popup may be displayed and activated, another menu bar may be
displayed and activated or a routine may be executed. The ON PAD
command lets you display and activate another menu popup or menu bar
when a pad is chosen. To execute a routine when a menu pad is chosen
you must use an ON SELECTION PAD or ON SELECTION MENU command.
<pad name> OF <menu name1>
Each menu pad in a menu bar may have a popup or another menu bar
assigned to it. Specify the <pad name> and the <menu name1> containing
the pad, and the popup <popup name> or menu bar <menu name2> to be
displayed and activated.
ACTIVATE POPUP <popup name>
| ACTIVATE MENU <menu name2>
To release a menu popup or menu bar from pad <pad name>, use ON PAD
<pad name> OF <menu name1> without an ACTIVATE POPUP <popup name> or
ACTIVATE MENU <menu name2> clause.
+---------------------------------+
| Program Example |
+---------------------------------+
In example below menu bar named MAINMENU is created. Two menu pads,
INVOICES and CUSTOMERS, are defined and placed on the MAINMENU menu bar.
The popups INVPOP and CUSTPOP are then created with a series of DEFINE
POPUP and DEFINE BAR commands. When the INVOICES menu pad is chosen,
the first ON PAD command activates the popup named INVPOP. When the
CUSTOMERS menu pad is chosen, the second ON PAD command activates the
popup named CUSTPOP. An ON SELECTION POPUP command executes the TMENU
routine when an option is chosen from either popup.
The procedure TMENU displays the name of the popup and the popup option
that was chosen. POPUP() returns the name of the active popup, and
PROMPT() returns the prompt text of the option chosen.
*** ON PAD EXAMPLE ***
CLEAR
DEFINE MENU mainmenu
DEFINE PAD invoices OF mainmenu PROMPT ' \<INVOICES '
DEFINE PAD customers OF mainmenu PROMPT ' \<CUSTOMERS '
ON PAD invoices OF mainmenu ACTIVATE POPUP invpop
ON PAD customers OF mainmenu ACTIVATE POPUP custpop
DEFINE POPUP invpop KEY ALT+I
DEFINE BAR 1 OF invpop PROMPT '\<The invoice stack'
DEFINE BAR 2 OF invpop PROMPT ;
'\<Print one or a bunch of invoices'
DEFINE BAR 3 OF invpop PROMPT '\<Show me what my sales are'
ON SELECTION POPUP invpop DO tmenu
DEFINE POPUP custpop KEY ALT+C
DEFINE BAR 1 OF custpop PROMPT '\<Look at the Customer info'
DEFINE BAR 2 OF custpop PROMPT 'L\<ist my customers'
DEFINE BAR 3 OF custpop PROMPT '\<Make customer labels'
DEFINE BAR 4 OF custpop PROMPT '\<The Customer Ledger'
ON SELECTION POPUP custpop DO tmenu
ACTIVATE MENU mainmenu
PROCEDURE tmenu
HIDE POPUP ALL
HIDE MENU mainmenu
DO CASE
CASE POPUP() = 'INVPOP'
@ 5,0 SAY 'Selected prompt of popup invpop is: ' + PROMPT()
CASE POPUP() = 'CUSTPOP'
@ 5,0 SAY 'Selected prompt of popup custpop is: ' + PROMPT()
ENDCASE
WAIT WINDOW
CLEAR
RETURN
-----------------------------------
See Also: ACTIVATE MENU, ACTIVATE POPUP, DEFINE MENU, DEFINE PAD,
MENU(), ON SELECTION MENU, ON SELECTION PAD, PAD()
-----------------------------------
See Also:
ACTIVATE MENU
ACTIVATE POPUP
DEFINE MENU
DEFINE PAD
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson