scrolling fields without scrollbars

Klaus Major klaus at major-k.de
Mon Jun 28 12:05:04 EDT 2004


Hi Chris,

> I’ve got a question I’m hoping someone can help me with.
> ...
> Does anyone have a way to do this?  Basically what I want is to be 
> able to
> take a given block of text and calculate how many “pages” I would get 
> from
> that text (using my field which is set to a size of 400 x 325), and 
> then how
> much I would need to scroll to display each “page”.  Does that make 
> sense?
> If anyone has any ideas, I’d be very grateful.  Keep in mind that 
> these will
> be paragraphs of text.  So word wrap is on for the field and there are 
> only
> returns at the end of paragraphs.

Here is a short script to scroll exactly "one page"
(if "one page" = the visible content of that field...):

on mouseUp
   set the scroll of fld 1 to (the scroll of fld 1 + the height of fld 1)
end mouseUp

To scroll back "one page":

on mouseUp
   set the scroll of fld 1 to (the scroll of fld 1 - the height of fld 1)
end mouseUp

See also "the formattedheight" in the docs...


Hope that will get you started...

> Thanks,
>
> Chris Sheffield
> Software Developer
> Read Naturally
> csheffield at readnaturally.com

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list