Forum > Designer

Form editor 'Lock' feature suggestion

(1/2) > >>

It often happens that someone works on a project at different PC's with different OS'es and/or different monitors. As a result of that *.lfm files get inadvertently changed, mostly top/left/width/height props, and  then file goes into version control with many many changes, probably unwanted.   


Wouldn't it be good for the form designer to have a 'Lock' feature and all automatic adjustments to be postponed until unlocked or just asked for confirmation for saving when only such (internal) modifications were made?

Or, more generally, to not allow any modifications until the form explicitly 'Unlocked'?

I know the issue is well beyond that, but IMHO such a feature will help people like me, which is aware of the problem but doesn't want to pollute the repo with unnecessary changes.



I strongly agree, however we also need to consider whether it locks/unlocks all forms/frames or if it happens individually (particular case: a form containing a frame can be usefully locked down even if the frame itself is editable).

However we also have to consider the support load: we're likely to see a lot of less-experienced users who don't realise that they've locked a form, and forum commenters who don't consider that possibility when dispensing advice.

An alternative would be a global setting which required confirmation of any form/frame change that didn't go via the object inspector, to prevent accidental moves or "corrections" applied by the LCL variant associated with a particular widgetset.


Personally I always check if the lfm has changed before committing.
If so, and the changes are "automatically" I revert the lfm (svn revert/git restore).



--- Quote from: Bart on July 03, 2022, 10:51:21 pm ---Personally I always check if the lfm has changed before committing.
If so, and the changes are "automatically" I revert the lfm (svn revert/git restore).


--- End quote ---
Same as I do. But it is an additional effort, sometimes a file just goes through inadvertently.

IMO feature is also helpful when you have finished with the layout work but you're clicking on controls to add event handlers or to change other non-layout properties. Then often happens that the control gets accidentally "nudged" by the mouse click.

I've spent last few hours browsing the Lazarus IDE sources. What I've found is that the form will not get "modified" just by internal PPI scaling, it must be additionally "touched" somehow, e.g. I often just move aside forms standing my way and obscuring other windows.   

Nevertheless, I think such a lock will be a nice feature. AFAIR Delphi7 has similar into the form editor context menu although it was limited.

Yes, it would be good to have a solution but, as Mark pointed out, it could end up causing more problems by complicating things.

If a lock just ignores changes, someone is bound to loose intentional changes, if the lock asks the "are you sure" on every change, it will drive me crazy. Almost as bad if it asks at every (auto) save before run.

I personally move a form out of the way a lot, the actual form position is set at run time (from my code) so does not matter. Would it be possible to have some properties locked and not some others ?  Does sound even less certain ....

Write form changes only at IDE exit ?  I always exit before committing to git but I am sure other people do not.  And that approach would make the compile a lot more complicated too, the compiler would need to look at hidden form files. No, sorry, too much trouble.

Maybe, the IDE could offer to revert a form file at exit, showing a summary of changes ?  Be better than what git diff shows ....



[0] Message Index

[#] Next page

Go to full version