macroscript exemple category:"HowTo" (
rollout lumiere "Gestion de light"
(
local lum1 = #()
local lum2 = #()
local lum3 = #()
local lum4 = #()
button btn_UpdateGroups "Update" width:210 height:25 align:#center
group "Light Group 1"
(
dropdownlist liste_lum1 "" lum1:#()
)
group "Light Group 2"
(
dropdownlist liste_lum2 "" lum2:#()
)
group "Light Group 3"
(
dropdownlist liste_lum3 "" lum3:#()
)
group "Light Group 4"
(
dropdownlist liste_lum4 "" lum4:#()
)
group "Group 1"(
radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
)
button ajout "Ajouter Selection au groupe" width:210 height:25 align:#center
button active "Activer le groupe" width:210 height:25 align:#center
On ajout pressed do
(
if groupe.state == 1 do
(
sel_courante = selection as array
lum1 = lum1 + sel_courante
makeUniqueArray (lum1)
utilitaire = for s in lum1 collect s.name
liste_lum1.items = utilitaire
)
if groupe.state == 2 do
(
sel_courante = selection as array
lum2 = lum2 + sel_courante
makeUniqueArray (lum2)
utilitaire = for s in lum2 collect s.name
liste_lum2.items = utilitaire
)
if groupe.state == 3 do
(
sel_courante = selection as array
lum3 = lum3 + sel_courante
makeUniqueArray (lum3)
utilitaire = for s in lum3 collect s.name
liste_lum3.items = utilitaire
)
if groupe.state == 4 do
(
sel_courante = selection as array
lum4 = lum4 + sel_courante
makeUniqueArray (lum4)
utilitaire = for s in lum4 collect s.name
liste_lum4.items = utilitaire
)
)
On active pressed do (
if groupe.state == 1 do
(
clearSelection()
select (lum2 + lum3 + lum4)
for v in $ do
(v.on = off)
lum1.on = on
)
if groupe.state == 2 do
(
clearSelection()
select (lum1 + lum3 + lum4)
for v in $ do
(v.on = off)
lum2.on = on
)
if groupe.state == 3 do
(
clearSelection()
select (lum2 + lum1 + lum4)
for v in $ do
(v.on = off)
lum3.on = on
)
if groupe.state == 4 do
(
clearSelection()
select (lum1 + lum2 + lum3)
for v in $ do
(v.on = off)
lum4.on = on
)
)
)
createdialog lumiere width:600 height:600
) -- end utility MyUtil