-- SelectionSetsVisCycle v0.1 (2011.01.23) by Anubis rollout roSelSetsVisCycle "SelectionSetsVisCycle" ( local currIndex = 0, currSelSet = 0 local visState = #() -- to restore on exit dropdownList ddlSelSets width:110 across:4 button btnPrev "PREV" pos:[130,6] width:50 button btnNext "NEXT" pos:[180,6] width:50 button btnAll "ALL" pos:[230,6] width:50 on ddlSelSets selected itm do ( if itm != currSelSet do currIndex = 0 currSelSet = itm ) on btnPrev pressed do ( if selectionSets.count > 0 do ( if currIndex > 1 then currIndex -= 1 else currIndex = selectionSets[currSelSet].count --select (selectionSets[currSelSet][currIndex]) (selectionSets[currSelSet]).isHidden = true (selectionSets[currSelSet][currIndex]).isHidden = false ) ) on btnNext pressed do ( if selectionSets.count > 0 do ( if currIndex == 0 or \ currIndex == selectionSets[currSelSet].count then currIndex = 1 else currIndex += 1 --select (selectionSets[currSelSet][currIndex]) (selectionSets[currSelSet]).isHidden = true (selectionSets[currSelSet][currIndex]).isHidden = false ) ) on btnAll pressed do ( if selectionSets.count > 0 do ( --select (selectionSets[currSelSet]) (selectionSets[currSelSet]).isHidden = false currIndex = 0 ) ) on roSelSetsVisCycle open do ( ddlSelSets.items = for i in selectionSets collect i.name if selectionSets.count > 0 do ( currSelSet = 1 for s = 1 to selectionSets.count do ( ss = for i = 1 to selectionSets[s].count collect selectionSets[s][i].isHidden append visState ss ) ) ) on roSelSetsVisCycle close do ( if visState.count > 0 do ( for s = 1 to visState.count do ( for i = 1 to visState[s].count do selectionSets[s][i].isHidden = visState[s][i] ) ) ) ) createDialog roSelSetsVisCycle width:290