Forum > Designer
Delphi to Lazarus Forms
cycle:
I have a legacy Delphi application that I want to convert to Lazarus. It is critical to some of our systems so I need to continue to support it. I have performed the conversion process and the application is now a Lazarus application. It uses Visual Forms Inheritance and that all seems to be working. The application compiles and runs as designed. There is one problem though. When I bring the main form up in the Lazarus Form Designer, all of the components on the form are not where they belong. Many of them are clumped together without proper spacing making them very hard to deal with. I need to add some additional components to the form but this situation makes that impossible. Is this a known issue with the Lazarus Form Designer? I am using Lazarus 2.2.6 on Windows 11. Both my Dell laptop and my Dell monitor are 4K with the laptop using 200% scale and the monitor using 125% scale. Any suggestions would be greatly appreciated.
JuhaManninen:
Designing with a scaled display can be tricky. I don't even know what is the recommended way to deal with it.
You should use anchors extensively. View -> Anchor Editor.
Anchor all components to each other and to form edges. It will also help when you compile your application for a different widgetset / OS. Window managers and widget libraries can have different border widths in their controls. Anchors ensure the layout looks good with them all.
BrunoK:
Question that come to mind (I suppose the answer is yes) did you specify Use LCL scaling + DPI awareness on in project options ?
Maybe you could post a simplified form (.pas+ .lfm) down form showing the problem here so one might take a look at what may happen.
wp:
To understand what's going on I wrote a simple project in Delphi 7, switched my Windows to a user which runs at 144ppi (150%, my normal resolution is 96ppi (100%)) and converted the Delphi project to Lazarus there. I noticed that the converter does not handle LCL scaling at all. This means that when I create an exe at the 144ppi resolution and run it at a 96ppi the application will not scale.
Therefore, I'd suggest to open the project options after the conversion and to check the boxes "Use LCLScaling" and "Use manifest resource" as well as to select one of the "on" settings in the "DPI awareness" combobox - this is the standard procedure how to create a high-dpi aware application. When I handle the application like this is scales correctly at the resolutions in my test.
JuhaManninen:
--- Quote from: wp on July 20, 2023, 12:57:13 pm ---... and to check the boxes "Use LCLScaling" and "Use manifest resource" as well as to select one of the "on" settings in the "DPI awareness" combobox - this is the standard procedure how to create a high-dpi aware application.
--- End quote ---
Should Delphi converter add those settings always for every project?
Then a question arises: When should those settings be off? Is there a situation where high-dpi awareness is not desired?
Navigation
[0] Message Index
[#] Next page