Thema: Leanback

Einzelnen Beitrag anzeigen

Rollo62

Registriert seit: 15. Mär 2007
3.908 Beiträge
 
Delphi 12 Athens
 
#7

AW: Leanback

  Alt 29. Aug 2019, 07:27
Hallo Peter,

bin icht ganz sicher was genau Du erreichen willst.
Aber das Scrollen bekomment man durch die InteractiveGestures aktiviert.
Im HorizScrollBox Object-Inspektor unter Touch\InteractiveGestures\Zoom diese Checkbox setzen.

Dann kann man den Eventhandler hinzufügen, z.B. so

Delphi-Quellcode:

procedure TForm3.HorzScrollBox1Gesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean);
var
    LScrollBox: TCustomScrollBox;
    LScaleNew: Single;
begin

   if not (Sender is TCustomScrollBox) then
       Exit;

   if EventInfo.GestureID = igiZoom then
   begin
      LScrollBox := Sender as TCustomScrollBox;

      if not(TInteractiveGestureFlag.gfBegin in EventInfo.Flags) then
      begin
        LScaleNew := ( (LScrollBox.ClientWidth + EventInfo.Distance - FLastDIstance) /
                        LScrollBox.ClientWidth);

        LScrollBox.Scale.X := LScrollBox.Scale.X * LScaleNew;
        LScrollBox.RealignContent;

      end;

      FLastDIstance := EventInfo.Distance;
    end;

end;
  Mit Zitat antworten Zitat