Board index » cppbuilder » Drag and drop and click

Drag and drop and click


2006-06-01 12:13:44 PM
cppbuilder87
Hi,
I have a component of which I would like to drag and drop as well as double
click.
Within the constructor of a class inherited from TPanel, I have the
statement
DragMode = dmAutomatic;
With this statement, drag and drop works fine. But the Object does not
register click events. With this line rem'ed out, the click events all work,
but dragging and dropping is out of the question. I am quite happy with the
current functionallity of both the drag and drop and the click events, but
would like to use them both. The DragDrop and DragOver events for the
intended containers are pretty much stock standard affairs, so I will not
list them here. Is there a property that needs to be set to use both
together?
Thanks in advance,
David.
 
 

Re:Drag and drop and click

"David Bailey" < XXXX@XXXXX.COM >wrote in message
Quote
With this line rem'ed out, the click events all work, but
dragging and dropping is out of the question.
Set the DragMode to dmManual, and then use the OnMouseDown event to call the
component's BeginDrag() method with its Immediate parameter set to False.
This way, you can handle clicks and drags.
Gambit
 

Re:Drag and drop and click

David Bailey wrote:
Quote
Hi,

I have a component of which I would like to drag and drop as well as
double click.

Within the constructor of a class inherited from TPanel, I have the
statement

DragMode = dmAutomatic;

With this statement, drag and drop works fine. But the Object does
not register click events. With this line rem'ed out, the click
events all work, but dragging and dropping is out of the question. I
am quite happy with the current functionallity of both the drag and
drop and the click events, but would like to use them both. The
DragDrop and DragOver events for the intended containers are pretty
much stock standard affairs, so I will not list them here. Is there a
property that needs to be set to use both together?

Thanks in advance,

David.
Do not use the dmAutomatic mode for drag a drop instead override the
MouseDown procedure and in there call BeginDrag(False, 5).
Regards
Yannis.
--
 

{smallsort}

Re:Drag and drop and click

Thanks - worked a treat,
David
"Yannis" < XXXX@XXXXX.COM >wrote in message
David Bailey wrote:
Quote
Hi,

I have a component of which I would like to drag and drop as well as
double click.

Within the constructor of a class inherited from TPanel, I have the
statement

DragMode = dmAutomatic;

With this statement, drag and drop works fine. But the Object does
not register click events. With this line rem'ed out, the click
events all work, but dragging and dropping is out of the question. I
am quite happy with the current functionallity of both the drag and
drop and the click events, but would like to use them both. The
DragDrop and DragOver events for the intended containers are pretty
much stock standard affairs, so I will not list them here. Is there a
property that needs to be set to use both together?

Thanks in advance,

David.
Do not use the dmAutomatic mode for drag a drop instead override the
MouseDown procedure and in there call BeginDrag(False, 5).
Regards
Yannis.
--
 

Re:Drag and drop and click

Thanks - worked a treat,
David
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
"David Bailey" < XXXX@XXXXX.COM >wrote in message
Quote
With this line rem'ed out, the click events all work, but
dragging and dropping is out of the question.
Set the DragMode to dmManual, and then use the OnMouseDown event to call the
component's BeginDrag() method with its Immediate parameter set to False.
This way, you can handle clicks and drags.
Gambit