Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi like drag & drop

Posted on 2004-04-05
10
Medium Priority
?
466 Views
Last Modified: 2010-04-16
Hi,

I would like to make drag & drop work in my app  the same way as in the Delphi IDE:  It  displays a  transparent rectangle which has the size of dragged object, instead of moving the object itself.

Any help is appreciated.

Regards,
CC
0
Comment
Question by:cc042297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
10 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10760924
We can give you a better answer, if we knew, First, what are you dragging, second, from what, to what?

Shane
0
 

Author Comment

by:cc042297
ID: 10761332
Hi Shane,

It could be anything on the form, a control, a picture, which needs to be draged at runtime. The question is not really about drag & drop mechanism, but about showing a semitransparent dragimage (with the size of the draged object). There is a "Jedi" control which can be moved and resized on the screen at runtime, but it simply moves the control while it is dragged. Because of this it blinks and leaves "footprints"  behind.
0
 
LVL 46

Assisted Solution

by:aikimark
aikimark earned 400 total points
ID: 10766924
1. There's a decent Raize component that may help you during Drop operations.
2. If the dragging takes place from an application in another application, you have more limited options over the drag shape.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Accepted Solution

by:
shaneholmes earned 800 total points
ID: 10767061
This is a tough one...

You will need to decend from the TDragObject and override its methods.

{Search Google for examples on decending from TObject}

You will then need to use the TImageList's SetDragImage, ShowDragImage, HideDragImage methods.

However, the image part is tricky, cause the image (changes) is dynamic and  dependent on the object you are moving, therefore, you wont know the image until then.

You could get s screen capture of that particular region (the object your moving), and invert (colors) it, and use that as the drag image.


Shane
0
 
LVL 46

Expert Comment

by:aikimark
ID: 10767275
correction:

2. If the dragging takes place from another application, you have limited options over the drag shape.

0
 
LVL 46

Expert Comment

by:aikimark
ID: 10855709
CC,
Are you still with us?
0
 

Author Comment

by:cc042297
ID: 10878743
aikimark

Thanx for reminding me! :)

I tried to do it Shane's way. Spent some time on learning how Delphi handles drag and drop. If  I'm not mistaken there is a problem with it. But I’m not sure yet. I didn't want to say anything till I'm not certain.  Right now I have other things to do, but I will be back as soon as I can. :)

Regards,
CC
0
 

Author Comment

by:cc042297
ID: 13193487
Well, after checking all avaible Delphi sources I have come to conclusion that it is not possible to dot it by using D&D offered by  Delphi & Windows. The code which displays the Drag image is in Windows and there is no way I can make it work the way I wanted. At least I did not find any. So finally I have built my own Drag&Drop from the bottom. Took me much less time then what I had previously spent on trying to do it the Delphi & Windows way.

I still appreciate your help, so the points will be splitted.

Thanx, CC.
0
 

Author Comment

by:cc042297
ID: 13193636
I have come to conclusion -> I have come to the conclusion :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question