Visible lines in a scrolling field.

Ralph DiMola rdimola at evergreeninfo.net
Fri Oct 14 10:10:29 CDT 2011


Yes, it's a list field with wrap is disabled. Trying to reduce the font if
the text does not fit. Like this:


Note: device_scaling_factor is calculated on a resize. Here is my code......

    repeat with I = 1 to number of lines of field "Results3"
            set the textSize of line I of field "Results3" to 60 *
device_scaling_factor
            repeat while the width of field "Results3"- the scrollbarwidth
of field "results3" - 5 <  FORMATTEDWIDTH of line I of field "Results3"
               set the textSize of line I of field "Results3" to the
textSize of line I of field "Results3" - 5
            end repeat
      end repeat
  
 

Ralph DiMola
IT Director
Evergreen Information Services


-----Original Message-----
From: use-livecode-bounces at lists.runrev.com
[mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Ken Ray
Sent: Friday, October 14, 2011 1:38 AM
To: How to use LiveCode
Subject: Re: Visible lines in a scrolling field.


On Oct 14, 2011, at 12:05 AM, Ralph DiMola wrote:

> Does anyone know how to find out what lines are currently visible in a
field
> with a vertical scrollbar?

That depends. is this a list field or regular field? If a regular field, do
you have dontWrap turned on, or not?

> More importantly can I find out just before they
> are scrolling into view so I can do some stuff to the line(s) just
before/as
> they become visible?

Well, you can trap the scrollBarDrag of the field and do something based on
its value, but you'd have to be fast...

> If I process all the lines (say for 2-3 hundred) it
> take waayyy too long for it to finish and the vertical scrollbar motion or
> highlighting 1 line will not happen until the entire list is processed. I
> put some constructive waits in and it reduces the problem but doesn't fix
> it.

What exactly are you trying to accomplish?

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list