"Notes" style native multiline control?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

"Notes" style native multiline control?

Post by CALL-151 » Sun Nov 04, 2012 2:44 pm

I'd like to create an iOS native multiline control with text that scrolls on an image of yellow ruled paper, as is done in the iOS/MacOS Notes app. Setting the background of a native multiline control to an image isn't possible. The obvious solution would be to scroll an image of yellow ruled paper via a scrollerdidscroll handler whenever the multiline scrolls, but as far as I can tell native multiline controls do not send scroll-related messages. I'd really prefer to stick with a native control to take advantage of the auto correction features. Has anyone managed to get something like this working?

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: "Notes" style native multiline control?

Post by endernafi » Sun Nov 04, 2012 9:40 pm

Hello CALL-151,

I've struggled with your problem for a while now.
Sorry to say, but I don't think that it cannot be done as you've described it.
As you know, LiveCode has serious limitations related to its mobile functionality.
When you create a native mobile control, it sits over all of other controls.

I tried to create a scroller and multiline text,
then set the vScroll value of multiline text to the vertical offset of the scroller control.
something like this:

Code: Select all

on scrollerDidScroll pX, pY
   iphoneControlSet "theMultilineText", "vScroll", pY
end scrollerDidScroll
But as I said, native mobile controls doesn't have any layer functionality.
The one that you created last, is the only one which you can interact with.
If you create your controls as:

Code: Select all

on preOpenCard
   createTheMultilineControl
   createTheScrollerControl
end preOpenCard
You can scroll the content of the screen, whatever it is, but you can't interact with the multiline control.

And if you create the controls as:

Code: Select all

on preOpenCard
   createTheScrollerControl
   createTheMultilineControl
end preOpenCard
Then you can edit your text i.e. interact with the multiline control, but nothing related to the scroller control which you've created.

So, it cannot be done as you've described it.
You have to give up to either functionality or appearance.

If you decide to give up functionality; I mean, auto-correction etc. then you can use my attached stack.
It displays a static text but the code can be tweaked to allow editing.
notesSample.zip
(71.49 KiB) Downloaded 285 times
Hope it helps...
If you have any questions about my code, I'll be happy to answer.

Best,

~ Ender Nafi Elekçioğlu
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: "Notes" style native multiline control?

Post by CALL-151 » Thu Nov 08, 2012 5:09 pm

Thanks. Layering wouldn't be an issue if native multiline text objects sent scroller related messages. As I read the latest iOS release notes (p.79), they should but based on a quick test they don't seem to. I've submitted a feature request.

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: "Notes" style native multiline control? UPDATE

Post by CALL-151 » Mon Nov 26, 2012 4:54 pm

This issue has been acknowledged as a bug by RunRev. Bug report #10555 in the QCC.

Post Reply