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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Detect Double-Click on Thumbnail in ImageEnView?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

982 Posts

Posted - Dec 22 2022 :  09:21:07  Show Profile  Reply
There is no OnThumbnailDblClick event in ImageEnView!

I cannot use the OnDblClick event because the behavior of double-clicking is different when EnableMultiSelect = True and multiple thumbnails are selected:

1. When double-clicking on a THUMBNAIL (selected or unselected), the multiple thumbnails are deselected, and the double-clicked thumbnail gets selected

2. When double-clicking on empty space, the multiple thumbnails remain selected and are NOT deselected

According to logic, this makes it necessary to detect a double-click on a thumbnail explicitly if I need to take action on a double-clicked thumbnail.

PeterPanino

982 Posts

Posted - Dec 22 2022 :  22:59:59  Show Profile  Reply
To differentiate between a double-click on a thumbnail and a double-click on white space in the ImageEnMView control, I tried the TImageEnMView.MouseDownThumbIndex information in the TImageEnMView.DblClick event-handler:

procedure TformMain.ImageEnMView1DblClick(Sender: TObject);
begin
  CodeSite.Send('ImageEnMView1.MouseDownThumbIndex', ImageEnMView1.MouseDownThumbIndex);
end;


This works ALMOST (!) correctly: However, when double-clicking WAY BELOW the last thumbnail row, MouseDownThumbIndex gets a positive result instead of -1!

https://app.screencast.com/SJyifkWakas1X
Go to Top of Page

xequte

39053 Posts

Posted - Dec 23 2022 :  17:12:10  Show Profile  Reply
Hi Peter

In the dblclick event get the current mouse position:

pt := ScreenToClient( Mouse.CursorPos );

Then use with ImageAtPos with CheckBounds = True:

http://www.imageen.com/help/TImageEnMView.ImageAtPos.html



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: