Page 1 of 1

[Implemented] Drag n Drop

Posted: Thu May 26, 2005 6:06 pm
by naw
Hi,

It would be great to be able to Drag n Drop between PB Gadgets and to/from applications...

At the mo' it looks like its only possible through propietary WinAPI callbacks (which is ok for seasoned PBers, but hard work for PB newbies & occasional coders - such as me :-( ). Of course it isn't portable either.

- if it could be implemented like this:

Code: Select all

repeat:
   WEVENT=waitwindowevent()
    select WEVENT
        case #PB_EventMenu
            MENU = EventMenuID()
            .....
        case #PB_EventGadget
            GADGET = EventGadgetID()
            .....
        case #PB_DragDropEvent()
           DRAGWID = EventDragWindow(); Dragged from WindowID
           DROPWID = EventDropWindow(); Dropped onto WindowID
           DRAGGID = EventDragGadget(); Dragged from GadgetID
           DROPGID = EventDropGadget(); Dropped onto GadgetID
           DRAGDROPDATA = GetClipboardData(#PB_DragDropData)
     endSelect
until WEVENT=#PB_EventCloseWindow
- it would be really easy for bozo's like me to use these difficult techniques...

Re: Drag n Drop

Posted: Fri Jun 17, 2005 1:50 am
by Intrigued
naw wrote:Hi,

It would be great to be able to Drag n Drop between PB Gadgets and to/from applications...

At the mo' it looks like its only possible through propietary WinAPI callbacks (which is ok for seasoned PBers, but hard work for PB newbies & occasional coders - such as me :-( ). Of course it isn't portable either.

- if it could be implemented like this:

Code: Select all

repeat:
   WEVENT=waitwindowevent()
    select WEVENT
        case #PB_EventMenu
            MENU = EventMenuID()
            .....
        case #PB_EventGadget
            GADGET = EventGadgetID()
            .....
        case #PB_DragDropEvent()
           DRAGWID = EventDragWindow(); Dragged from WindowID
           DROPWID = EventDropWindow(); Dropped onto WindowID
           DRAGGID = EventDragGadget(); Dragged from GadgetID
           DROPGID = EventDropGadget(); Dropped onto GadgetID
           DRAGDROPDATA = GetClipboardData(#PB_DragDropData)
     endSelect
until WEVENT=#PB_EventCloseWindow
- it would be really easy for bozo's like me to use these difficult techniques...
naw, I'm with you on this one. I like the power of the few API calls I have successfully accomplished through P.S.; (thanks to the 'tut's' here in the forums!). however, it would be nice to see this as a lib (hope to get to the point of being to create those myself within six to twelve months) or innate to P.B. *thumbs up*

Posted: Fri Jun 17, 2005 10:23 am
by GreenGiant
I agree, this would be something nice, especially if it was cross-platform.

Posted: Wed Jun 22, 2005 12:03 pm
by naw
Fred, Could this be considered for PB4?

I know it is possible through APIs, but Drag&Drop is pretty standard GUI facility in apps (ideally portable between Linux & Windows - but just on Windows would be good enough).

It would be a great usability enhancement to PB Apps.

Posted: Wed Jun 22, 2005 2:01 pm
by GeoTrail
Can't dissagre with that :) :D

Posted: Wed Jun 22, 2005 2:36 pm
by sec
i never see a app used this? any example?

Posted: Wed Jun 22, 2005 2:38 pm
by GeoTrail
Really? How about notepad? explorer, wordpad, winrar, winzip etc etc

Posted: Wed Jun 22, 2005 2:40 pm
by sec
GeoTrail wrote:Really? How about notepad? explorer, wordpad, winrar, winzip etc etc
notepad? how did you enable this feature? demo?

Posted: Wed Jun 22, 2005 2:44 pm
by GeoTrail
Don't have notepad anymore, I replaced it with Context but I'm pretty sure it supports drag and drop too. Open it up and drag and drop a text file in the window. think it should work.

Posted: Wed Jun 22, 2005 2:47 pm
by sec
GeoTrail wrote:Don't have notepad anymore, I replaced it with Context but I'm pretty sure it supports drag and drop too. Open it up and drag and drop a text file in the window. think it should work.
So are you talking about drag and drop filename (text file)?

Posted: Wed Jun 22, 2005 2:49 pm
by GeoTrail
Is that what happens?
Anyways, it's still drag'n drop ;)

Posted: Wed Jun 22, 2005 2:57 pm
by sec
GeoTrail wrote:Is that what happens?
Anyways, it's still drag'n drop ;)
I think you and not me are off topic though :wink:

Posted: Wed Jun 22, 2005 2:57 pm
by Polo
GeoTrail wrote:Is that what happens?
Anyways, it's still drag'n drop ;)
No, it of course open the text file ;)