Comments on: Drag and drop file
Drag and drop of files into R3 windows now supported.
Here's a quick example, written at the lowest level (defining its own graphic objects and event handler -- soon enough this will be supported at a higher layer):
REBOL [Title: "Drop File Test"]
win: make gob! [text: "Test Window" offset: 100x100 size: 600x200]
append win gt: make gob! [
text: [bold "Drop a file on me, s'il vous plaît."]
system/view/event-port: ep: open [scheme: 'event]
ep/awake: func [event] [
print ["EVENT:" event/type event/offset]
switch event/type [
repend gt/text ['newline form event/data]
Thanks to Richard Smolak (Cyphre) for research and example of the Win32 API functions.
If I understand it correctly, this is OS level drag&drop support, right? If so, very cool! Drag&drop at VID level is a bit different thing and I hope styles will count with that, by defining some special handlers for that ...
Hopefully, at least under Windows, systray support will there be too, I just right now don't know, how R3 will aproach things not present on all platforms?
Could this feature be backported in R2 ?
This is good news! Thanks Carl.|
I noticed the use of the new Rich Text Format.
will have us the possibility of including sub-blocks of text with inheritance of the style properties to the sub-blocks ?
[bold “bla bla” [red “i' m red”]]
Now REBOL can be the DnD target. Can REBOL be DnD source as well? |
While draging, can we change the cursor/icon to "Forbidden" to indicate the gob/face is not a compatible target?How do we identity the type of the draged data?
I think there is a possibility to have various cursors in R3, even custom one. That possibility was not present in R2. But don't take it for granted, I am not part of alpha testing group, I just collect some "rumours" :-)
I'm pretty sure, things like cursor image is in the open source part of R3. The goal is, that stuff that is OS-dependent will be open source.|
Pekr, It's an educated guess, not a rumor :) |
I hope at least I can drag something from a REBOL/view app and drop it into another REBOL/View app. Since both sides are REBOL, that could be implemented as a REBOL/Service.
Yes, it is OS DnD, and there is also VID DnD.
There is not yet "source DnD", but we would like to add that at some point.
Yes, we support all the mouse cursors and even custom full color with alpha transparency cursors. In fact VID changes the cursor now for various operations. Quite nice.
Post a Comment:
You can post a comment here. Keep it on-topic.