Code: Select all
on mouseUp
submenu the short name of me
end mouseUp
command submenu mitem
local ar
local x
local y
local mLoc
local b
local c
playclick
put the loc of group "MainData" on this card into mLoc
split mLoc by comma
put mLoc[1] into x
put mLoc[2] into y
put x into b
replace "-" with "" in b
put y-(the height of field "Generic" on this card) into c
put "MainData" into ar["medinfo" ]
put "Purpose Data" into ar["purpose" ]
put "Dose Data" into ar["dose" ]
put "Side Effects Data" into ar["side effects" ]
put "Emergency Conditions Data" into ar["Emergency cond" ]
put "Abuse Potential Data" into ar["Abuse Potential" ]
put "Cautions Data" into ar["Cautions" ]
put "Pregnancy Data" into ar["Pregnancy" ]
put the formattedLeft of group "MainMenu" on this card into cleft
replace "-" with "" in cleft
set the hScroll of group "MainMenu" on this card to cleft + the left of button mitem of group "MainMenu" on this card
repeat for each key tKey in ar
if tKey is "medinfo" then
move group ar[tKey] on this card to -b,y in 0.5 second
else
if exists(group ar[tKey] on this card) then
put the loc of group ar[tKey] on this card into dLoc
split dLoc by comma
if dLoc[1] is not -b then
move group ar[tKey] on this card to -b,c in 0.5 second
end if
end if
end if
end repeat
if mitem is "medinfo" then
set the visible of field "Generic" on this card to true
set the visible of field "Brand" on this card to true
move group ar[mitem] on this card to b,y in 0.5 second
else
set the visible of field "Generic" on this card to false
set the visible of field "Brand" on this card to false
if exists(group ar[mitem]) then
move group ar[mitem] on this card to b,c in 0.5 second
end if
end if
//Reset hilites
repeat for each key tKey in ar
if tKey is mitem then
set the hilite of button mitem of group "MainMenu" on this card to true
else
set the hilite of button tKey of group "MainMenu" on this card to false
end if
end repeat
select group "MainData" on this card
end submenu