<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 07.06.2023 00:35, Vojtěch Čihák via
lazarus wrote:<br>
</div>
<blockquote type="cite" cite="mid:20230607003519.9180B1E6@atlas.cz">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p style="padding:0 0 0 0; margin:0 0 0 0;">I finally built a
hi-DPI machine (28'' 4k display, currently set to 118PPI) and I
need to tweak EC-Controls
(<a class="moz-txt-link-freetext" href="https://wiki.freepascal.org/Eye-Candy_Controls">https://wiki.freepascal.org/Eye-Candy_Controls</a>) to scale
better.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">One problematic is
TECSpinBtns because it is designed like this: it consists of
(initially) nine small buttons (TPersistent) with hardcoded
width=15 and its overall width is 9*15 =135 pixels or N*15 in
general.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Therefore, when I put
this component on the form, its Width is not scaled (Height is).
I tried to override DoAutoAdjustLayout but it's not triggered at
all.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><span
style="font-size: 10pt;">TECSpinBtns </span>is
TGraphicControl.</p>
</blockquote>
<p>Here is information:
<a class="moz-txt-link-freetext" href="https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above">https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above</a></p>
<p>IIRC, DoAutoAdjustLayout() is executed only when the DPI changes.
You have to scale every hardcoded pixel value in the
constructor/loading/intitialize as well.</p>
<p>Ondrej<br>
</p>
</body>
</html>