Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-02

LCL High-DPI

12 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ondrej Pokorny

I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL.

It's quite easy for the programmer. Documented here: http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI in Lazarus 1.7 and above").

1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its windows should scale correctly.

2.) To make your own application use the new LCL scaling and to make sure your layouts don't get destroyed, do the following:

a.) Make sure you don't change the system DPI settings during the proccess. b.) Update the IDE to the latest trunk and rebuild it. c.) Open your project in the IDE.
d.) Enable LCL scaling for your application DPI awarness in Project Options -> Application -> "Use LCL scaling (Hi-DPI). e.) On Windows: enable DPI awarness in Project Options -> Application. Decide if you want to support per monitor DPI awarness or not. f.) Make sure TForm.Scaled=True for all your forms (default value). g.) Make sure you use TControl.ScaleCoord() or ScaleCoord96() to scale coordinates during the run-time.

And you are ready. Your forms will scale both in runtime and design time nicely.

For those who followed my last announcement: as Zeljko and Michael requested, I removed the LCLScaleForms define and introduced the Application.Scaled property instead (that you set in step 2d). The default value is Application.Scaled=False.

If you keep Application.Scaled=False, there won't be any changes in your application.

Please report issues or comment on problems. I have still time to change things until Lazarus 1.8 is out (you can expect RC1 in April).

Ondrej

Reply by email

Donald Ziesig
to Ondrej Pokorny: I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's…

Hi Ondrej!

Your work has made a major improvement in Lazarus. It is much more enjoyable to use. I have converted my most recent major APP using it and it was mostly straight forward.

I will continue using it and report back to you as my work permits.

Thank you,

Don Ziesig

Ondrej Pokorny wrote 41 lines
I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's quite easy for the programmer. Documented here: http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI in Lazarus 1.7 and above"). 1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its windows should scale correctly. 2.) To make your own application use the new LCL scaling and to make sure your layouts don't get destroyed, do the following: a.) Make sure you don't change the system DPI settings during the proccess. b.) Update the IDE to the latest trunk and rebuild it. c.) Open your project in the IDE. d.) Enable LCL scaling for your application DPI awarness in Project Options -> Application -> "Use LCL scaling (Hi-DPI). e.) On Windows: enable DPI awarness in Project Options -> Application. Decide if you want to support per monitor DPI awarness or not. f.) Make sure TForm.Scaled=True for all your forms (default value). g.) Make sure you use TControl.ScaleCoord() or ScaleCoord96() to scale coordinates during the run-time. And you are ready. Your forms will scale both in runtime and design time nicely. For those who followed my last announcement: as Zeljko and Michael requested, I removed the LCLScaleForms define and introduced the Application.Scaled property instead (that you set in step 2d). The default value is Application.Scaled=False. If you keep Application.Scaled=False, there won't be any changes in your application. Please report issues or comment on problems. I have still time to change things until Lazarus 1.8 is out (you can expect RC1 in April). Ondrej

Reply by email

Donald Ziesig
to Ondrej Pokorny: I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's…

Hi Ondrej!

I just ran into two issues with the IDE in High-DPI mode.

The IDE main window changed from yesterday (when I first used it) to today. Yesterday all of the Buttons were larger (but the internal images were still small). Today the Buttons have returned to their small sizes. The internal images are still small).

I don't know what caused the change.

The "Watch Properties" window is erroneously scaled for the font.

Thanks,

Don Ziesig

Ondrej Pokorny wrote 41 lines
I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's quite easy for the programmer. Documented here: http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI in Lazarus 1.7 and above"). 1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its windows should scale correctly. 2.) To make your own application use the new LCL scaling and to make sure your layouts don't get destroyed, do the following: a.) Make sure you don't change the system DPI settings during the proccess. b.) Update the IDE to the latest trunk and rebuild it. c.) Open your project in the IDE. d.) Enable LCL scaling for your application DPI awarness in Project Options -> Application -> "Use LCL scaling (Hi-DPI). e.) On Windows: enable DPI awarness in Project Options -> Application. Decide if you want to support per monitor DPI awarness or not. f.) Make sure TForm.Scaled=True for all your forms (default value). g.) Make sure you use TControl.ScaleCoord() or ScaleCoord96() to scale coordinates during the run-time. And you are ready. Your forms will scale both in runtime and design time nicely. For those who followed my last announcement: as Zeljko and Michael requested, I removed the LCLScaleForms define and introduced the Application.Scaled property instead (that you set in step 2d). The default value is Application.Scaled=False. If you keep Application.Scaled=False, there won't be any changes in your application. Please report issues or comment on problems. I have still time to change things until Lazarus 1.8 is out (you can expect RC1 in April). Ondrej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170221/f9d758d9/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot at 2017-02-21 12-52-52.png
Type: image/png
Size: 32517 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170221/f9d758d9/attachment-0002.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot at 2017-02-21 12-48-46.png
Type: image/png
Size: 50193 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170221/f9d758d9/attachment-0003.png>

Reply by email

Donald Ziesig
to Ondrej Pokorny: I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's…

One more question. Where can I find documentation for TControl.ScaleCoord() or ScaleCoord96()? It is not in the CCR. I will search the source.

Don

