Page 1 of 1
synchronized scrolling fileds
Posted: Sat Apr 07, 2007 8:10 pm
by quailcreek
Hi All,
Could someone point me to where I can find ifnormation on making synchronized scrolling fileds? ie two or more fileds that scroll using a single scroll bar.
Thanks
Tom
Re: synchronized scrolling fileds
Posted: Sat Apr 07, 2007 9:30 pm
by marielle
Hi Tom,
check out the
List with numbers component in the open stacks gallery. The field with the row numbers scrolls at the same time as the one with the list content.
Posted: Mon Apr 09, 2007 5:52 pm
by quailcreek
Thank you, Marielle. I'll take a look.
Tom
Posted: Sun Jul 08, 2007 2:33 pm
by mluka
Hi, Marielle & Quailcreek.
The example seems to use a listfield (lines don't wrap to stay within the field confines).
I would like to synchronize the scrolling of several fields, but with one of the fields being able to display fairly long, wrapped, lines.
The application is this: an order entry screen where I would have 4 columns: lineNumber, itemQuantity, itemDescription and extendedPrice. "itemDescription" would need to be, occasionnally, fairly long; certainly longer than whatever width I can devote to that field on the screen (hence the need to have that field wrap).
If I limit myself to displaying only what fits within the width of that field, then I can use a listField and the solution is trivial.
But I really would like to display the entire contents of the item's description...
Any ideas? Thanks!
"... 9 days remaining in your trial."
Posted: Tue Jul 10, 2007 12:40 pm
by Mark Smith
As a small counter-balance to Marielles post, I'd make these observations.
Whilst in no-way wishing to deny that Marielle's experience is as she describes (I have no reason to doubt her), I have been using Revolution for 4 or 5 years, and have could hardly have had a more different experience. Yes, there are bugs, and sometimes they persist across many revisions of the product. This can be frustrating. I have also encountered bugs when using various forth, eiffel and ruby implementations.
Still, I find that I get more done, more quickly with Revolution than with anything else, though this also reflects the fact that I use it more, and know it better than the other languages, so it's kind of self-reinforcing.
I am one of those that has found 2.8.1 to be a good stable release, and has had almost no problems with it.
Even when I've had issues with the company, I have found them responsive and helpful.
So, my experience is mine, and Marielle's is hers. I hope she won't take this as a personal attack (it certainly isn't), and I'm sorry that she has found her experience so unpleasant, and I hope that she achieves everything she wants to using the tools she prefers.
Best wishes,
Mark
Synchronized scrolling several fields
Posted: Wed Jul 11, 2007 3:40 am
by mluka
Hi, Marielle and Mark. Thanks for your comments.
But could we get back to my question on how to syncro-scroll fields with lines of different lengths (including "wrapped" lines)?
Thanks!
"... 6 days remaining in your trial."
Re: Synchronized scrolling several fields
Posted: Wed Jul 11, 2007 12:14 pm
by Mark Smith
Yes, back to the forum....
This is fairly basic, should work ok in the script of the 'master' field.
Code: Select all
on scrollBarDrag
set the vScroll of fld "B" to the vScroll of me
end scrollBarDrag
on formatFields
lock screen
set the dontWrap of me to true
filter fld "B" without empty
repeat with n = the number of lines in me down to 1
if the formattedWidth of line n of me > the width of me then
put cr after line n of fld "B"
end if
end repeat
set the dontWrap of me to false
unlock screen
end formatFields
It assumes the presence of a field "B" which does not have wrapping lines. Also, you'd need to trigger the "formatFields" handler after filling the field initially.
It's a start, anyway.
Best,
Mark
Posted: Thu Jul 12, 2007 4:29 am
by mluka
Hi, Mark
It's a start, anyway.
And a
very good start!
All that remained to do was to add a bit of logic to take into account lines (in fld Master) that are several times longer than (the width of fld Master - the scrollBarWidth of fld Master) and to put the appropriate number of CR into fld B.
There is still a bit of a problem left to solve: if fld Master is not very wide, then when it is re-wrapped, at the end of handler "formatFields", some white space will be left at the end of each wrapped line. This may throw off the calculation that determines the number of CR to insert after each line of fld B.
I'll have to think of a way around this one...
Thank you very much for your response!
Posted: Thu Jul 12, 2007 5:20 pm
by Mark Smith
Michel, glad it was helpful!
Best,
Mark