Re: scrolling

Scott Raney (raney@metacard.com)
Tue, 4 Mar 1997 22:21:15 -0700 (MST)

On Tue, 4 Mar 1997, Simon Lord wrote:

> I have four fields, all have list behaviour. I'm using the first to hold
> a variety of names and when the user clicks on what he/she wants then I
> search out the matching selection in the other 3 flds and hilite them.
> What I'd like is to get all hilites to align at the top of the three
> fields so that the person can easily scan from left to right and make a
> comparison rather than scrolling up nd down.
>
> The default set a hilited line to the center of the field, I'm currently
> fudging that by subtracting x from scroll and aligning it at the top of
> the fld. But there is always 1 selection that refuses to align and you
> must scroll for it.
>
> Is there a bulletproof method for this?

put the hilitedLines of field "x" into tline
put the effective textHeight of field "x" into theight
set the scroll of field "x" to (tline - 1) * theight

Note that this won't work if selected text is in the bottom
screen-full of the field *unless* you pad the field at the end with
enough empty lines to allow the bottom-most line of text to scroll to
the top of the field. Unlike HyperCard fields, MetaCard fields will
only scroll until the bottom of the text is at the bottom of the field
(HyperCard allows the bottom line of text to scroll all the way to the
top of the field, showing lots of unneeded white space in the
process).
Scott

> --
> [---------------------------] Simon Lord
> [Important letters that.....] Database Engineer, CAE Electronics
> [contain no errors will.....] tel: (514) 341-2000 x3861
> [develop errors in the mail.] fax: (514) 340-5496
> [---------------------------] email: simonl@cae.ca
>

***************************************************************
Scott Raney raney@metacard.com http://www.metacard.com
Any sufficiently advanced technology
is virtually indistinguishable from magic -- Clark's law