syncing two list fields

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

syncing two list fields

Post by townsend » Thu Jun 21, 2012 4:19 pm

I have two Scrolling List Fields set up with listBehaviour, like this:
889 double text box.JPG
889 double text box.JPG (7.06 KiB) Viewed 4452 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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10321
Joined: Wed May 06, 2009 2:28 pm

Re: syncing two list fields

Post by dunbarx » Thu Jun 21, 2012 4:26 pm

Put this into the script of the subList"

on mouseUp
end mouseUp

Craig Newman

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: syncing two list fields

Post by townsend » Thu Jun 21, 2012 5:02 pm

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.

LittleGreyMan
Posts: 49
Joined: Sat Jun 16, 2012 7:57 pm

Re: syncing two list fields

Post by LittleGreyMan » Thu Jun 21, 2012 5:09 pm

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
Best regards,

Didier

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: syncing two list fields

Post by jacque » Thu Jun 21, 2012 5:24 pm

Turn off the autohilite property of the sublist. You can still hilite lines by script by setting the hilitedlines of the field.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: syncing two list fields

Post by townsend » Thu Jun 21, 2012 5:37 pm

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.

Post Reply