Hi,

I have one more question to DoAutoAdjustLayout();.
I use TECSpinBtns (TGraphicControl) in two variants:
The first as a stand-alone component and the second as a part of TECSpinEdit 
(where TEdit is Owner and TECSpinBtns is subcomponent anchored to it).
When I put them on the form, DoAutoAdjustLayout() is triggered only in the 
first case.
Is it that Owner is responsible to call DoAutoAdjustLayout() of owned controls?
 
V.


______________________________________________________________
Od: "Ondrej Pokorny via lazarus" <lazarus@lists.lazarus-ide.org>
Komu: lazarus@lists.lazarus-ide.org
Datum: 08.06.2023 08:08
Předmět: Re: [Lazarus] Hi-DPI tweak of components

---If you have values that need to be scaled you do:
1.) Initialize the sizes for Screen.PixelsPerInch in constructor:
MySize := Scale96ToScreen(cMyValueAt96DPI);
2.) Use DoAutoAdjustLayout() to scale them when PPI changes:
MySize := Round(MySize * AXProportion);
Simple as that.
Check TCustomColorBox how it handles FColorRectWidth as an example (it uses a 
default value and if the user overwrites it, it gets scaled in 
DoAutoAdjustLayout().
Ondrej


----------

--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to