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
 TImageEnMView AutoScrolling and Drag & Drop
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Dec 20 2014 :  11:30:11  Show Profile  Reply
I see that 5.2 TImageEnMView has new Interactive Gesture options and new Interactive Gestures and new Tablet Options properties but they do not appear to be documented anywhere. Is it possible to provide some documentation for these new properties? At least some minor documentation is required even if these are standard vcl properties so that the effects of each can be understood as it pertains to ImageEn.

The reason why I ask is I have a TImageEnMView setup for drag and drop from TImageEnMView to a TImage and a TListBox and I have the pan gesture enabled. When I try to drag a thumbnail from the bottom of the list to either component the thumbnails pan or scroll. The auto-scrolling effect is visible the most when dragging a thumbnail from the bottom of the list towards the top. Auto-scrolling continues until the drop takes place. Can a message be posted to stop autoscrolling? If so what is the message that needs to be posted? If not, can ImageEnMView be modified to eliminate autoscrolling when ImageEnMView1.IEBeginDrag(True, -1) has been set?

How can I temporarily turn off the auto scrolling when dragging a thumbnail to another component so a thumbnail can be dragged without scrolling the list?

A small demo can be obtained here which demonstrates the auto scrolling:
attach/w2m/201412219405_DD.zip
115.81 KB

If we can get this working correctly, I'll post it as a free user demo, because I suspect others may need this feature.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

w2m

USA
1990 Posts

Posted - Dec 22 2014 :  13:48:50  Show Profile  Reply
I think I found the cause of the thumbnails scrolling until the thumbnails are dropped.

procedure TImageEnMView.IEEndDrag;
begin
  EndDrag(true);
  fDragging := false;
  TerminateDragScrollTimer;
end;

// End automatic scrolling when dragging completes
procedure TImageEnMView.TerminateDragScrollTimer;
begin
  if assigned(FDragScrollTimer) then
    FDragScrollTimer.Enabled := False;
end;

TerminateDragScrollTimer is not called until IEEndDrag is called.

IEEndDrag is not called in the application I am working with until the user responds to a question, so the thumbnails continue to scroll until the top of the list is reached or the user answers the question and IEEndDrag is called.

ImageEnView code should be changed call TerminateDragScrollTimer when the mouse or a touch drag leaves the component because IEEndDrag can not be called until the mouse or a finger (touch) is at best over the sender component. As a result, the thumbnails keep scrolling even after the mouse leaves TImageEnMView.

IEEndDrag can not be called in the ImageEnMView.OnMouseLeave event in the project because that will immediately stop the drop and no drop occurs.

In any event, the real source of the problem is that the thumbnails continue to scroll until IEEndDrag is called. The thumbnails should not scroll at all after the mouse or finger (Touch) leaves TImageEnMView.

There is no OnMouseLeave event that I can find in the source code, but if there was, it is possible that if TerminateDragScrollTimer was called in this internal event, the problem may be resolved.

I also found that if DragMode is set to dmAutomatic, thumbnails can not be selected at all!!!!

procedure TForm1.DragMode1Click(Sender: TObject);
begin
  if DragMode1.Checked then
  begin
    ImageEnMView1.DragMode := dmAutomatic;
    DragMode1.Caption := 'Manual';
    This prevents selecting any thumbnail at all.
  end
  else
  begin
    ImageEnMView1.DragMode := dmManual;
    DragMode1.Caption := 'Automatic';
  end;
end;

This has been driving me nuts for at least 2 days so I hope a fix can be implemented fairly quickly. A demo that demonstrates the autoscrolling and dmAutomatic problem can be downloaded here:
attach/w2m/20141222142257_ImageEnViewTouchDD.zip
120.38 KB
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39140 Posts

Posted - Dec 22 2014 :  21:56:31  Show Profile  Reply
Hi Bill

Please remember that you must use IEBeginDrag/IEEndDrag with TImageEnMView, so dragmode = dmAutomatic cannot be used.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

39140 Posts

Posted - Jan 01 2015 :  20:42:09  Show Profile  Reply
Happy new year, too

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jan 02 2015 :  06:55:21  Show Profile  Reply
DragMode is set to dmManual, but the thumbnails still scroll even after the mouse leaves TImageEnMView. There is something else wrong... I still think the TImageEnMView drag and drop code is incorrect per my previous post.

ImageEnView code should be changed call TerminateDragScrollTimer when the mouse or a touch drag leaves the component because IEEndDrag can not be called until the mouse or a finger (touch) is at best over the sender component. As a result, the thumbnails keep scrolling even after the mouse leaves TImageEnMView.

IEBeginDrag is called in TImageEnMouseMove and IEEndDrag is executed in Image1DragDrop. TerminateDragScrollTimer is not called until IEEndDrag is called so the thumbnails autoscroll even though the mouse has left TImageEnMView.

In my copy of TImageEnMView source I moved TerminateDragScrollTimer to public then call TerminateDragScrollTimer in OnMouseLeave event in the app. Once I made this simple change the drag and drop occurs and the thumbnails are no longer scrolled.

Can you get the demo to drag a thumbnail from the bottom of the list to the trash and not have the thumbnails scroll while doing so?


I suggest that you change the TImageEnMView code so that TerminateDragScrollTimer is called at the component level when the mouse leaves the component.

Bill Miller
[b]Adirondack Software & Graphics

Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39140 Posts

Posted - Jan 05 2015 :  22:50:58  Show Profile  Reply
Hi Bill

You're correct. I have pushed a fix to the git rep.


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