Page 1 of 1

Drag Act

Posted: Sat Oct 29, 2022 5:16 pm
by richmond62
So . . . getting "all excited" (well, not that much as, as usual, the hype and the tripe don't coincide) about
Apple's new and much talked-up Freeform app for MacOS (that means, on your computer screen rather than
a tablet):

https://www.macrumors.com/2022/10/25/io ... eform-app/

I noticed how one can:

1. Drag an image from outwith Freeform onto its window.

2. Drag an RTF document from outwith Freeform onto its window.

The question . . .
-
RuPaul.jpg
RuPaul.jpg (25.64 KiB) Viewed 3832 times
-
Err, No, not that question, although I am feeling fairly camp today. :roll:

The question is, is there a way to drag images and text documents from a folder window onto a LiveCode stack?

Re: Drag Act

Posted: Sat Oct 29, 2022 5:38 pm
by Klaus
Hi Richmond,

here a quick and dirty demo stack, check the card script.
This should get you started.

Best

Klaus

Re: Drag Act

Posted: Sat Oct 29, 2022 5:49 pm
by richmond62
Fantastic, Klaus!

Thank you very much indeed!

Re: Drag Act

Posted: Sat Oct 29, 2022 5:52 pm
by richmond62
The RTF drag needs a spot of fine tuning:
-
SShot 2022-10-29 at 19.51.35.png
SShot 2022-10-29 at 19.51.35.png (17.69 KiB) Viewed 3826 times
-
This is because the default textSize of a new field is 12.

Re: Drag Act

Posted: Sat Oct 29, 2022 6:14 pm
by richmond62
SShot 2022-10-29 at 20.12.39.png
SShot 2022-10-29 at 20.12.39.png (5.39 KiB) Viewed 3813 times
-

Code: Select all

 case tSuffix = "rtf" 
         create field
         set the rtftext of last fld to url("file:" & tFile)
         ---- Richmond 29/10/22
         focus on last fld
         select text of last fld
         put the textSize of the selectedText into TXSZ
         set the textSize of last fld to TXSZ
         set the height of last fld to the formattedHeight of last fld
         set the width of last fld to the formattedWidth of last fld
         focus on nothing
         ----
         break
Not sure WHY focus on nothing does NOT remove focus from the field.
-
focusN.jpg
Focus on nothing
focusN.jpg (7.64 KiB) Viewed 3807 times

Re: Drag Act

Posted: Sat Oct 29, 2022 6:32 pm
by richmond62
Err . . . perhaps the state of the Dictionary might be something to do with that:
-
SShot 2022-10-29 at 20.28.36.png
-
A great source of comfort:
-
SShot 2022-10-29 at 20.31.42.png
SShot 2022-10-29 at 20.31.42.png (26.13 KiB) Viewed 3802 times

Re: Drag Act

Posted: Sat Oct 29, 2022 6:35 pm
by richmond62
Deepjoy:
-
SShot 2022-10-29 at 20.33.28.png
SShot 2022-10-29 at 20.33.28.png (24.13 KiB) Viewed 3789 times
-
SShot 2022-10-29 at 20.33.46.png
SShot 2022-10-29 at 20.33.46.png (23.27 KiB) Viewed 3789 times

Re: Drag Act

Posted: Sat Oct 29, 2022 6:45 pm
by richmond62
Aaaaaah:
-

Code: Select all

case tSuffix = "rtf" 
         create field
         set the rtftext of last fld to url("file:" & tFile)
         ---- Richmond 29/10/22
         focus on last fld
         select text of last fld
         put the textSize of the selectedText into TXSZ
         set the textSize of last fld to TXSZ
         set the height of last fld to the formattedHeight of last fld
         set the width of last fld to the formattedWidth of last fld
         select empty
         ----
         break