Attachment: LockedTaskSaveLoad.zip (small VCL demo, only TMS FNC Gantt Chart needed)
Delphi 13.1 Florence, VCL, TMS FNC Gantt Chart 1.3.3.10.
A quick question about Locked in combination with task dependencies - I'm not sure whether this is intended.
The attached demo creates two tasks (Mon–Fri work days, whWorkDaysOnly): A starts on Mon 2026-11-02 with 5 work days, B has 5 work days and a finish-to-start dependency on A. Press "Run all steps" (or the three buttons one by one); the memo logs the dates after every step:
| Step | B shown (ScheduledStart → ScheduledEnd) | B.PlannedStart | B.Locked |
|---|---|---|---|
| Start | Mon 2026-11-09 → Sat 2026-11-14 | Sat 2026-11-07 | False |
| 1. Lock B | Mon 2026-11-09 → Sat 2026-11-14 | Sat 2026-11-07 | True |
| 2. Extend A from 5 to 8 work days | Mon 2026-11-09 → Sat 2026-11-14 | Thu 2026-11-12 | True |
3. SaveTasksToJSONStream + LoadTasksFromJSONStream |
Thu 2026-11-12 → Thu 2026-11-19 | Thu 2026-11-12 | True |
So after step 2, B stays where it is on screen — as expected for a locked task — but its PlannedStart has already moved. After saving and loading, B shows the moved dates while it is still locked.
What we found in the sources (VCL.TMSFNCGanttClasses.pas, 1.3.3.10):
CalculateTaskTimesmovesFPlannedStartto the dependency date without checkingFLocked(lines 2597–2600).- For a locked task the displayed dates come from
FTempSchedStart/FTempSchedEnd, whichClearTemporaryValuesdeliberately keeps (lines 2649–2656). That is why B stays in place on screen. SaveToJSONwritesPlannedStart(line 5343) — the value that has already been moved — and loading does not restore the scheduled dates. After loading, the moved value becomes visible.
The documentation of Locked says "Prevents interactive or programmatic schedule changes when True" ( TTMSFNCGanttTask.Locked Property – TMS FNC Gantt Chart | TMS Software Documentation ), so we would expect B to keep its dates through save and load.
Question: Is this the intended behavior? If not, would skipping the dependency adjustment of FPlannedStart in CalculateTaskTimes for locked tasks be the right place? The fields involved are private, so we can't work around it cleanly from the outside.
FMX and WEB sources are identical at these lines.
Thanks a lot for having a look!
LockedTaskSaveLoad.zip (5.5 KB)