| View previous topic :: View next topic |
| Author |
Message |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Sun Sep 18, 2005 2:20 pm Post subject: [Demo] Indirect drag&drop |
|
|
Source code:
http://www.trichview.com/support/files/dropview.zip
Compiled (+ support for PNG and GIF)
http://www.trichview.com/support/files/dropview-exe.zip
This demo creates a semitransparent window at the bottom right corner of the screen. The user can drop the dragged data into this window.
The demo opens a viewer window for the dropped data.
The following formats are supported:
- RVF
- RTF
- Hyperlink
- Unicode text
- Text
- Bitmap
- Metafile
- Files (RVF, RTF, text, image)
This demo contains a new component, inherited from TRichView: TRichViewTarget. It accepts the dropped data and loads it in another TRichView or TRichViewEdit (specified in its Receiver property).
(2008-Dec-9: updated for compatibility with TRichView 11 and Delphi 2009)
Last edited by Sergey Tkachenko on Tue Dec 09, 2008 6:22 pm; edited 1 time in total |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Mon Sep 19, 2005 2:05 pm Post subject: |
|
|
Updated.
New event: OnOleDragOver - allows to choose areas where user can drop data
New event: OnOleDropNotAccepted - called after OnOleBeforeDrop if the dropped data are not accepted (for example, dropping files of unknown formats)
Improved: In OnOleBeforeDrop you can disallow dropping (basing on the cursor coordinates) |
|
| Back to top |
|
 |
Stef
Joined: 29 Aug 2005 Posts: 92
|
Posted: Mon Sep 19, 2005 2:24 pm Post subject: |
|
|
many many thanks,
I'll hope I find some time late this evening to test it.
cheers, |
|
| Back to top |
|
 |
Stef
Joined: 29 Aug 2005 Posts: 92
|
Posted: Tue Sep 20, 2005 8:13 pm Post subject: |
|
|
Yes, it indeed works great, THANKS AGAIN !!
I've send you a demo (hope the attached file will be accepted),
showing the multidrop target I wanted to build.
cheers, |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
|
| Back to top |
|
 |
Stef
Joined: 29 Aug 2005 Posts: 92
|
Posted: Sat Sep 24, 2005 10:14 pm Post subject: |
|
|
Evaluating some tools for creating demo animations,
I made an animation of how I use the droptarget.
The RVE droptarget has a dynamic background picture,
that changes with the mouse position and indicates the different drop locations.
You can see an animated shockwave demo here (2.5 MB):
http://oase.uci.kun.nl/~mientki/pic/jalcc/animations/minimized_dragdrop2.swf.html
have fun, |
|
| Back to top |
|
 |
Also Sergey
Joined: 22 Jun 2006 Posts: 2
|
Posted: Fri Jun 23, 2006 3:40 am Post subject: |
|
|
When i drop some GIF files to your demo (http://www.trichview.com/support/files/dropview-exe.zip), they displayed wrong - after some frames "artefacts" (frame parts) remain.
for example try drop to your demo this image - (http://forum.qip.ru/images/smilies/beee.gif)
or (http://forum.qip.ru/images/smilies/fool.gif)
I use TJvGIFImage (+ TRVJvGifAnimate is uses clause).
How can i fix this? |
|
| Back to top |
|
 |
Also Sergey
Joined: 22 Jun 2006 Posts: 2
|
Posted: Fri Jun 23, 2006 5:15 am Post subject: |
|
|
I have commented some code within MakeBitmap (RVJvGifAnimate.pas) and it works fine, but I want hear the right solution, please
| Code: |
procedure MakeBitmap(FrameIndex: Integer);
var r: TRect;
begin
// here was removed code for non first frames
if bmpsrc<>nil then
bmp.Assign(bmpsrc)
else begin
bmp.Canvas.Brush.Color := FBackColor;
bmp.Canvas.FillRect(Rect(0,0,bmp.Width,bmp.Height));
end;
r := ScaleRect(Rect(0, 0, item.GetImageWidth(nil), item.GetImageHeight(nil)), FrameIndex);
gif.Frames[FrameIndex].Draw(bmp.Canvas, r, gif.Transparent);
end;
|
|
|
| Back to top |
|
 |
|