Page 1 of 1
syncing two list fields
Posted: Thu Jun 21, 2012 4:19 pm
by townsend
I have two Scrolling List Fields set up with listBehaviour, like this:

- 889 double text box.JPG (7.06 KiB) Viewed 4451 times
The list on the left is the main list.
Clicks on the main list are duplicated on the sub list, with this code.
Code: Select all
put hilitedline of fld "main.list" into saved
set the hilitedLines of fld "sub.list" to saved
Now here's my problem. I need to disable clicks on the sub list so they
don't disturb the synchronicity. Right now, the only way I can do this is
by setting the sub list to disabled-- but that makes the text hard to read.
Can anyone think of another option? I can't.
Re: syncing two list fields
Posted: Thu Jun 21, 2012 4:26 pm
by dunbarx
Put this into the script of the subList"
on mouseUp
end mouseUp
Craig Newman
Re: syncing two list fields
Posted: Thu Jun 21, 2012 5:02 pm
by townsend
Oh yes-- I tried that, but it seems the toggleHilites property is independent of any captured mouse clicks.
There's one other option I've discovered that works-- but is's very sloppy. I make the Saved variable Global and put that same Set statement in the sub list. When the user clicks on the sub list, the toggleHilites incorrectly, and then immediately corrects to the Saved values. It's very noticable, even with an i7 processor.
Re: syncing two list fields
Posted: Thu Jun 21, 2012 5:09 pm
by LittleGreyMan
If I understand correctly, the sub list is populated by code, limited to display and the user has no direct interaction with it.
I didn't try this yet in LC, but in this case, putting a transparent drawing trapping mouseUp messages over this field will probably work.
HTH
Re: syncing two list fields
Posted: Thu Jun 21, 2012 5:24 pm
by jacque
Turn off the autohilite property of the sublist. You can still hilite lines by script by setting the hilitedlines of the field.
Re: syncing two list fields
Posted: Thu Jun 21, 2012 5:37 pm
by townsend
jacque wrote:Turn off the autohilite property of the sublist. You can still hilite lines by script by setting the hilitedlines of the field.
Allright! Jacquelin wins a prize.
Thanks everyone for chipping in on this.
Turns out, as usual, LiveCode makes it simple.