ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 OnMouseMove may prevent OnImageSelect

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
JimMellish Posted - Aug 25 2017 : 04:13:30
I have found that OnImageSelect may not fire if OnMouseMove is being used for drag and drop and the selected image is changed using the mouse.

I have a form with only a TImageEnMView on it and the following code:

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnMView.FillFromDirectory('F:\Photographs\Digital\A40');
end;

procedure TForm1.ImageEnMViewMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if ssLeft in Shift then
    begin
      ImageEnMView.MouseInteract := [];
      ImageEnMView.IEBeginDrag (True, -1);
    end;
end;

procedure TForm1.ImageEnMViewImageSelect(Sender: TObject; idx: Integer);
begin
  CodeSite.Send ('OnImageSelect');
end;

end.


If I only use the mouse, I can only click on five or six different thumbnails before the selected thumbnail stops updating (the blue border indicating the selected image stops changing) and OnImageSelect stops firing.

I am using Windows 10, Delphi 10.1 Berlin Update 2 and ImageEn 7.0

Jim
2   L A T E S T    R E P L I E S    (Newest First)
JimMellish Posted - Sep 06 2017 : 05:59:31
Hi,

That has solved my problem.

When I was clicking on the individual images in the ImageEnMView I was doing it so fast that sometimes I started a drag drop operation without realising.

Also, I was calling IEEndDrag etc in the OnDragDrop event of another component, so if I dropped on this other component everything worked ok.

AS you suggested, I have moved the IEEndDrag etc to the OnEndDrag event of ImageEnMView so the dragging is terminated correctly in all cases.

Thanks, Jim

xequte Posted - Sep 01 2017 : 20:04:16
Hi Jim

IEBeginDrag is being called, but you do not call IEEndDrag, so the control still thinks it is dragging.

Please add the event:

procedure TForm1.ImageEnMView1EndDrag(Sender, Target: TObject; X, Y: Integer);
begin
  ImageEnMView1.IEEndDrag;
  ImageEnMView1.MouseInteract := [mmiSelect];
  ImageEnMView1.Paint;
end;

You might also want to try the demo \Demos\DragDrop\MultiView2\

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com