Re: setting indexes in multiple list boxes

new topic     » goto parent     » topic index » view thread      » older message » newer message

----- Original Message ----- 
From: <jacktarred at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: setting indexes in multiple list boxes
> 
> I have several list boxes in a program.  Is there any
> way to configure my list so that if a person selects
> item #3 in list box #2, all the list boxes are set to
> item #3?  And when he/she changes his/her mind and
> picks item #7 in list box 4 all the indexes are reset?
> 
> Thanks in advance for the help.
> 

Here is my offering:
-----------------
include win32lib.ew
without warning

constant Win = createEx(Window, "List Sync", 0, 0, 0, 410, 250, 0, 0),
         Ls1 = createEx(ListBox, "", Win,   5, 5, 90, 200,   0, 0),
         Ls2 = createEx(ListBox, "", Win, 105, 5, 90, 200,   0, 0),
         Ls3 = createEx(ListBox, "", Win, 205, 5, 90, 200,   0, 0),
         Ls4 = createEx(ListBox, "", Win, 305, 5, 90, 200,   0,  0),
         Lists = {Ls1, Ls2, Ls3, Ls4}

addItem(Ls1, {"Dog",   "Cat",   "Cow",   "Pig"})
addItem(Ls2, {"Woof",  "Meow",  "Moo",   "Oink"})
addItem(Ls3, {"Black", "White", "Brown", "Pink"})
addItem(Ls4, {"Bones", "Fish",  "Grass", "Slops"})


procedure ClickLists(integer self, integer event, sequence parms)
   integer pos
   pos = getIndex(self)
   for i = 1 to length(Lists) do
    setIndex(Lists[i], pos)
   end for
end procedure
setHandler(Lists, w32HChange, routine_id("ClickLists"))

setIndex(Ls1, 1)
WinMain(Win, Normal)
----------------
Derek

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu