Re: Scroll a field to a specified line number

2020-08-17 Thread Curry Kenworthy via use-livecode



Michael:

> set the vScroll of fld 1 to (60 * the effective textHeight of fld 1)

> Clicking the button takes me to line 65, and when I set the
> list behaviour to true the button scrolls me to line 69

Bernd:

> turn "fixedLineHeight" on for the field

And subtract a line.

Because when scroll is 0, we already see line 1.

To reach line 60, we don't need to add 60 to 1.

1 + 59 = 60.

Best wishes,

Curry Kenworthy

Custom Software Development
"Better Methods, Better Results"
LiveCode Training and Consulting
http://livecodeconsulting.com/

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


Re: Scroll a field to a specified line number

2020-08-17 Thread Niggemann, Bernd via use-livecode
Hi Michael,

This is because the "fixedLineHeight" is turned off by default since a couple 
of versions.

So you either turn "fixedLineHeight" on for the field or you change your code 
to something like

 -- one line
set the vScroll of fld 1 to the formattedtop of line 60 of field 1 - (the top 
of field 1 + the borderwidth of field 1)


Kind regards
Bernd
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Scroll a field to a specified line number

2020-08-16 Thread Michael Lew via use-livecode
This is an odd one, and I hope that it is a bug. When I try to scroll an 
ordinary text field to a specified line number it overshoots, and if I set the 
field to have list behaviour it overshoots by even more.

Here's a simple recipe. New stack with a field and a button. Button script is 
this:
on mouseUp
put empty into fld 1
repeat with i = 1 to 100
put i & return after fld 1
end repeat
set the vScroll of fld 1 to (60 * the effective textHeight of fld 1)
end mouseUp
Clicking the button takes me to line 65, and when I set the list behaviour to 
true the button scrolls me to line 69.

I would love a script that works, and this a big, right?

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