FMXTSwipeTransitionEffectMousePoint,delphi

luca 11/9/2016 0

This example shows how to use the properties of a TSwipeTransitionEffect transition, so that the parent object of the transition starts peeling down from a corner chosen with the mouse. 1. To build and test this example, create a Multi-Device Application - Delphi, then add the next objects to the form: A TImage A TSwipeTransitionEffect 2. Add CornerPoint and MouseDown public fields of the TForm1 class. Add the following code to the OnMouseDown, OnMouseUp and OnMouseMove event handlers of the image:

Delphi
 TForm1 = class(TForm)
    .....
  public
    CornerPoint: TPointF;
    MouseDown: boolean;
    { Public declarations }
  end;
 
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Single);
begin
  MouseDown := true;
  CornerPoint := PointF(X, Y);
end;
 
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Single);
begin
  if (MouseDown) then
  begin
    SwipeTransitionEffect1.CornerPoint := CornerPoint;
    SwipeTransitionEffect1.MousePoint := PointF(X, Y);
  end;
end;
 
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Single);
begin
  MouseDown := False;
end; 

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments