home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
hypercrd
/
hc2_x
/
byndhypr.sit
/
MenuMaster
/
background_2760.txt
< prev
next >
Wrap
Text File
|
1991-01-05
|
3KB
|
87 lines
-- background: 2760 from stack: in
-- bmap block id: 0
-- flags: 0000
-- background id: 0
-- name:
----- HyperTalk script -----
----------------------------------------------------------------------
-- Menu Master!
--
-- Cyan ΓÇó Spokane, Washington ΓÇó (509) 238-6789
--
-- All scripts are copyright © 1990 by Cyan. All rights reserved.
-- You may use these scripts in your own non-commercial stacks.
--
----------------------------------------------------------------------
on compress
repeat with x = the number of lines in card field theitems down to 1
if line x of card field theItems is empty then
delete line x of card field theItems
delete line x of card field commandKey
repeat with y = x to 15
put card field id (30 + y) into card field id (30 + (y-1))
end repeat
put empty into card field id 45
end if
end repeat
end compress
on adjust
lock screen
set cursor to busy
get the rect of card field theitems
put 5+(16 * the number of lines in card field theitems) + item 2 of it into item 4 of it
put the rect of card field shadow into shadowRect
put item 3 of it + 1 into item 3 of shadowRect
put item 4 of it + 1 into item 4 of shadowRect
put the rect of card field commandkey into commandRect
put item 4 of it + 1 into item 4 of commandRect
set the rect of card field shadow to shadowRect
set the rect of card field theitems to it
set the rect of card field commandKey to commandRect
get the number of lines in card field theitems
repeat with x = 1 to 15
if x ≥ it then hide card field id (30 + x)
else
if char 1 to 2 of line x+1 of card field theItems is "ΓÇôΓÇô" then
hide card field id (30 + x)
else
show card field id (30 + x)
end if
end if
end repeat
end adjust
on testMenu
put the first word of card field themenu into menuName
show menubar
if there is a menu menuName then
delete menu menuName
end if
create menu menuName
repeat with x = 2 to the number of lines in card field theitems
get word 1 to (the number of words of line x of card field theitems) of line x of card field theitems
if char 1 to 2 of it is "ΓÇôΓÇô" then
put "-" after menu menuName
else
if char 1 of it is "⇧" then
delete char 1 of it
put it after menu menuName
set the checkMark of menuItem (x-1) of menu menuName to true
else
put it after menu menuName
put card field id (30 + (x-1)) into M
if M is not empty then set the menuMsg of menuItem (x-1) of menu menuName to M
end if
end if
if textstyle of line x of card field theItems is "outline,condense" then
disable menuitem x-1 of menu menuName
end if
get line x of card field commandkey
if it is not empty then
set the cmdChar of menuitem x-1 of menu menuName to char 2 of it
end if
end repeat
end testMenu