Scrolling Controls

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Scrolling Controls

Post by trags3 » Wed May 07, 2014 7:25 pm

I have a card with a number of text input fields. Everything on the card can be scrolled. I have a button that goes to the next card when all input is completed.
When I come back to the scrollable card everything has been scrolled to a completely different position.
How can I lock the scrolled position such that all fields are in the original position when I come back to the card?

Tom

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling Controls

Post by dunbarx » Wed May 07, 2014 7:42 pm

Hi.

Certainly there are many ways to store the "scroll" of the several fields (this is a property of those fields) and reset that scroll when you navigate back to the card. But there should be no reason to have to do this. The scroll will stick during navigation. Something else is changing the value(s) of that property. Are you sure no other handler is doing this?

Investigate, please. If for no other reason that to learn more LC, I will be happy to discuss methods of doing the restore thing if you want to. Read up on custom properties, and think about the "openCard" and "closeCard" messages.

Craig Newman

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Scrolling Controls

Post by magice » Wed May 07, 2014 7:47 pm

trags3 wrote: I have a button that goes to the next card when all input is completed.
If I am understanding correctly, I think this is the problem. If you are actually moving the button, than it is no longer taken into the scroll bar's calculations. Instead of moving it, you might try copying it and changing the visibility. Another option might be to leave something else in it's place or lower such as a simple graphic line.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling Controls

Post by dunbarx » Wed May 07, 2014 8:00 pm

Hmm.

Maybe I am misunderstanding.

Are your controls grouped? And does the group itself scroll? Or is it as you originally posted, that several scrolling fields are to have data entered into them, and then a button sends the user somewhere?

If the first, then you well may need, as Magice points out, to set the value of the scroll of the group in a custom property, perhaps on "mouseEnter" in that button, and restore it when you return.

Craig

trags3
Posts: 432
Joined: Wed Apr 09, 2014 1:58 am

Re: Scrolling Controls

Post by trags3 » Wed May 07, 2014 8:16 pm

dunbarx wrote:Hi.

Certainly there are many ways to store the "scroll" of the several fields (this is a property of those fields) and reset that scroll when you navigate back to the card. But there should be no reason to have to do this. The scroll will stick during navigation. Something else is changing the value(s) of that property. Are you sure no other handler is doing this?

Investigate, please. If for no other reason that to learn more LC, I will be happy to discuss methods of doing the restore thing if you want to. Read up on custom properties, and think about the "openCard" and "closeCard" messages.

Craig Newman
Craig and Magice, Here is what is happening on closer inspection. I have 2 buttons on card 2 that are part of the scrolled group which are located at the bottom of the card. the lower right takes me to the next card while the lower left takes me to the previous card. The card 3 has the same 2 buttons and function. When I navigate from card 3 back to card 2 my finger is on the lower left side of the screen and the "Next button moves to where I am touching or last touched. I guess the solution is to make sure the navigation buttons are not scrolled.

Thanks for your help.
Tom

Post Reply