property message, icon, alertTittel, movableOn, yesLingo, noLingo
on mouseUp me
set myAlertPropList = [ #buttons : #YesNo, #message : message, #icon : icon, #title : alertTittel, #movable : movableOn]
set myAlertBox = new (xtra "MUI") -- instantiates the MUI object
if objectP ( myAlertBox ) then -- makes sure the object exists
set result = Alert (myAlertBox, myAlertPropList)
case result of
1 : -- the user clicked yes
do yesLingo
2 : -- the user clicked no
do noLingo
end case
end if
end
on getPropertyDescriptionList me
set theProps to [:]
set c to "Type your question"
set f to #string
set d to "Continue ?"
addProp theProps, #message, [#comment: c, #format: f, #default: d]
set c to "What kind of icon do you want?"
set f to #symbol
set r to [#stop, #note, #caution, #question]
set d to getAt(r,1)
set typeProps to [#comment: c, #format: f, #range: r, #default: d]
addProp theProps, #icon, typeProps
set c to "Window title?"
set f to #string
set d to "Alert"
addProp theProps, #alertTittel, [#comment: c, #format: f, #default: d]
set c to "Movable?"
set f to #boolean
set d to FALSE
addProp theProps, #movableOn, [#comment: c, #format: f, #default: d]
set c to "Lingo for Yes"
set f to #string
set d to ""
addProp theProps, #yesLingo, [#comment: c, #format: f, #default: d]
set c to "Lingo for No"
set f to #string
set d to ""
addProp theProps, #noLingo, [#comment: c, #format: f, #default: d]
return theProps
end
on GetBehaviorDescription
return "The "YNAlert" creates a alert box with a "Yes" and a "No" button. You choose the title, the message, what kind of icon you want and the Lingo for Yes and No."
end
|