[Implemented] Drag n Drop

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

[Implemented] Drag n Drop

Post 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...
Ta - N
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Re: Drag n Drop

Post 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*
Intrigued - Registered PureBasic, lifetime updates user
GreenGiant
Enthusiast
Enthusiast
Posts: 252
Joined: Fri Feb 20, 2004 5:43 pm

Post by GreenGiant »

I agree, this would be something nice, especially if it was cross-platform.
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post 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.
Ta - N
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Can't dissagre with that :) :D
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

i never see a app used this? any example?
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Really? How about notepad? explorer, wordpad, winrar, winzip etc etc
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

GeoTrail wrote:Really? How about notepad? explorer, wordpad, winrar, winzip etc etc
notepad? how did you enable this feature? demo?
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post 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.
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post 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)?
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Is that what happens?
Anyways, it's still drag'n drop ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post 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:
Last edited by sec on Wed Jun 22, 2005 2:58 pm, edited 1 time in total.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

GeoTrail wrote:Is that what happens?
Anyways, it's still drag'n drop ;)
No, it of course open the text file ;)
Post Reply