Ondrej Pokorny wrote 41 lines
I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's quite easy for the programmer. Documented here: http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI in Lazarus 1.7 and above"). 1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its windows should scale correctly. 2.) To make your own application use the new LCL scaling and to make sure your layouts don't get destroyed, do the following: a.) Make sure you don't change the system DPI settings during the proccess. b.) Update the IDE to the latest trunk and rebuild it. c.) Open your project in the IDE. d.) Enable LCL scaling for your application DPI awarness in Project Options -> Application -> "Use LCL scaling (Hi-DPI). e.) On Windows: enable DPI awarness in Project Options -> Application. Decide if you want to support per monitor DPI awarness or not. f.) Make sure TForm.Scaled=True for all your forms (default value). g.) Make sure you use TControl.ScaleCoord() or ScaleCoord96() to scale coordinates during the run-time. And you are ready. Your forms will scale both in runtime and design time nicely. For those who followed my last announcement: as Zeljko and Michael requested, I removed the LCLScaleForms define and introduced the Application.Scaled property instead (that you set in step 2d). The default value is Application.Scaled=False. If you keep Application.Scaled=False, there won't be any changes in your application. Please report issues or comment on problems. I have still time to change things until Lazarus 1.8 is out (you can expect RC1 in April). Ondrej

Reply by email

Ondrej Pokorny
to Donald Ziesig
Donald Ziesig wrote
One more question. Where can I find documentation for TControl.ScaleCoord() or ScaleCoord96()? It is not in the CCR. I will search the source.

The difference is in the scale basis:
ScaleCoord96: hard-coded 96.
ScaleCoord: DesignTimePPI (= the PPI of the IDE - be aware that it can change if you open your project on a different system with different DPI).

ScaleCoord96 is to use for hard-coded values in 96 PPI.

I'll document the functions in the CCR.

Ondrej

Reply by email

Ondrej Pokorny
to Donald Ziesig: Hi Ondrej! I just ran into two issues with the IDE in High-DPI mode. The IDE main window…

Strange, it looks good here (the latest revision): https://s17.postimg.org/9a9oa9cyn/Linux_120_DPI.png

I've been working on High DPI today so maybe it was broken at some point during the day (?)

Ondrej

Donald Ziesig wrote 21 lines
Hi Ondrej! I just ran into two issues with the IDE in High-DPI mode. The IDE main window changed from yesterday (when I first used it) to today. Yesterday all of the Buttons were larger (but the internal images were still small). Today the Buttons have returned to their small sizes. The internal images are still small). I don't know what caused the change. The "Watch Properties" window is erroneously scaled for the font. Thanks, Don Ziesig

Reply by email

Donald Ziesig
to Ondrej Pokorny

Very strange. I looked at all of the Form DesignTimePPI and they were set to 96! I shut down Lazarus and re-started it and they all changed back to 144 (and the little buttons got big!). My forms all look good again except for the "Watch Properties".

I'll keep trying and let you know.

Don

Ondrej Pokorny wrote 33 lines
Strange, it looks good here (the latest revision): https://s17.postimg.org/9a9oa9cyn/Linux_120_DPI.png I've been working on High DPI today so maybe it was broken at some point during the day (?) Ondrej On 21.02.2017 19:03, Donald Ziesig via Lazarus wrote: > Hi Ondrej! > > I just ran into two issues with the IDE in High-DPI mode. > > The IDE main window changed from yesterday (when I first used it) to > today. Yesterday all of the Buttons were larger (but the internal > images were still small). Today the Buttons have returned to their > small sizes. The internal images are still small). > > > > I don't know what caused the change. > > The "Watch Properties" window is erroneously scaled for the font. > > > > > Thanks, > > Don Ziesig

Reply by email

Michael Van Canneyt
to Ondrej Pokorny: I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's…
Ondrej Pokorny wrote 9 lines
I'd like to announce that I finished the concept of DPI scaling in Lazarus / LCL. It's quite easy for the programmer. Documented here: http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI in Lazarus 1.7 and above"). 1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its windows should scale correctly.

I have tried this. I see no effect whatsoever ?

I have even specially opened 2 IDEs. One which is more than a year old, and the newly compiled one. They look identical.

I checked, and I found
Application.Scaled := True;
in the sources.

I checked dpi, xrdb reports DPI 192.

Linux Mint 18.1, 64-bit, GTK 2 widgetset.

Any hints ?

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote 15 lines
I have tried this. I see no effect whatsoever ? I have even specially opened 2 IDEs. One which is more than a year old, and the newly compiled one. They look identical. I checked, and I found Application.Scaled := True; in the sources. I checked dpi, xrdb reports DPI 192. Linux Mint 18.1, 64-bit, GTK 2 widgetset. Any hints ?

Create an empty LCL application and check the TForm.DesignTimePPI property. What value does it show?

Ondrej

Reply by email

Ondrej Pokorny
to Michael Van Canneyt: I have tried this. I see no effect whatsoever ? I have even specially opened 2 IDEs. One…
Michael Van Canneyt wrote 23 lines
On Mon, 20 Feb 2017, Ondrej Pokorny via Lazarus wrote: > I'd like to announce that I finished the concept of DPI scaling in > Lazarus / LCL. > > It's quite easy for the programmer. Documented here: > http://wiki.lazarus.freepascal.org/High_DPI (details are in "High DPI > in Lazarus 1.7 and above"). > > 1.) I made the Lazarus IDE High-DPI aware - the IDE itself and its > windows should scale correctly. I have tried this. I see no effect whatsoever ? I have even specially opened 2 IDEs. One which is more than a year old, and the newly compiled one. They look identical. I checked, and I found Application.Scaled := True; in the sources. I checked dpi, xrdb reports DPI 192.

Create an empty LCL application and check the TForm.DesignTimePPI property. What value does it show?

Ondrej

Reply by email