[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
BARMEN ( nTRow, nLCol, nPosition, nAction, aBar, aMouse ) -> nChoice
Activates a BarMenu. Colors are predefined via SetPref() !
PARAMETERS:
nTRow Row, in which the Menu is shown
nLCol BeginningRow of the MenuBar
@nPosition Saves the active MenuItem (per Reference!)
nAction MenuItem is activated at once
aBar Array containing Menudata (4 Dim.). Structure:
<cText>, <nRet>, <lSelect>, <cDescription>, <nSpacing>
aMouse Array containing MouseFields (4 Dim.). Structure:
<nRow>, <nLColumn>, <nRColumn>, <nRet>
RETURN VALUE:
If it's a valid choice the 'aBar [x, nRet]' value, defined
in the MenuArray, will be returned. ( Unless you defined a
SubMenu-Array in it -> this will result in a PopUpMenu )
The following ReturnValues are predefined ( SoundVis.ch )
you shouldn't mess with them:
B_ESC 0 will be returned if ESC is pressed
B_LEFT -1 Cursor Left -> Internal, MenuItem +1
B_RIGHT -2 Cursor Right -> Internal, MenuItem -1
B_QUIT -3 Leaves the Menu
B_MOUSE -4 Internal, new Menu is chosen by Mouse
K_MOUSE 255 KeyValue which the Mouse writes into the
Inkey-Buffer
Structure of the MenuArray:
Each element has at least 4 dimensions:
( You'll find the defines in SoundVis.ch )
aBar [1, MEN_TEXT] cText
MenuText, the Hotkey is the one headed by an '~'
aBar [1, MEN_RET] nRet
ReturnValue, can also be an array for a PopUpMenu
aBar [1, MEN_SEL] lSel
is this Item selectable ? if so -> .T.
aBar [1, MEN_DESC] cDesc
Description of the MenuItem, the Hotkey-Marker '~'
will display the following word in a different color
Optional:
aBar [1, MEN_SPACE] nCols
Using nCols you can set the spacing between the last and
this MenuItem. This is used to right-bound the last
MenuItem.
Structure of the MouseArray:
The MouseArray has 4 dimensions and contains information about
Mouse 'Key-Fields'
aMouse [1, MS_ROW ] nRow
When the Mouse is in this Row...
aMouse [1, MS_LCOL] nLColumn
and from this Column....
aMouse [1, MS_RCOL] nRColumn
up to this Column, then..
aMouse [1, MS_RET ] nRet
MS_RET is returned by the Menu !
Meaning: when you want quit your Programm through a 'CloseButton'
on position 0,0 to 0,1 this will be your array:
LOCAL aMouse := {{0, 0, 01, B_QUIT}}
( B_QUIT is predefined to -3 , the Menu is canceled and -3
is returned. You can use it to finish a loop like:
DO WHILE nRet # B_QUIT )
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson