Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : DBT10.ZIP
Filename : DBTHMENU.PRG

 
Output of file : DBTHMENU.PRG contained in archive : DBT10.ZIP

* =====================================================================
* DBTHMENU.PRG - Horizontal Bar Menu demo
* (c) 1989 BERNATH COMPUTER
* 6:46:38 9/20/1989
* =====================================================================
CALL DBTOOLS WITH "15,3"
CALL DBTOOLS WITH "7,1,7,0,0"
CALL DBTOOLS WITH "3,3,5,13,53,0,7,2,0,1"
CALL DBTOOLS WITH "1,4,7,8,7,0,Horizontal Bar Menu - function 9"
SET COLOR TO N/W
@ 5,9 SAY "HMENU provides a horizontal moving bar"
@ 6,9 SAY "menu in the style of Lotus 123. Use of"
@ 7,9 SAY "the arrow keys or Home and End highlights"
@ 8,9 SAY "the desired menu item, and Enter selects"
@ 9,9 SAY "it. Alternatively, you may press the"
@ 10,9 say "first letter of the menu item without"
@ 11,9 SAY "pressing Enter."
CALL DBTOOLS WITH "10,12,12,8,7"

CALL DBTOOLS WITH "3,6,10,22,75,15,0,2,0,0"
mPARM = "CALL DBTOOLS WITH "+CHR(34)+"9,choice,row,col,LowFG,LowBG,"

set color to +w/n
@ 7,12 say "Syntax:"
@ 8,12 say mPARM
mPARM = "HighFG,HighBG,item1,item2,....,@"+CHR(34)
@ 9,31 SAY mPARM
SET COLOR TO W/N
@ 11,12 SAY "where: Choice is the initial choice to highlight"
@ 13,12 SAY " LowFG & LowBG are the colors for the non-highlighted"
@ 14,12 SAY " menu items."
@ 16,12 SAY " HighFG & HighBG are the colors for the highlighted"
@ 17,12 SAY " menu items."
@ 19,12 SAY " There can be as many menu items as will fit across"
@ 20,12 SAY " one screen line, terminated by the @ character."
CALL DBTOOLS WITH "10,21,28,0,7"
CALL DBTOOLS WITH "3,6,10,22,75,15,0,2,0,0"
@ 7,15 say "A string variable must be used to pass the parameters to"
@ 8,15 say "the function, since the selected choice is returned in it."
@ 9,15 SAY "Note that pressing ESC returns a value of 0."
@ 11,15 say "The example below illustrates how to use HMENU:"
set color to +w/n
@ 13,15 say "mCHOICE = 1"
@ 14,15 SAY "mPARM = "+CHR(34)+"9,"+CHR(34)+"+STR(mCHOICE,2)+"+CHR(34)+",20,25,7,1,1,7,"+CHR(34)
@ 15,15 SAY "mPARM=mPARM+"+CHR(34)+"Add,Change,Delete,Quit,@"+CHR(34)
@ 16,15 SAY "CALL DBTOOLS WITH mPARM"
@ 17,15 SAY "mCHOICE = VAL(mPARM)"
@ 18,15 SAY "DO CASE mCHOICE...... etc"
mCHOICE = 1
DO WHILE mCHOICE <> 0
mPARM = "9,"+STR(mCHOICE,2)+",20,25,7,1,1,7,Add,Change,Delete,Quit,@"
CALL DBTOOLS WITH mPARM
mCHOICE = VAL(mPARM)
@ 20,55 SAY " "
CALL DBTOOLS WITH "5,20,55,20,70,0"
DO CASE mCHOICE
CASE mCHOICE = 1
CALL DBTOOLS WITH "1,20,55,15,2,0,Add selected"
CASE mCHOICE = 2
CALL DBTOOLS WITH "1,20,55,15,2,0,Change selected"
CASE mCHOICE = 3
CALL DBTOOLS WITH "1,20,55,15,2,0,Delete selected"
CASE mCHOICE = 0 .OR. mCHOICE = 4
Mchoice = 0
ENDCASE
ENDDO
CALL DBTOOLS WITH "14,3,0"
RETURN