Generic behavior to display Color Selection Dialog.
-- Color Dialog Behavior
-- HandyDialog Xtra 1.0 or later is required
-- by Meliora Software www.meliorasoft.com/xtras/
-- Compatibilities: Director 6.0 or higher, Windows
property Version, Color1, Color2, Color3, IC
on getPropertyDescriptionList
set description = [:]
addProp description, #Version, [#default:"", #format:#string, #comment:"Dialog Type (Basic, Full or NoFullOpen):"]
addProp description, #Color1, [#default:"", #format:#string, #comment:"Custom Color 1 (R,G,B):"]
addProp description, #Color2, [#default:"", #format:#string, #comment:"Custom Color 2 (R,G,B):"]
addProp description, #Color3, [#default:"", #format:#string, #comment:"Custom Color 3 (R,G,B):"]
addProp description, #IC, [#default:"", #format:#string, #comment:"Initially Selected Color (R,G,B):"]
return description
end
on mouseDown
colorDialog
end
on colorDialog
-- Color Dialog Init Settings
set InitSettings = [:]
addProp InitSettings, #Version, Version
set TempDelimiter = the itemDelimiter
set the itemDelimiter = ","
set C1 = [integer(item 1 of Color1), integer(item 2 of Color1), integer(item 3 of Color1)]
set C2 = [integer(item 1 of Color2), integer(item 2 of Color2), integer(item 3 of Color2)]
set C3 = [integer(item 1 of Color3), integer(item 2 of Color3), integer(item 3 of Color3)]
set Colors = [C1, C2, C3]
addProp InitSettings, #CustomColors, Colors
set InitColor = [integer(item 1 of IC), integer(item 2 of IC), integer(item 3 of IC)]
addProp InitSettings, #InitColor, InitColor
set Ok = showColorDialog(InitSettings)
if getAt(Ok,1) = 0 then
if count(Ok) = 3 then
-- Some color was selected
put getAt(Ok,3)
else
-- Cancel button was clicked
put "Cancel button was clicked"
end if
else
-- Error occured
alert("Error: " & getAt(Ok, 1) & " - base error code")
end if
set the itemDelimiter = TempDelimiter
end
on getBehaviorDescription
return "- - Color Selection Dialog Behavior - -"
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA