DRAG AND DROP
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
DRAG AND DROP
i have different scrolling list fields, and i would like to just drag and drop selected items from the scolling list fields into a large text box.
now i have "sort of" worked out how to drag an item within the scrolling list to move, but i end up with
"text being dragged" instead of the actual name of the item, with this code
on dragData
set the dragData["text"] to "text being moved"
end dragData
now their are far too many items to list in the "text being moved" and i have no idea what the code would be to fix that
never alone work out how to drag it out of the box all together.
do i need to but a code in the handler box that i wish the dragged item to end up in ??
cheers
now i have "sort of" worked out how to drag an item within the scrolling list to move, but i end up with
"text being dragged" instead of the actual name of the item, with this code
on dragData
set the dragData["text"] to "text being moved"
end dragData
now their are far too many items to list in the "text being moved" and i have no idea what the code would be to fix that
never alone work out how to drag it out of the box all together.
do i need to but a code in the handler box that i wish the dragged item to end up in ??
cheers
Hi smash,
since the syntax of Rev is VERY english like, you should try to put the things you want to achieve into "plain" english. After you did this you can almost "translate" this 1:1 into Rev.
Check out my example "simple_memory1" stack at the bottom of my webpage:
http://www.major-k.de/xtalke.html
for more info about this.
Like this:
1. I want to select text in a list field
2. I want to drag this "selectedtext" (Hint, Hint!
) to another field
3. I want to DROP this text on that other field.
4. I want to replace the text in the otherfield/append it to that field
At lest this is how I understand what you wnat to do.
Hint: "dragdata" is not a valid COMMAND in Rev!
Translation:
1. No scripting necessary, since a list field does this automatically just by clicking the mouse.
2. You START to drag "the selectedtext of fld XYZ"so you have to handle "dragstart", see the docs.
So put this into the script of your listfield:
3. and 4. check DRAGDROP in the docs.
Put this into the script of your target field (your "large text box")
Just comment out the line that fit your needs.
Hope that helps.
Best
Klaus
since the syntax of Rev is VERY english like, you should try to put the things you want to achieve into "plain" english. After you did this you can almost "translate" this 1:1 into Rev.
Check out my example "simple_memory1" stack at the bottom of my webpage:
http://www.major-k.de/xtalke.html
for more info about this.
Like this:
1. I want to select text in a list field
2. I want to drag this "selectedtext" (Hint, Hint!

3. I want to DROP this text on that other field.
4. I want to replace the text in the otherfield/append it to that field
At lest this is how I understand what you wnat to do.
Hint: "dragdata" is not a valid COMMAND in Rev!
Translation:
1. No scripting necessary, since a list field does this automatically just by clicking the mouse.
2. You START to drag "the selectedtext of fld XYZ"so you have to handle "dragstart", see the docs.
So put this into the script of your listfield:
Code: Select all
on dragStart
set the dragData["text"] to the selectedtext of me
end dragStart
Put this into the script of your target field (your "large text box")
Code: Select all
on dragdrop
## 3.
## put the dragData["text"] into me
## 4.
## put CR & the dragData["text"] after me
end dragdrop
Hope that helps.
Best
Klaus
evening klaus
ok i put this into the handlers list for scrolling list field
now what am i doing wrong ???
(i know it is hard to believe a female could be wrong) lol lol
ok i put this into the handlers list for scrolling list field
and this into the text field i was wanting to drag it toon dragData
set the dragData["Text"] to the selectedtext of me
end dragData
but nothing is happeningon dragdrop
put the dragData["text"] into me
end dragdrop
now what am i doing wrong ???
(i know it is hard to believe a female could be wrong) lol lol

Hi smash (what a martial name for a young lady
)
I did NOT write:
And I also gave an appropriate hint!
Please read my post again!
Best
Klaus

I did NOT write:
Code: Select all
on dragDATA
set the dragData["Text"] to the selectedtext of me
end dragDATA
Please read my post again!
Best
Klaus
*slinks back in and pops my glasses on*
whoops
*runs off to rectify my embarrassing moment*
ok i put this into my scrolling list field
now i printed pages 259 - 262 out of the docs this morning, and have been most of the day to understand how this works.

whoops
*runs off to rectify my embarrassing moment*
ok i put this into my scrolling list field
and this into the big boxon dragStart
set the dragData["Text"] to the selectedtext of me into field "results"
end dragStart
and still nothing happens.on dragdrop
put the dragData["text"] into me
end dragdrop
on dragEnter
set the acceptDrop to true
end dragEnter
now i printed pages 259 - 262 out of the docs this morning, and have been most of the day to understand how this works.
i know it is not very ladylike name at all, i will try to rectify that one dayHi smash (what a martial name for a young lady )

Hi smash
I still did not write this:
Please polish your glasses 
Best
Klaus
I still did not write this:
Code: Select all
on dragStart
set the dragData["Text"] to the selectedtext of me INTO FIELD "RESULTS"
end dragStart

Best
Klaus
*runs up and gives you a peck on the cheek"
i know, i know
BUT
i had put this in also
obviously not very well by the tone of your voice LOL
i am trying klaus, (and no not your patience)

i know, i know
BUT
i had put this in also
and that did not work either so i tried to "improvise" lolon dragStart
set the dragData["text"] to the selectedtext of me
end dragStart
obviously not very well by the tone of your voice LOL
i am trying klaus, (and no not your patience)

Hi smash
hmm, tested here with an example stack and it works...?
I can send you this tiny stack, if you like, just send me you mailaddress to:
klaus@major-k.de
Best
Klaus
hmm, tested here with an example stack and it works...?
I can send you this tiny stack, if you like, just send me you mailaddress to:
klaus@major-k.de
Best
Klaus
Hi Klaus
Hope smash doesn't mind me asking you some questions via her thread; thank you in advance, smash!
• Is there some coding to actually see the line of type between dragged between the list box and the field, please?
• Could you give some indication of what else is needed in the on dragDrop script of a second scrolling List field; i.e so that a listField would accept a dragged line from another ListField please?
Hope smash doesn't mind me asking you some questions via her thread; thank you in advance, smash!
• Is there some coding to actually see the line of type between dragged between the list box and the field, please?
• Could you give some indication of what else is needed in the on dragDrop script of a second scrolling List field; i.e so that a listField would accept a dragged line from another ListField please?
Hi all,
to actualy SEE what you are dragging you need to take a snapshot of the "area to be dragged" and then set "the dragimage" to that image.
You will find an example for this (and a LOT more extremely beautiful and stunning example stacks of Scott Rossi at: http://www.tactilemedia.com/!
You will have to click "Software" then "Revolution..." and then scroll down for "Get In Line"...
And you should also check the fantastic tutorials of Eric Chatonet (RIP!) at his website: http://www.sosmartsoftware.com/?r=revolution&l=en.
I am sure you will find there what you are looking for
Best
Klaus
to actualy SEE what you are dragging you need to take a snapshot of the "area to be dragged" and then set "the dragimage" to that image.
You will find an example for this (and a LOT more extremely beautiful and stunning example stacks of Scott Rossi at: http://www.tactilemedia.com/!
You will have to click "Software" then "Revolution..." and then scroll down for "Get In Line"...
And you should also check the fantastic tutorials of Eric Chatonet (RIP!) at his website: http://www.sosmartsoftware.com/?r=revolution&l=en.
I am sure you will find there what you are looking for

Best
Klaus
Dear Smash,
Have you noticed that people usually don't use ALL CAPS to write titles for their posts on this forum?
Best regards,
Mark
Have you noticed that people usually don't use ALL CAPS to write titles for their posts on this forum?
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
MORNING KLAUS
i have tried to email you, but for some reason it wont send
so here is my email address
performancepintos@gmail.com
i would love to work out how this works,
THANK YOU KLAUS
i have tried to email you, but for some reason it wont send
so here is my email address
performancepintos@gmail.com
i would love to work out how this works,
THANK YOU KLAUS
Last edited by smash on Sun Mar 15, 2009 12:43 am, edited 2 times in total.