Recent

Author Topic: Delphi to Lazarus Forms  (Read 6340 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Delphi to Lazarus Forms
« Reply #15 on: July 27, 2023, 07:44:56 pm »
Apparently, the DesignTimePPI property in Lazarus for my form is set to 192.  If I try to change it, it gets reset back to 192.
Where do you change it? In Object Inspector?
The only way may be to edit the form's .lfm file. Close the project, edit it and then reopen the project.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

cycle

  • Newbie
  • Posts: 6
Re: Delphi to Lazarus Forms
« Reply #16 on: July 27, 2023, 09:28:04 pm »
I have tried changing it in the object inspector and in the dfm file but when I open the form editor, it changes it back to 192.  There has to be a way to get the Lazarus Form Designer to work but so far it just will not behave.  This is beyond frustrating.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Delphi to Lazarus Forms
« Reply #17 on: July 28, 2023, 02:40:53 pm »
I have tried changing it in the object inspector and in the dfm file but when I open the form editor, it changes it back to 192.
Did you have the project closed when editing the dfm file? Close Lazarus and use another text editor to be sure.
I can change DesignTimePPI in OI in my test project. I don't know what is going on there.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

wp

  • Hero Member
  • *****
  • Posts: 12456
Re: Delphi to Lazarus Forms
« Reply #18 on: July 28, 2023, 10:26:54 pm »
Okay, after much experimenting, I think I have found the problem.  Apparently, the DesignTimePPI property in Lazarus for my form is set to 192.  If I try to change it, it gets reset back to 192.  Regardless of what I do, Lazarus believes it should be 192.  Can someone tell me how to tell Lazarus to allow me to reset this value?
Seems like you are working on a machine with 192ppi. Whenever you save a form on this machine all dimensions are valid for 192ppi, and Lazarus MUST write the DesignTimePPI to be 192 - this is the unit of measurement, like centimeters, millimeters or inches. If you remove the DesignTimePPI and you open this form on the same machine the next time, the missing DesignTimePPI is interpreted as if the form were saved on a 96ppi machine. And therefore the IDE recalculates all dimensions found in the form, iow: when a control has a width of 100 px and is saved at 192ppi it will become twice as large when you remove the DesigntimePPI and reopen the form at 192ppi again.

If you don't want this automatic rescaling you should turn off the LCLScaling checkbox, or if only single form bothers you, you can also turn off its Scaled property. But don't blame anybody here that the size of the controls changes when you move to a monitor with a different resolution.

cycle

  • Newbie
  • Posts: 6
Re: Delphi to Lazarus Forms
« Reply #19 on: August 01, 2023, 09:31:43 pm »
The part I cannot get past is that if I open the form in Delphi, the Form Designer in the Delphi IDE scales everything properly.  I do not need to tell it anything about the form, the scaling, or the resolution.  It just works.  When I open it in Lazarus, Lazarus is unable to figure out how to properly display the form in the Lazarus Form Designer.  This seems like a huge deficiency.

Since I am new to Lazarus, I am willing to concede that I am doing something wrong in Lazarus, however, every suggestion that has been provided has proven ineffectual.  There has to be a way to make the Lazarus Form Designer work just like the Delphi Form Designer.  I cannot believe that what I am asking is impossible.  Basically, if someone can provide the "check this" and "uncheck that" and "assign this or that property value" cookbook recipe, I would be greatly appreciative.

 

TinyPortal © 2005-2018