Synchronized scrolling fields
Gregory Lypny
gregory.lypny at videotron.ca
Fri May 21 08:20:18 EDT 2004
Thanks for responding, Sarah and Ken.
Greg
Sarah,
Yes, only the data field will have scroll bars. Your suggestion
generally works fine for synchronized vertical scrolling, although some
additional tinkering with the handler is required to deal with the
field being emptied and data replaced from time to time. But I was
never able to get it to work properly with horizontal scrolling, at
least not in MetaCard; perhaps it's different in Revolution. If I
remember correctly, it was suggested that separate scroll controls be
used rather than the two that would otherwise be attached to the data
field. I imagine this has to do with properly matching the dimensions
of the three fields which in turn depends on the space taken up by the
data, and that, as I mentioned, will be changing. This has to do with
using the "effective" property for text or line height.
From Sarah:
> I am assuming that only the data field has scroll bars? In that case,
> it just needs a scrollBarDrag handler that sets the vScroll of the line
> numbers field to it's own vScroll and the hScroll of the column labels
> field to it's hScroll.
Ken,
I don't quite follow you here. The data field does have a vertical
grid, but I want the equivalent of a fixed or locked first line and
first column to be column and row labels respectively. So, not matter
how far down or across a user scrolls, they can always identify the row
and column they're viewing by looking at the labels. The labels
themselves can be hypertext that trigger handlers to sort the data.
And from Ken:
> Greg, unless you want different alignments in each field, you can use
> one
> field with tabstops and set the vGrid property to true on the field.
> Put
> your data in tab-delimited and it will truncate at the column
> boundaries.
> Presto!
More information about the use-livecode
mailing list