lcl: forms: allow changing TCustomForm.DesignTimeDPI in runtime.

git-svn-id: trunk@53510 -
This commit is contained in:
ondrej 2016-12-01 20:55:10 +00:00
parent beafafc9a0
commit 2612f8b61e

View File

@ -355,10 +355,11 @@ end;
procedure TCustomForm.SetDesignTimeDPI(const aDesignTimeDPI: Integer);
begin
if not (csLoading in ComponentState) then
if (csLoading in ComponentState) // allow setting only when loading
or not (csDesigning in ComponentState)) then // or in runtime (the programmer has to know why he is doing that)
FDesignTimeDPI := aDesignTimeDPI
else
raise EInvalidOperation.Create(sCannotSetDesignTimeDPI);
FDesignTimeDPI := aDesignTimeDPI;
end;
{------------------------------------------------------------------------------