Einzelnen Beitrag anzeigen

QuickAndDirty

Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
1.884 Beiträge
 
Delphi 12 Athens
 
#3

AW: Für FMX TGrid OnTopLeftChanged nachempfinden?

  Alt 17. Okt 2018, 17:08
OK, SetTopLeft ändert ja auch ViewPortPosition.

Allerdings hat TGrid OnViewPortpositionChange nicht published... ich suche es mal
Delphi-Quellcode:
procedure TStyledGrid.SetTopLeft(const ACol, ARow: Integer);
var
  R: TRect;
  LCol, LRow: Integer;
begin
  if ((ACol >= 0) or (ARow >= 0)) and (ACol < Model.ColumnCount) and (ARow < Model.RowCount) then
  begin
    LCol := Max(0, ACol);
    LRow := Max(0, ARow);
    R := CellRect(LCol, LRow);
    AniCalculations.BeginUpdate;
    try
      if not AniCalculations.Down then
        AniCalculations.MouseDown(0, 0);
      AniCalculations.MouseLeave;
      if ACol < 0 then
        ViewportPosition := TPointF.Create(ViewportPosition.X, R.Top)
      else if ARow < 0 then
        ViewportPosition := TPointF.Create(R.Left, ViewportPosition.Y)
      else
        ViewportPosition := TPointF.Create(R.Left, R.Top);
    finally
      AniCalculations.EndUpdate;
    end;
    AniCalculations.UpdatePosImmediately(True);
  end;
end;
Andreas
Monads? Wtf are Monads?

Geändert von QuickAndDirty (17. Okt 2018 um 17:10 Uhr)
  Mit Zitat antworten Zitat