Drag and Drop from Windows Explorer to Smalltalk Image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Drag and Drop from Windows Explorer to Smalltalk Image

Alex Greber
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop from Windows Explorer to Smalltalk Image

Louis LaBrunda
Hi Alex,

I think the answer is yes.  VA Smalltalk supports drag and drop.  When defining drag and drop for a widget (generally a container of some sort) you specify either "Image Drag Drop Spec" or "Platform Drag Drop Spec".  You would want "Platform Drag Drop Spec".  "Image Drag Drop Spec" is for dragging and dropping things (rows or whatever) from within the VA Smalltalk program.  "Platform Drag Drop Spec" I expect is for dragging and dropping things that are outside you program.  I have used "Image Drag Drop Spec" (it works fine) but don't remember using "Platform Drag Drop Spec" but I think it should work so give it a try.  Good luck!

Lou

On Thursday, July 23, 2015 at 1:12:24 PM UTC-4, Alex Greber wrote:
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop from Windows Explorer to Smalltalk Image

Julian-2
I have actually tried that...using the Platform Drag Drop Spec, but have never been able to get that to work.
Alex, have you had any luck with this?
I would very much like to be able to drag a file from windows explorer....

Regards,
Juilan

On Friday, 24 July 2015 09:13:06 UTC-4, Louis LaBrunda wrote:
Hi Alex,

I think the answer is yes.  VA Smalltalk supports drag and drop.  When defining drag and drop for a widget (generally a container of some sort) you specify either "Image Drag Drop Spec" or "Platform Drag Drop Spec".  You would want "Platform Drag Drop Spec".  "Image Drag Drop Spec" is for dragging and dropping things (rows or whatever) from within the VA Smalltalk program.  "Platform Drag Drop Spec" I expect is for dragging and dropping things that are outside you program.  I have used "Image Drag Drop Spec" (it works fine) but don't remember using "Platform Drag Drop Spec" but I think it should work so give it a try.  Good luck!

Lou

On Thursday, July 23, 2015 at 1:12:24 PM UTC-4, Alex Greber wrote:
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop from Windows Explorer to Smalltalk Image

Marten Feldtmann-4
In reply to this post by Alex Greber
Yes, its possible - though I've only be able to transfer ONE file at a time. There has been a change in the Drag&Drop Protocol in the Windows history ... the one-file approach is the old protocol (and you you get short file names).

The following code parts are around 15 years old and I took this from an old repository:

startTransfer: callData targetTypes: targetTypes clientData: clientData

    ""

    | dropTransfers |

    dropTransfers := OrderedCollection new.

    targetTypes do: [ :target |
        dropTransfers add:
            (CwDropTransferEntry
                target: target
                transferClientData: clientData) ].
    callData dragContext   
        dropTransferStart: [ :dropTransfer |
            dropTransfer
                dropTransfers: dropTransfers ;
                transferProc:
                    (CwCallbackRec
                        receiver: self
                        selector: #transferProc:clientData:callData:
                        clientData: callData) ].


and

transferProc: aCwDropTransfer clientData: dopProcCallData callData: callData
    ""

    callData value isNil ifTrue: [^self].
    self asyncExecInUI: [
        self handleSelectedFile: (
            CfsPath named:
                ( PHXOperatingSystemServices    longFilenameFromShortPath: (String abtFromPointer: callData value)))]


and:

nativeFilenameDrag: aWidget clientData: clientData callData: callData

    callData
        operation: XmDROPCOPY ;
        dropSiteStatus: XmDROPSITEVALID


and:

nativeFilenameDrop: aWidget clientData: clientData callData: callData

    self startTransfer: callData targetTypes: #('FileName') clientData: self docRenderingsWidget




Am Donnerstag, 23. Juli 2015 19:12:24 UTC+2 schrieb Alex Greber:
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop from Windows Explorer to Smalltalk Image

Julian-2
Thanks for posting the code, Marten.
How is it used?
Are these the handlers for Drag/Drop events?

Sorry if I am missing the obvious, but can you indicate how this code is used?

Thanks!

Regards,
Julian

On Sunday, 3 April 2016 03:29:25 UTC-4, Marten Feldtmann wrote:
Yes, its possible - though I've only be able to transfer ONE file at a time. There has been a change in the Drag&Drop Protocol in the Windows history ... the one-file approach is the old protocol (and you you get short file names).

The following code parts are around 15 years old and I took this from an old repository:

startTransfer: callData targetTypes: targetTypes clientData: clientData

    ""

    | dropTransfers |

    dropTransfers := OrderedCollection new.

    targetTypes do: [ :target |
        dropTransfers add:
            (CwDropTransferEntry
                target: target
                transferClientData: clientData) ].
    callData dragContext   
        dropTransferStart: [ :dropTransfer |
            dropTransfer
                dropTransfers: dropTransfers ;
                transferProc:
                    (CwCallbackRec
                        receiver: self
                        selector: #transferProc:clientData:callData:
                        clientData: callData) ].


and

transferProc: aCwDropTransfer clientData: dopProcCallData callData: callData
    ""

    callData value isNil ifTrue: [^self].
    self asyncExecInUI: [
        self handleSelectedFile: (
            CfsPath named:
                ( PHXOperatingSystemServices    longFilenameFromShortPath: (String abtFromPointer: callData value)))]


and:

nativeFilenameDrag: aWidget clientData: clientData callData: callData

    callData
        operation: XmDROPCOPY ;
        dropSiteStatus: XmDROPSITEVALID


and:

nativeFilenameDrop: aWidget clientData: clientData callData: callData

    self startTransfer: callData targetTypes: #('FileName') clientData: self docRenderingsWidget




Am Donnerstag, 23. Juli 2015 19:12:24 UTC+2 schrieb Alex Greber:
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Drag and Drop from Windows Explorer to Smalltalk Image

rjulianford
In reply to this post by Alex Greber
I know this is an old thread now...but I have still not managed to get this to work.
Does anyone have a working example of this?

Thanks!

Julian

On Thursday, July 23, 2015 at 1:12:24 PM UTC-4, Alex Greber wrote:
Hello everyone.
Is it possible to drag a file from a windows explorer to a smalltalk image an get the file name in smalltalk?
Regards Alex

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.