home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
MENUS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-04-29
|
4KB
|
135 lines
/**********************************************/
/* example of RXWINDOW function package usage */
/**********************************************/
call rxfuncadd 'w_register', 'rxwin30', 'rxwindow'
call w_register
call initialize
w = w_open(2,2,23,78,normal)
call w_border w
current = 1
menu_item = 1
do i = 1 to food_types
if i = current then attr = reverse
else attr = normal
call w_put w, 2, 3+(i-1)*10, food_type.i,, attr
end
call w_put w, 20, 20, "Select type of cuisine with /"||'1a'x||'.'
call w_put w, 21, 20, "Select main course with /."
call w_put w, 22, 20, "Press ESC to exit."
call show_menu 1
do forever
key = inkey()
select
when key = right then do
call w_close w1
call w_attr w, 2, 3+(current-1)*10, length(food_type.current), normal
if current < food_types then current = current + 1
else current = 1
call w_attr w, 2, 3+(current-1)*10, length(food_type.current), reverse
menu_item = 1
call show_menu current
end
when key = left then do
call w_close w1
call w_attr w, 2, 3+(current-1)*10, length(food_type.current), normal
if current > 1 then current = current - 1
else current = food_types
call w_attr w, 2, 3+(current-1)*10, length(food_type.current), reverse
menu_item = 1
call show_menu current
end
when key = down then do
call w_attr w1, menu_item+1, 2, length(food.current.menu_item), normal1
if menu_item < food.current.0 then menu_item = menu_item + 1
else menu_item = 1
call w_attr w1, menu_item+1, 2, length(food.current.menu_item), reverse1
end
when key = up then do
call w_attr w1, menu_item+1, 2, length(food.current.menu_item), normal1
if menu_item > 1 then menu_item = menu_item - 1
else menu_item = food.current.0
call w_attr w1, menu_item+1, 2, length(food.current.menu_item), reverse1
end
when key = esc then leave
otherwise nop
end
end
call w_close w
exit
/* show a cuisine menu */
show_menu:
n = arg(1)
w1 = w_open(4,4+(n-1)*10,food.n.0+2,36,normal1)
call w_border w1, 1, 1, 1, 1
attrib. = normal1
attrib.menu_item = reverse1
do j = 1 to food.n.0
call w_put w1, j+1, 2, food.n.j,, attrib.j
end
drop attrib.
return
/* initialize variables */
initialize:
esc = '1b'x
right = '004d'x
left = '004b'x
up = '0048'x
down = '0050'x
parse value pcvideomode() with irc colors . .
if irc = 1 & colors < 4 then do
normal = 7
normal1 = 7
reverse = 112
reverse1 = 112
end
else do
normal = 47
normal1 = 31
reverse = 112
reverse1 = 112
end
food_type.1 = 'French'
food_type.2 = 'Italian'
food_type.3 = 'Chinese'
food_type.4 = 'Indian'
food_type.5 = 'Cajun'
food_types = 5
food.1.1 = "Boeuf à la Bourguignonne"
food.1.2 = "Canard aux Pêches"
food.1.3 = "Coquilles Saint Jacques"
food.1.4 = "Escalopes de Veau à l'Estragon"
food.1.5 = "Grillade d'Agneau à la Provençale"
food.1.0 = 5
food.2.1 = "Cannelloni alla Romana"
food.2.2 = "Fettuccine alla moda di Alfredo"
food.2.3 = "Lasagna Bolognese"
food.2.4 = "Linguine al Sugo di Vongole"
food.2.5 = "Pollo alla Cacciatora"
food.2.6 = "Tortellini Carbonara"
food.2.0 = 6
food.3.1 = "Kung Pao Prawns"
food.3.2 = "Lemon Chicken"
food.3.3 = "Mo Shu Pork"
food.3.4 = "Mongolian Beef"
food.3.5 = "Peking Duck"
food.3.6 = "Yu-Shiang Eggplant"
food.3.0 = 6
food.4.1 = "Booti Kabab"
food.4.2 = "Gosht Vindaloo"
food.4.3 = "Lamb Pasanda"
food.4.4 = "Shahi Korma"
food.4.5 = "Tandoori Chicken"
food.4.0 = 5
food.5.1 = "Blackened Redfish"
food.5.2 = "Cajun Prime Rib"
food.5.3 = "Panéed Chicken and Fettucini"
food.5.4 = "Sautéed Crawfish"
food.5.5 = "Shrimp Creole"
food.5.0 = 5
return