trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Demo] Indirect drag&drop

 
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos
View previous topic :: View next topic  
Author Message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Sun Sep 18, 2005 2:20 pm    Post subject: [Demo] Indirect drag&drop Reply with quote

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
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Mon Sep 19, 2005 2:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Stef



Joined: 29 Aug 2005
Posts: 92

PostPosted: Mon Sep 19, 2005 2:24 pm    Post subject: Reply with quote

many many thanks,

I'll hope I find some time late this evening to test it.

cheers,
Back to top
View user's profile Send private message Visit poster's website
Stef



Joined: 29 Aug 2005
Posts: 92

PostPosted: Tue Sep 20, 2005 8:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6576

PostPosted: Fri Sep 23, 2005 5:04 pm    Post subject: Reply with quote

Stef, I uploaded your demo to http://www.trichview.com/support/files/thirdparty/DemoMultiDrop.zip
If you want, you can explain here which features it demonstates.
Back to top
View user's profile Send private message Visit poster's website
Stef



Joined: 29 Aug 2005
Posts: 92

PostPosted: Sat Sep 24, 2005 10:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Also Sergey



Joined: 22 Jun 2006
Posts: 2

PostPosted: Fri Jun 23, 2006 3:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Also Sergey



Joined: 22 Jun 2006
Posts: 2

PostPosted: Fri Jun 23, 2006 5:15 am    Post subject: Reply with quote

I have commented some code within MakeBitmap (RVJvGifAnimate.pas) and it works fine, but I want hear the right solution, please Smile

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group