How to "Freeze" TMS Diagram

TatDiagram is a great component.

I need to alternate between "editing" mode (user can move controls) and "frozen" mode when user will click controls to activate code.

I have tried using "Enabled" property. This works in terms of "freezing" but freezes too hard!

I cannot see any property on the TatDiagram which freezes/unfreezes all blocks and controls.

You can use something like this:

  for I := 0 to atDiagram.DControlCount - 1 do
    DControl := atDiagram.DControls[I];
    DControl.Restrictions := DCOntrol.Restrictions + [crNoMove,
      crNoResize, crNoRotation, crNoEdit, crNoDelete, crKeepRatio,
      {crNoClipboard, crNoSelect, } crNoRotCenterMove];

Thanks Wagner.

By the way, I am giving a presentation about TMS Diagram Control for the Delphi UK Users Group on Tuesday.

I really like the component, and am happy to promote it.

1 Like

Also, can I ask what is the use of the "DesignMode" of the diagram.

It seems like it might "lock" or "freeze" the diagram.

If this works it is much easier to implement, as some of my controls have differences in "Restrictions", however just using it as shown below does not freeze the diagram.

Diagram.DesignMode:= ddmEditable
Diagram.DesignMode:= ddmNonEditable

Awesome, whatever you want to share with us, let us know. We can try to spread the word in our social media channels and/or blog.

What happens, exactly? It should work.