I have a large text field with a paragraph of text. I also have a few text snippets in their own fields (or buttons). I'd like to be able to allow my app's user to drag one of the text snippets and drop it into the large text field. It's kinda like the "magnetic poetry" game. It's also kinda like this "insert at caret" demo:
h t t p : //skfox . com/jqExamples/insertAtCaret . html (sorry, I don't have permission to paste an url directly in this forum)
If this is possible, how should I go about doing this in LiveCode?
Thank you,
..Jill
Drag and drop guidance
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Drag and drop guidance
Hi Jill,
Welcome to the forum!
Have you looked at this lesson?
http://lessons.runrev.com/s/lessons/m/4 ... t-a-primer
Not sure it covers multi-line text. If you have exhausted that lesson then ask again.
Simon
Welcome to the forum!
Have you looked at this lesson?
http://lessons.runrev.com/s/lessons/m/4 ... t-a-primer
Not sure it covers multi-line text. If you have exhausted that lesson then ask again.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Drag and drop guidance
Hi Jill
A lot of this will be handled automatically for you by LiveCode. Attached is a sample stack, with no code. If you highlight some text in the list of fruits and drag it into the main text field it will be automatically pasted in where you drop it, without you having to do anything.
If you have any other particular requirements please let me know. As a general pointer have a look at the clipboardData property and the clipboard function. Also the copy and paste commands could be useful.
Kind regards
Elanor
A lot of this will be handled automatically for you by LiveCode. Attached is a sample stack, with no code. If you highlight some text in the list of fruits and drag it into the main text field it will be automatically pasted in where you drop it, without you having to do anything.
If you have any other particular requirements please let me know. As a general pointer have a look at the clipboardData property and the clipboard function. Also the copy and paste commands could be useful.
Kind regards
Elanor
- Attachments
-
- textDrag.zip
- (3.05 KiB) Downloaded 491 times
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: Drag and drop guidance
Thank you Elanor! I will investigate thoroughly this weekend.