Hi everyone
Is there a way to paste a file(s) to the window1
Then my method process them like (already working drag&drop )
At first i know that the user must select a particular control ( not a text ) Which?
My app already work on Mac but this feature is the accommodate
PC user with copy/paste file habit
actualy develop on RS 2012.2.1 MAC
Thanks
You’ll have to see what’s on the clipboard.
Clipboard return only text or picture
Not the PATH, not the FILENAME even less the File itself
Is there somewhere else in the win system that R.S can access that data ?
Or other R.S. pro trick
Thank
Really? What are you getting with Clipboard.RawData?
doesn’t rawdata contain the file CONTENTS?
It seems like he is looking to get the FolderItem of the file
which you CAN do with drag-n-drop, but I don’t think you can with copy/paste
Yes Dave it’s kind of FolderItem that i need
But the only files that going to be copy is a text file… (excel export) tab delimited
At least i can deal with the path
better if i can get the content
i’v tried Clipboard.RawData … With no success… It should return binary from a basic txt file ?
with the example “html = c.RawData(“HTML Format”)”… replace HTML by TEXT or STRING
No success again
[quote=231259:@Denis Despres]Is there a way to paste a file(s) to the window1
Then my method process them like (already working drag&drop )
At first i know that the user must select a particular control ( not a text ) Which?
My app already work on Mac but this feature is the accommodate
PC user with copy/paste file habit
actualy develop on RS 2012.2.1 MAC
[/quote]
Denis, your explanation is not terribly clear. No sure paste applies here.
If what you want to do is to drop a file on the window and get its path in a control, what you need is something like Canvas.AcceptFileDrop
http://documentation.xojo.com/index.php/RectControl.AcceptFileDrop and then you get the path of the dropped file in the DropObject event http://documentation.xojo.com/index.php/RectControl.DropObject .
Then if you want to get the content in a control, open it with a stream from the foldertem and set, for instance, the Text property of a TextArea or TextField.
Sorry
Yes at my first post it was not very clear
But i thought at this stage of exchange, it was more clear
My app already work with drag&drop multi-files and processed it very well
But some PC user have the habit to copy/paste instead of Drag&Drop
So i asked IF i can get the same info of Drag&drop With the copy/paste
DAVE understand it very well… But i’m challenge back and ask if there WorkAround
( I’v just mentionned that the user must select (getfocus)
on other control to… do not paste in a TextArea ( The info that my app should treat in backgroud )
[quote=231296:@Denis Despres]Sorry
Yes at my first post it was not very clear
But i thought at this stage of exchange, it was more clear
My app already work with drag&drop multi-files and processed it very well
But some PC user have the habit to copy/paste instead of Drag&Drop
So i asked IF i can get the same info of Drag&drop With the copy/paste
DAVE understand it very well… But i’m challenge back and ask if there WorkAround
( I’v just mentionned that the user must select (getfocus)
on other control to… do not paste in a TextArea ( The info that my app should treat in backgroud )[/quote]
OK. You meant they copy the file in a Windows Explorer window (we would call that a finder window in Mac), and then paste in in a non text focused control in your app ?
yes exactly
i’v seen many (window) free app who manage a lot of data ( contain by clipboard )
I’v assume that a developer language like R.S. should also get that info
[quote=231300:@Denis Despres]yes exactly
i’v seen many (window) free app who manage a lot of data ( contain by clipboard )
I’v assume that a developer language like R.S. should also get that info[/quote]
OK. I just quickly checked. The Xojo clipboard does not get this value. RawDataAvailable stays false, even though the file can be pasted in an explorer window. I did not try with RS but it would be extremely surprising if it reacted differently.
You will need to use declares in the Win32 system clipboard class to get the data.
https://msdn.microsoft.com/en-us/library/system.windows.clipboard(v=vs.110).aspx
hehe!!
i wanted a answer… you give me one
If it’s the way (by declare)… I’ll try
For now i’m concerned by other module of my apps
But i’ll definitely comeback for help when i’ll get there with some code to show ( and debug )
Thanks Michel