1. 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.

new topic     » topic index » view message » categorize

2. Re: setting indexes in multiple list boxes

Jack,

This will do it, though it's a little "jerky" looking, as the non-clicked in
lists only change after you release the mouse button in the clicked in list:

-- CODE FOLLOWS:
--  code generated by Win32Lib IDE v0.10.6

include Win32Lib.ew
without warning

----
--  Window Window1
global constant Window1 = create( Window, "Window1", 0, Default, Default,
400, 300, 0 )
global constant List2 = create( List, "List2", Window1, 8, 12, 92, 172, 0 )
global constant List3 = create( List, "List3", Window1, 116, 12, 88, 172,
0 )
global constant List4 = create( List, "List4", Window1, 216, 12, 92, 176,
0 )
----
for n = 1 to 10 do
 addItem(List2, "item " & sprint(n) & " list1")
 addItem(List3, "item " & sprint(n) & " list2")
 addItem(List4, "item " & sprint(n) & " list3")
end for
----
procedure List2_onChange ()
integer index
object aList
aList = getSelf()  -- gets "handle" of list that item was selected in
index = getIndex(aList)  -- gets index of selected item in that list
setIndex(List2, index)
setIndex(List3, index)   -- these 3 set indexes for all 3
setIndex(List4, index)
end procedure
onChange[List2] = routine_id("List2_onChange")  -- these trap any changes in
onChange[List3] = routine_id("List2_onChange")  -- any list, and activate
one routine
onChange[List4] = routine_id("List2_onChange")  -- to handle the change

WinMain( Window1, Normal )

-- CODE ENDS

Dan Moyer

----- Original Message -----
From: <jacktarred at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, April 15, 2002 2:26 PM
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.
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: setting indexes in multiple list boxes

Thanks alot for the help.

--- Dan Moyer <DANIELMOYER at prodigy.net> wrote:
> 
> Jack,
> 
> This will do it, though it's a little "jerky"
> looking, as the non-clicked in
> lists only change after you release the mouse button
> in the clicked in list:
> 
> -- CODE FOLLOWS:
> --  code generated by Win32Lib IDE v0.10.6
> 
> include Win32Lib.ew
> without warning
> 
> ----
> --  Window Window1
> global constant Window1 = create( Window, "Window1",
> 0, Default, Default,
> 400, 300, 0 )
> global constant List2 = create( List, "List2",
> Window1, 8, 12, 92, 172, 0 )
> global constant List3 = create( List, "List3",
> Window1, 116, 12, 88, 172,
> 0 )
> global constant List4 = create( List, "List4",
> Window1, 216, 12, 92, 176,
> 0 )
> ----
> for n = 1 to 10 do
>  addItem(List2, "item " & sprint(n) & " list1")
>  addItem(List3, "item " & sprint(n) & " list2")
>  addItem(List4, "item " & sprint(n) & " list3")
> end for
> ----
> procedure List2_onChange ()
> integer index
> object aList
> aList = getSelf()  -- gets "handle" of list that
> item was selected in
> index = getIndex(aList)  -- gets index of selected
> item in that list
> setIndex(List2, index)
> setIndex(List3, index)   -- these 3 set indexes for
> all 3
> setIndex(List4, index)
> end procedure
> onChange[List2] = routine_id("List2_onChange")  --
> these trap any changes in
> onChange[List3] = routine_id("List2_onChange")  --
> any list, and activate
> one routine
> onChange[List4] = routine_id("List2_onChange")  --
> to handle the change
> 
> WinMain( Window1, Normal )
> 
> -- CODE ENDS
> 
> Dan Moyer
> 
> ----- Original Message -----
> From: <jacktarred at yahoo.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Monday, April 15, 2002 2:26 PM
> 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.
> >
> >
> 
> 
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: setting indexes in multiple list boxes

----- 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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu