Board index » delphi » Non acceptance vs cancelling of Drag and Drop

Non acceptance vs cancelling of Drag and Drop

Dear All,

I am trying to emulate Excels Toolbar Customisation where the user can
drag a button off of a toolbar. In order to do this I need to be able
to discriminate between the user pressing the escape key to cancel the
drag and the mouse button being lifted with no controls having
accepting the drag. The end drag parameters are the same for either
means of terminating a drag.

Any ideas ?

Regards,

David Gottschalk

 

Re:Non acceptance vs cancelling of Drag and Drop


In article <3a41657f.2786...@newsgroups.borland.com>, David Gottschalk
wrote:

Quote
> I am trying to emulate Excels Toolbar Customisation where the user can
> drag a button off of a toolbar. In order to do this I need to be able
> to discriminate between the user pressing the escape key to cancel the
> drag and the mouse button being lifted with no controls having
> accepting the drag. The end drag parameters are the same for either
> means of terminating a drag.

> Any ideas ?

Test for GetKeyState( VK_LBUTTON ) < 0. I suspect it will return true if
the drag was canceled via Esc since the mouse button is still down and
false if the user released the mouse button. Just a guess, no
warranties!

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: Till Feb.2001 i will only visit the groups on weekends, so  be
patient if i don't reply immediately.

Re:Non acceptance vs cancelling of Drag and Drop


Peter,

Many thanks, it works well. You should tell the guys at Borland as I
see that they don't differentiate with their toolbar customisation
dragging.

Regards,

David Gottschalk

On Thu, 21 Dec 2000 19:31:05 +0100, "Peter Below (TeamB)"

Quote
<100113.1...@compuXXserve.com> wrote:
>In article <3a41657f.2786...@newsgroups.borland.com>, David Gottschalk
>wrote:
>> I am trying to emulate Excels Toolbar Customisation where the user can
>> drag a button off of a toolbar. In order to do this I need to be able
>> to discriminate between the user pressing the escape key to cancel the
>> drag and the mouse button being lifted with no controls having
>> accepting the drag. The end drag parameters are the same for either
>> means of terminating a drag.

>> Any ideas ?

>Test for GetKeyState( VK_LBUTTON ) < 0. I suspect it will return true if
>the drag was canceled via Esc since the mouse button is still down and
>false if the user released the mouse button. Just a guess, no
>warranties!

>Peter Below (TeamB)  100113.1...@compuserve.com)
>No e-mail responses, please, unless explicitly requested!
>Note: Till Feb.2001 i will only visit the groups on weekends, so  be
>patient if i don't reply immediately.

Other Threads