ON BAR

From Recital Documentation Wiki
Revision as of 15:43, 12 November 2009 by Helengeorge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Execute a command when a bar is highlighted


Syntax

ON BAR <expN> OF <pop-up> [<command>]


See Also

ACTIVATE POPUP, BAR(), DEACTIVATE POPUP, DEFINE BAR, DEFINE POPUP, MENU FILES, ON POPUP, ON SELECTION BAR, ON SELECTION POPUP, POPUP(), PROMPT(), SHOW POPUP, SET COMPATIBLE


Description

The ON BAR command is used to specify commands which will execute when the specified bar is highlighted. A bar is a menu option in a Xbase style pop-up menu. These types of menus are created with the DEFINE POPUP and DEFINE BAR commands. The bar is identified by the numeric expression <expN> that was assigned with the DEFINE BAR command.

Used without a specified command, the ON BAR command disables previously specified commands. The command SET COMPATIBLE should be ON when using Xbase style menus. Commands specified by the ON POPUP command execute on highlighted bars that do not have an ON BAR command associated with them.

<command>

The pop-up menu is identified by the name <pop-up> that was assigned with the DEFINE POPUP command. The specified command may be any Recital/4GL command. To specify a command that will execute when a bar is selected, see the ON SELECTION BAR command.


Example

define menu main
define pad exit of main;
  prompt "\<Exit" at 0,0
define pad filelist of main;
  prompt "\<Files" at 0,6
on pad filelist of main activate popup files
on selection pad exit of main deactivate menu
 
define popup files from 1,06
define bar 1 of files prompt "\<Programs>"
define bar 2 of files prompt "\<Databases"
on bar 1 of files dialog box "Enter Bar 1"
on bar 2 of files dialog box "Enter Bar 2"
on exit bar 1 of files dialog box "Exit Bar 1"
on exit bar 2 of files dialog box "Exit Bar 2"
activate menu main


Products

Recital