Page 1 of 1

Scroller with dynamic content

Posted: Thu Sep 19, 2019 6:28 pm
by Pistris
I have the need to create a scroller somewhat like a news feed
where I don't know before hand the amount of data that will be in it

in the past when I had this situation I created a webpage with the data
and loaded it using the web control

I can't use that method now since the app its going to be used mostly offline
and the data presented in the scroller is going to be already in the phone but
the order and the amount of data changes from time to time

any ideas on how to implement this?

thanks in advance.

Edd.

Re: Scroller with dynamic content

Posted: Thu Sep 19, 2019 8:41 pm
by dunbarx
Hi.

When you say "scroller", do you mean a field with text that scrolls down automatically? That is easy. If you want something like a teleprompter, where the rate of scrolling is manually controlled, well, that is easy too.

Or something entirely different?

Craig

Re: Scroller with dynamic content

Posted: Fri Sep 20, 2019 3:42 am
by Pistris
you have to scroll down yourself

the problem is I don't know how to calculate the total height of the scroller content beforehand since the
items in the scroller change

Re: Scroller with dynamic content

Posted: Fri Sep 20, 2019 6:27 pm
by dunbarx
Hmmm.

You know that you can always retrieve the number of lines in a scrolling field, right? And that you can retrieve the "scroll" of such a field. And that if you know the textHeight of the field, you can determine the relative "amount" of scroll that field currently exhibits, even on the fly.

But is that what you needed?

Craig

Re: Scroller with dynamic content

Posted: Fri Sep 20, 2019 6:40 pm
by FourthWorld
In the Dictionary see the unboundedHScroll and unboundedVScroll properties.

Re: Scroller with dynamic content

Posted: Fri Sep 20, 2019 7:56 pm
by dunbarx
You can also use the "vScroll" property in a "scrollBarDrag" handler to see where you are in the scroll process. This value could be scaled in any way you desire.

Code: Select all

on scrollbarDrag
   put the vScroll of me
end scrollbarDrag
Craig

Re: Scroller with dynamic content

Posted: Sun Sep 22, 2019 3:44 am
by Pistris
Thanks guys
Those suggestions actually resolved my problem

Thank you again