XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : multilist problem bug

05-31-2011, 04:47 PM
If you select x amount of items in the list on the left and move them to the right and then hit the "X" clear button. Then click the "<" arrow. It will populate the right list with the objects you just removed from it.

It should not do anything.

check it out.

try(destroyDialog ::rltest)catch()
rollout rltest "test"
fn fnListControls oldLst newLst oldArr newArr = ( -- add Objects to list
local currSel = oldLst.selection
for i = oldLst.items.count to 1 by -1 where currSel[i] do (appendIfUnique newArr oldLst.items[i])
newLst.items = sort newArr
for i = oldLst.items.count to 1 by -1 where currSel[i] do (deleteItem oldArr i)
oldLst.items = for i in oldArr collect i -- update list with array
oldLst.selection = #{}
fn fnClearBlackList newList newArr oldList oldArr = -- Clear Blacklist
for itm in oldArr do appendIfUnique newArr itm
newList.items = sort newArr
oldArr = #()
oldList.items = oldArr

local whiteListedArr = #("Render01","Render02","Render03","Render04","Render05","Render06")
local blackListedArr = #()

MultiListBox mlbWhiteSlaves "Whitelisted Slaves:" items:whiteListedArr pos:[5,5] width:130 height:12
MultiListBox mlbBlackSlaves "Blacklisted Slaves:" pos:[167,5] width:130 height:12
button btnMoveToKT ">" height:30 width:30 pos:[136,22]
button btnRemoveFromKT "<" height:30 width:30 pos:[136,54]
button btnClearKT "X" height:30 width:30 pos:[136,86]

on btnMoveToKT pressed do
fnListControls mlbWhiteSlaves mlbBlackSlaves whiteListedArr blackListedArr

on btnRemoveFromKT pressed do
fnListControls mlbBlackSlaves mlbWhiteSlaves blackListedArr whiteListedArr

on btnClearKT pressed do
fnClearBlackList mlbWhiteSlaves whiteListedArr mlbBlackSlaves blackListedArr

createDialog rltest 300 190

CGTalk Moderation
05-31-2011, 04:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.