FMX.TSwipeTransitionEffect.MousePoint

From RAD Studio Code Examples
Jump to: navigation, search

Description

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:
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:

Code

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;

Uses

See Also