how to drop on another object ?

General TRichView support forum. Please post your questions here
Post Reply
Stef
Posts: 90
Joined: Mon Aug 29, 2005 9:56 am
Contact:

how to drop on another object ?

Post by Stef »

Is it possible to drop contents on some other wincontrol,
after which some call to an RVE procedure will insert the contents in the RVE.

I'm not an expert, but I think this implies a OLE drop ??

The idea behind this function is as follows:
- I minimize the program, which contains the RVE
- I create a transparent absolutely stay-on-top form,
- now you can drop content from other applications on the transparent form
- after dropping a number of contents parts on the transparent form, we can normalize the main program and you can edit the dropped contents

Until now I use Melanders drop utility. But by now the drop facilities in RVE supports much more formats, so I like to move.

The transparent form, contains some hot pictures, where the mouse position determines the drop target. So placing an RVE on the transparent form is not a real option.

thanks,
Stef Mientki
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, you need to use OLE drag&drop.
It requires a lot of work to create a drop target for all formats supported by TRichViewEdit.

Unfortunately a class which TRichViewEdit uses for handling IDropTarget cannot be attached to arbitrary component. It may be attached only to component inherited from TRVScroll (ancestor of TRichView and TRichViewEdit).

The best way, I think, is creating a component inherited from TRVScroll (or TRichView) with some overriden methods related to OLE drop.
If you inherit it from TRVScroller, you can override its Paint method to draw any image you want.
If you inherit it from TRichView, you can use empty TRichView with background picture.
I can make an example, but I am not sure if this solution would be ok for you. I am not sure how do you want to use that hot pictures.
Stef
Posts: 90
Joined: Mon Aug 29, 2005 9:56 am
Contact:

Post by Stef »

thanks Sergey,

your suggestion, using the background image of RVE seems to be VERY GOOD one. In the onOleDragOver, I test the coordinates of the mouse and switch the background image according. This gives a very nice "hot" image replacement.

Now I've got one small problem,
when I implement onOleDragEnter (which I need to decrease the transparency), I get an error message "undeclared Identifier" on IDataObject.

What do I forget ?

Stef Mientki
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Include ActiveX unit in uses
Stef
Posts: 90
Joined: Mon Aug 29, 2005 9:56 am
Contact:

Post by Stef »

Thanks very much Sergey.
Post Reply