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