I'm trying to make a Slider in Delphi, but I keep getting errors:
Incompatible types 'TPoint' and 'TPointF'
Incompatible types 'Integer' and 'Single'
Incompatible types 'Integer' and 'Extended'
I don't know why I'm getting these errors.
procedure TForm1.FormTouch(Sender: TObject; const Touches: TTouches; const Action: TTouchAction);
var
T:TTouch;
F: TfmxObject;
M: TrectF;
L: TLine;
R: TRoundRect;
P: TPoint;
begin
for T in Touches do begin
case Action of
TTouchAction.down,
TTouchAction.Move:
for F in Children do
if F is Tlayout then begin
M := TLayout(F).AbsoluteRect;
M.Inflate(0, -10);
if M.Contains(T.Location) then begin
L := TLine(TLayout(F).Children[0]);
R := TRoundRect(L.Children[0]);
P := TLayout(F).AbsoluteToLocal(T.Location);
P.X := R.Position.X;
P.Y := P.Y - 10 - R.Height * 0.5;
R.Position.Point := P;
end;
end;
end;
end;
end;
Here is a screenshot:
