The beginning of the question

The beginning (or it will be useful) of the question above, by reference, is nothing remarkable. The theme is:

D 10.1 starter. Standard application. The options included design schemes. Now determine whether the design is applied or not - we take from there, the same functions.

Again (when choosing other themes in the project options), I choose the default style - Windows. Those. others are present until they are selected programmatically, but there is a default style - Windows.

Everything is working fine. For all styles. In addition to the default - Windows. When choosing it (in any case, I’m wrinkling) -............. or rather not so, when developing the default in this style everything is ok. And as soon as I use any other - there is a small joint in the right side of the application - it is about 5-10 pixels always smaller (and if you start with a new layout, the right side of all forms is usually smaller than the original) .

I fight like this (crutches)

Procedure GuNewRForm; GuAddRighForm=8; // экспериментально методом тыка Var i:integer; begin if not GuIsAppThemed then exit; for i:=0 to application.ComponentCount-1 do if (application.Components[i] is TForm) then With TForm(application.Components[i]) Do width:=width+GuAddRightForm; end; Function GuIsAppThemed:boolean; begin if (TStyleManager.Enabled)and(TStyleManager.IsCustomStyleActive) then result:=true else result:=false; end; Function GuGetRForm:integer; begin if GuIsAppThemed then result:=GuAddRightForm else result:=0; end; 

and in the project file before application.run; add GuNewRForm; {from a separate module, cat. in uses 1st}

Questions:

  1. Why there is a difference in the right fields !? (I previously read about DPI, scaled form, etc., but not the same!)
  2. How to deal with it?
  3. How to calculate the difference between [win.view.formwith] & [themed.view.formwith]? so far only by sight.
  4. Maybe it's easier way and I complicate things?

    ++ If it is not clearly written, I will provide the code and a more detailed description

  • The window borders are most likely in the standard theme, and when using styles, the border is removed. - teran
  • pay attention to this question , for example, and the solutions that are proposed there. - teran
  • 2 teran, thank you for your attention. but all forms when creating mnu scaled = false (tried the opposite) does not help. + I found a bunch of information on the Internet on this topic, but none explains why this + specifically calculations. or rather, why - by vol. e, and here is how to find the difference that more act. for mnu - no. - Gu.
  • I would consider the optimal answer to find the difference between styles + why it arises \ or how to make it all the same \ or the "right way". - Gu.
  • yes it seems on the link given by me, companion RRUZ, the Delphi IDE theme editor developer and any such utilities, wrote that the difference arises from the fact that different styles have different width of border. It also says that there is a cant with the fact that Delphi does not correctly restore ClientWIdth from dfm, - teran

1 answer 1

When applying themes, the size of the client area is always preserved - and the borders of different styles have their sizes.