somewhere in this code:
smCellScrolling:
begin
while (rvs + totalh > vss + ch) do
begin
vs := vs + 1;
cl := MakeCell(ACell.Col, Round(vs));
rs := 1;
if rs > 0 then
toth := RowPositions[cl.Row + rs - 1] - RowPositions[cl.Row]
else
begin
rs := 1;
toth := RowHeights[cl.Row];
end;
vs := vs + rs - 1;
vss := vss + toth;
end;
end;
Can you please put up a sample that demonstrates this? or a code snippet?
This code, it loops when the calculation leads to navigating to the bottom row n(vertical orienntation, cell scrollmode)
procedure TfrmPlannerUI.MakeItemVisible(const AItem: TTMSFNCPlannerItem);
var
units : integer;
firstTime,
lastTime,
startTimeInView,
endTimeInView : TDateTime;
cell : TTMSFNCPlannerCell;
begin
if not AutoFitAppointments then
begin
case TimeInterval of
THPTimeInterval.Unknown: ;
THPTimeInterval.FiftheenMinutes: units := 15;
THPTimeInterval.FiveMinutes: units := 5;
end;
firstTime := IncMinute(DateOf(SelectedDate), trunc(planUI.TimeLine.DisplayStart*units));
lastTime := IncMinute(DateOf(SelectedDate), trunc(planUI.TimeLine.DisplayEnd*units));
startTimeInView := IncMinute(DateOf(SelectedDate), trunc((planUI.TimeLine.DisplayStart+planUI.VerticalScrollBar.ValueRange.Value)*units));
endTimeInView := IncMinute(startTimeInView, trunc(planUI.VerticalScrollBar.ViewportSize*units));
cell.Col := -1;
cell.Row := -1;
if (IncMinute(AItem.EndTime, 5)>=endTimeInView) then
cell := planUI.DateTimeToCell(Min(lasttime, IncMinute(AItem.EndTime, 15)));
if (IncMinute(AItem.StartTime, -5)<=startTimeInView) then
cell := planUI.DateTimeToCell(Max(firstTime, IncMinute(AItem.starttime, -15)));
if (cell.Col>-1) and (cell.Row>-1) then
planUI.Navigate(cell, False);
end;
end;
We have investigated this here but couldn't reproduce this here. I suppose this happens under certain circumstances. I suppose the code snippet is part of a bigger project, but to fully understand the scope and the reason why this happens, I will need a sample. Please try to recreate it so we can see which settings are used and why it happens.