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
 Scrolling TImageEnMView

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
w2m Posted - Sep 26 2014 : 07:28:22
I am attempting to auto scroll thumbnails when the mouse moves over the thumbnails. I have it working but the scrollbar does not scroll when the index changes so scrolling only works for visible images.

How can I auto scroll up and down and change the scrollbar position so I can auto scroll non visible thumbnails?

Here is the code I have so far but it only works for visible images:

procedure TThumbnailsForm.Collection1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
begin
{ Get the index of the thumbnail under the cursor }
  iIndex := ImageEnMView1.ImageAtPos(X, Y, True);
{ Scroll to next thumbnail }
if (ImageEnMView1.GetImageVisibility(iIndex + 1) = 0) and
  (iIndex < ImageEnMView1.ImageCount) then
     ImageEnMView1.SelectSeek(iskDown)
{ Scroll to previous thumbnail }
else if (ImageEnMView1.GetImageVisibility(iIndex + 1) = 0) and
   (iIndex >= ImageEnMView1.ImageCount-1) then
      ImageEnMView1.SelectSeek(iskUp);
end;

In this particular project the Gridwidth is -1 and multiselect is true.

I also tried iekLeft and ieRight in place of iekDown and iekUp to but that did not work either. I also tried ActionList1.ExecuteAction(ImageEnMViewSeekNext1); and ActionList1.ExecuteAction(ImageEnMViewSeekPrior1); instead but that fails as well. I also tried iIndex := ImageEnMView1.ImageAtPos(X, Y, False. I also tried just setting the SelectedImage and that does not scroll the list... but nothing works.

During testing with SelectSeek I found that when the mouse is over the image of the top of the visible list it scrolls to the top of the list rather than just scrolling to show the previous image. When the mouse is over the last visible image it scrolls to the bottom of the list rather than scrolling to the next image. When all images are visible it works perfectly.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 28 2014 : 23:44:56
Hi Bill

I think you would need to post a message to the window to delay the scrolling, otherwise there might be some clash with the code in MouseMove.

You can see the method that ImageEn uses to handle automatic scrolling (when drag selecting) by searching for IEM_AUTOSCROLL in iemview.pas.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Sep 26 2014 : 15:23:43

Hi Nigel,

Yes I have tried it with SelectedImageAlwaysVisible True and False.
It does not make any difference.

Actually what I am attempting to do is to scroll the list just like the pan gesture does but with the mouse rather than a gesture. As the thumbnails are panned, they are copied to a TImageEnView, so you have a slideshow of sorts.

In my example there are a lot of non visible thumbnails. The problem occurs when trying to pan the non visible thumbnails near the top or bottom of the visible thumbnails with the mouse.

When Sleep(150) is placed at the end of the procedure, visually it looks like the selection speed slows down as you would expect, but the vertical scrollbar position changes quicker than the selected image does, so in effect, that is why the images appear to be quickly selected and either appear move to the very top of the list when the cursor is near the top of the component or move to the very end of the list when the cursor is near the bottom of the component when there are a lot of non visible thumbnails above or below the cursor.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Sep 26 2014 : 13:15:10
Hi Bill

Please first confirm that:

SelectedImageAlwaysVisible = True;


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