Recent

Author Topic: Adjust TForm and Buttons to Screen Resolution [SOLVED]  (Read 1887 times)

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Adjust TForm and Buttons to Screen Resolution [SOLVED]
« Reply #15 on: April 14, 2021, 02:48:18 pm »
I got it myself!
I replaced the TPageControl with a TNotebook and set two different pages. It does the same without the border. I only needed to change a little code to change between the two pages. Thank you all, who helped me! :)
« Last Edit: April 15, 2021, 07:13:35 pm by AlphaInc. »

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Adjust TForm and Buttons to Screen Resolution
« Reply #16 on: April 14, 2021, 11:43:21 pm »
I think scaling a form so that it is a constant fraction of the screen is the wrong way. Suppose a user with a super high-res screen with some thousands of pixels - he will be annoyed because most of his expensive monitor is covered by a super-blown-up form of some application. And then suppose a user with an 800 pixels screen who would be happy to increase the form to full resolution.

Anyway, I would like to point you to the torry site (https://torry.net) which contains the component TFormResizer (EasySize) which scales a form and all its controls in a uniform way. This was discussed in a thread of the German forum (https://www.lazarusforum.de/viewtopic.php?p=88001). I downloaded it, converted it to Lazarus, and wrote a small demo for it. In the demo the form is always scaled to cover 50% of the screen initially. The user can resize the form, and the form scales its contained controls proportionally. Note, however, that icons of bitbtns or themed parts of controls (checkboxes, radiobuttons) are not scaled (the embedded cheetah image does scale, on the other hand, because it is much larger than the displayed TImage control due to the Proportional property).

It's me again - I'm just curious at this moment - the tool detects the screen resolution just perfect and sets the window accordingly. Is it also possible to detect zoom (or "Change the size of text, app and other items" as it's called) to select different resolutions when it's 100% zoomed or 150% zoomed?
This would be a nice feature but if it's not possible that's not it Okay too.

speter

  • Full Member
  • ***
  • Posts: 194
Re: Adjust TForm and Buttons to Screen Resolution [SOLVED]
« Reply #17 on: April 15, 2021, 01:39:59 am »
Have a look at the TNotebook component. Handoko has mentioned it a number of times (I think) suggesting that it can be used without the tabs.

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Laz 2.0.10 / FPC 3.2.0 / Windows 10 (64bit)

AlphaInc.

  • Jr. Member
  • **
  • Posts: 93
Re: Adjust TForm and Buttons to Screen Resolution [SOLVED]
« Reply #18 on: April 15, 2021, 08:38:23 am »
Have a look at the TNotebook component. Handoko has mentioned it a number of times (I think) suggesting that it can be used without the tabs.

cheers
S.

I did implement a Notebook (and deleted the TPageControl and TTabSheet).
The question is how it can detect what level of zoom windows is using (size of text, apps and other elemts) in addition to the screen resolution ?

 

TinyPortal © 2005-2018