Difference between revisions of "MENU BAR"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
Line 1: Line 1:
==Class==
 
Menus
 
  
  

Revision as of 15:23, 23 October 2009


Purpose

Install a Foxbase style menu bar


Syntax

MENU BAR <array>,<expN>


See Also

@...MENU, MENU, MENU COMMAND, MENU FIELDS, MENU FILES, MENU FORMAT, MENU FRAME, MENU QUERY, MENU SCOPE, READ MENU BAR, SET COMPATIBLE


Description

The MENU BAR command installs a menu bar <array> into the menu bar. All the elements in the <array> must be defined as character strings. The <array> may be defined as a two-dimensional array. Where the first element column is the menu title and the second element column is a message to be displayed in the message line. The number of menu titles is defined by <expN>. This command is used in conjunction with the READ MENU BAR and MENU commands.


Example

// Initialize the array for the menu bar
declare top[3,2]
top[1,1] = "FILE"
top[2,1] = "EDIT"
top[3,1] = "DATA"
top[1,2] = "FILE SELECTIONS"
top[2,2] = "EDIT SELECTIONS"
top[3,2] = "DATA SELECTIONS"
// Initialize arrays for the pull-down menus
// Install the pull-down menu system
// Declare top level menu
declare caTOP [2,2]
caTop [1,1] = "File"
caTop [1,2] = "File operations"
caTop [2,1] = "About"
caTop [2,2] = "Product information."
 
// Declare pulldown menu items
declare caFiles[3]
caFiles [1] = "Open"
caFiles [2] = "Close"
caFiles [3] = "Exit"
 
declare caAbout [2]
caAbout [1] = "Program"
caAbout [2] = "Recital"
 
// Initialize menu system
menu bar caTop, 2
menu 1, caFiles, 7, 3
menu 2, caAbout, 5, 2
 
// Activate menu system
nCol=1
nRow=1
read menu bar to nCol, nRow save
 
// Info about choice
? "You chose the ",caTop[nCol,1], "pulldown."
? "and will execute item number", nRow
?


Products

Recital Mirage Server, Recital Terminal Developer