Forum > Designer

Strange effect with form DockedFormEditor

(1/3) > >>

I assume it is DockedFormEditor because I started using it a month ago and I am experiencing this strange effect since about a month ago.

I cannot test without DockedFormEditor because since I made the step towards a docked IDE I cannot ever work without it again. The bug requires me to work a few hours until it appears.

The issue is very hard to pinpoint, on some days it won't happen at all and sometimes it happens on every save of the form.

The issue is it occasionally inserts completely wrong (usually much too small) values for ClientWidth and ClientHeight into the lfm. The effect is that controls that are anchored at the bottom or right will be cut of at the bottom and the right. It looks as if someone took a pair of scissors and cut a few centimeters off of the form on the right and on the bottom.

--- Code: ---object FMain: TFMain
  Left = 372
  Height = 611
  Top = 240
  Width = 1092
  Caption = 'XECRO Inductive Calibrator'
  ClientHeight = 251                      // <-- here
  ClientWidth = 412                       // <-- here
  Constraints.MinHeight = 600
  Constraints.MinWidth = 1000
  DesignTimePPI = 92


--- End code ---

Above is an example of how it looks after it happened. The form should be 1092 x 611 and normally the same values should be in ClientWidth and ClientHeight but occasionally (not always and not with all forms!) when I save the form after I made an unrelated change to some property it will insert these wrong values.

I close the IDE, reset the messed up lfm contents from my version control and restart the IDE, try the same edit in the same form and it happens again.

I close the IDE, I close a lot of editor tabs and other forms and then the problem is gone for the rest of the day.

I open all the other forms again and the problem does not reappear again for the rest of the day.

The next day suddenly it starts happening again.

I have not yet filed a bug because I cannot come up with a set of steps to reproduce it.

Did anbody else observe similar probelms?

One thing I have also noticed:

The Property LCLVersion keeps appearing and disappearing in the .lfm file at random times. I always notice it when it pops up as change in my git commit tool. This has been going on for weeks now.

I know that the DockedFormEditor does NOT write LCLVersion into the file while the built in form editor does. But I also know for sure that I did not ever use an undocked IDE anymore for at least 4 weeks!

Today I noticed that the problem seems to be strongly correlated to the LCLVersion effect, and I also suspec the "save all with i18n" has some connection with it:

* I made a few changes in the resource strings of another unit (not a form) of my project: nothing bad happened. I committed the changed .pot file, no changes in the lfm.
* I made a few changes in the resourcestrings of the main form: the following happened:
  - The LCLVersion appeared in the .lfm (although i have docked form editor)
  - The ClientWidth/Height were corrupted again

* Clossed the form/unit and opened it again
* I made a small change and saved it again: LCLVersion disappeared, Clientsize correct again.

So to me it seems something (possibly to do with i18n) is triggering some code from the built-in form designer instead of their replacement from dockedformdesigner to save the form and that code gets some values wrong or misbehaves while dockedformdesigner is running.

DockedFormDesigner does not save LCLVersion to the .lfm file while built-in form designer does. So I can imediately see who has saved the form. 99% of the time there is no LCLVersion, so only DockedFormDesigner is running and saving my form (as it should be because this has been the only running IDE the whole day long), but under some circumstances suddenly the LCLVersion appears in the lfm and this is also exactly the time when the size mismatch happens!

Wow! Just now I noticed it just changed and corrupted the lfm of a form I had not opened or modified for more than a year (it is kind of a splash screen)! It also wrote the LCLVersion to the file.

It has to be the i18n thing!  Because the entire day I was only extracting resource strings and translating, occasional saving and recompiling, I made no other changes anywhere!

I missed this thread. Thank you for your hints. I'll have a look at this.

I can confirm, sometimes the LCLVersion is saved in the .lfm. Also sometimes, this info is removed. This is nothing special of DockedFormEditor but of IDE. It only happens more often with this package, as it always generates the designer of a form (also if you are just typing some letters in code and don't open tab "Form").

For your first problem, I need to know: Do you use a High-DPI-Environment? You can check this if you open a form. What is the entry of DesignTimePPI?


[0] Message Index

[#] Next page

Go to full version