Scrolling Locked Text Field

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
srbarlow3
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 28, 2012 5:20 pm

Scrolling Locked Text Field

Post by srbarlow3 » Fri Mar 07, 2014 11:30 pm

I am trying to add a EULA card to my Android version of an app. I have a file written to the documents folder upon acceptance of the EULA as the user presses the "Accept" button so, if it hasn't been accepted yet(file not present), it opens the EULA agreement page. This happens from an openStack script on the first card of the stack. I also have a "NOT ACCEPT" button that kills the app without writing the file. I tried putting a regular scrolling LC field on the page with locked text but it only scrolls with the scroll bar not a finger...not very cool or "mobile-like". I put a native multiline input over the LC field I added using mobGUI and then as the card is opened (in the openStack script on the first card of the stack) I transfer the agreement text to the Multiline field with a mobileControlSet command. Good so far.

Problem is that the Native multiline field field is editable and brings up the keyboard if someone quickly clicks to select text. I set the "editable" property checkbox in mobGUI to "false" but I can still edit the text . I tried placing an "Answer" dialog in the AVD to check it's value and it seems to be still have a "True" value after the card is open. I tried setting the editable property to "false" in a script after the card is open and it indeed locks the field from editing but it is also not scrollable. I even tried setting the property to "false" on mouseDown in the field and back to true on mouseUp but a click and not a drag causes the editing to start and activates the keyboard.

QUESTIONS

Is there an easy way to disable text editing of a mobGUI created Multiline and retain the scrolling ability ?

If not, is there an example available of creating a draggable scrolling locked text field in LC using a regular non native fields and scripting ? I thought I saw a lesson on that online but can't find that now.


Thanks in advance for any help

Russ

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Scrolling Locked Text Field

Post by splash21 » Fri Mar 07, 2014 11:59 pm

Hi, Russ. You can add a native scroller and place a locked text field inside it - that should achieve what you're after. A scroller question came up recently;
http://forums.runrev.com/viewtopic.php?f=54&t=19106

Take a look at the example - let me know if it works for you or if you need another example :)
LiveCode Development & Training : http://splash21.com

srbarlow3
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 28, 2012 5:20 pm

Re: Scrolling Locked Text Field

Post by srbarlow3 » Sat Mar 08, 2014 12:14 am

PERFECT...Thanks

Russ

srbarlow3
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 28, 2012 5:20 pm

Re: Scrolling Locked Text Field

Post by srbarlow3 » Sun Mar 09, 2014 1:18 am

Well..almost perfect. The docs say "All you have to do now is add content to the group - this can be graphics, fields, or anything else that you want to scroll. " I may be dense but I am not sure how to do this. I tried dragging a scroller from the mobGUI pallet onto a card, un locking, resizing and positioning, re-locking size and position and then dragging a text field on to that. Adding text to the field, making it bigger than the scroller, locking text, non focusable, and then using the menu Object-> Group Selected. with the scroller and text field selected.

Sorry to ask for primary training but the docs are unclear to me. I haven't been able to get it to work.

What objects can I add to the scroller.... any graphic?text field? buttons? native fields? a native browser? anything ?

This is powerful tool that was right under my nose in mobGUI but I didn't even realize it. I need to understand this.

Thanks

Russ

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Scrolling Locked Text Field

Post by splash21 » Sun Mar 09, 2014 9:51 pm

The scroller is represented by a normal LiveCode group object, so you can add any other LiveCode objects to it. Here's a good link with info about groups;
http://livecode.byu.edu/groups/Groups.php

If you scan down the paragraph headings, you'll find info on group editing - this should hopefully clear things up!
LiveCode Development & Training : http://splash21.com

Post Reply

Return to “MobGUI”