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
 TImageEnMView Touch Drag and Touch Panning

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 - Jun 26 2015 : 14:46:57
Nigel,

I am going crazy again over dragging a thumbnail from TImageEnMView to TImageEnVect when TImageEnMView.Gestures.Pan.Enabled := True with touch.

If panning is enabled there is no drag. I have DragMode set to manual. If you disable panning the touch drag functions. Here is my code. I think this needs to be improved a little more or I am forgetting something.

Maybe when IEBeginDrag is called the panning should be turned off and restored after a drop...

As it stands, you can either have panning without touch drag and drop or touch drag and drop without panning. Drag and drop in combination with panning functions as you would expect with the mouse.

procedure TForm1.FormCreate(Sender: TObject);
{ Initialize. }
begin
  ImageEnMView1.Gestures.Pan.Enabled := True;
  ImageEnMView1.DragMode := dmManual;
end;

procedure TForm1.ImageEnMView1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
{ Start the drag. }
begin
  ImageEnMView1.Cursor := crDrag;
  ImageEnMView1.IEBeginDrag(True);
end;

procedure TForm1.ImageEnVect1DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
{ Accept images dropped from TImageEnMView. }
begin
  if Source is TImageEnMView then
    Accept := True;
end;

procedure TForm1.ImageEnVect1DragDrop(Sender, Source: TObject; X, Y: Integer);
{ Respond to Drag and Drop. }
begin
  { Drop an object into a layer }
  if Source is TImageEnMView then
  begin
  end;
end;




Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 01 2015 : 23:25:20
Hi Bill

I'll get Fabrizio to take a look at it.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jun 30 2015 : 07:22:30
Yes I modified both instances. You can not enable panning in OnEndDrag because the event is executed when you touch a thumbnail. So as a result when OnMouseDown turns off panning, OnEndDrag turns it immediately back on.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Jun 29 2015 : 22:18:12
Hi Bill

Are you sure you changed both instances of:

if fGestures.Enabled and IEHasGestures() then


Otherwise you can also re-enable Gestures.Pan in the EndDrag event.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jun 29 2015 : 15:11:36
I changed the code as you suggested and found the touch drag still did not work. When you try to drag, the component is still in pan mode so when you drag, the component tries to pan rather than allowing dragging... So I added some brute force:
procedure TForm1.ImageEnVect1DragDrop(Sender, Source: TObject; X, Y: Integer);
{ Respond to ImageEnVect Drag and Drop. }
begin
  ...
  ImageEnMView1.Gestures.Pan.Enabled := True;
  ...
end;

procedure TForm1.ImageEnMView1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
{ Start the drag. }
begin
  ...
  ImageEnMView1.IEBeginDrag(True);
  ImageEnMView1.Gestures.Pan.Enabled := False;
  ...
end;

This code in combination with the code change improved touch dragging so at least touch drag and drop works. I think this makes it work better but not perfect yet. Unfortunately if you start a drag but do not drop the object, panning remains turned off. Any ideas on how to turn panning on if the drop does not occur? Maybe Fabrizio can look at our discussion here and see what he thinks. Maybe there is a way in the components code to turn off panning when dragging and then restore panning on a drop.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Jun 28 2015 : 22:37:12
Hi Bill

When would panning occur if IEBeginDrag is called on mouse down?

In TImageEnMView.WMGestureNotify() and TImageEnMView.WMGesture() try changing:

  if fGestures.Enabled and IEHasGestures() then

To:

  if fGestures.Enabled and IEHasGestures() and ( not fDragging ) then


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jun 28 2015 : 15:14:23
I have no idea how explorer does it, but maybe when IEBeginDrag is called the panning should be turned off and restored after a drop if Gestures.Pan.Enabled is true ...

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Jun 28 2015 : 15:05:22
Hi Bill

I think the main issue here is how should ImageEn determine whether a drag is a Pan or the initiation of a drag drop? How does Explorer differentiate?


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