<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 29.11.2021 17:18, Juha Manninen via
lazarus wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPN1EhAhA-8aM_SNfzS7+CU7QNcAogvz1EdAz7QcriLwN6ejtA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">On Mon, Nov 29, 2021 at 1:32 PM Ondrej
Pokorny via lazarus <<a
href="mailto:lazarus@lists.lazarus-ide.org"
moz-do-not-send="true">lazarus@lists.lazarus-ide.org</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">There are many
scenarios when the Canvas cannot be accessed and it
is a <br>
common mistake to access it when not allowed.<br>
<br>
I didn't study the issue further but to me it looks
strange that setting <br>
some parameters in CreateParams helps with it. Juha,
your commit <br>
description "Somehow fixes issue ..." doesn't help
to understand your <br>
change either.<br>
</blockquote>
<div><br>
</div>
<div>The commit message is not perfect but the
committed code is, now that I fully understand the
issue.</div>
<div>CreateParams for Frame now follows the same logic
as CreateParams for Form.<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>Frame is not a form.</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAPN1EhAhA-8aM_SNfzS7+CU7QNcAogvz1EdAz7QcriLwN6ejtA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<div>It allows a Frame to stand without a parent in
the designer or even at runtime in some hypothetical
situation(?).</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>We definitely should't do anything with the parameters at runtime
and don't allow frames to be shown as forms by default. What
buttons (min/max/close/...) should be shown, what border style wtc
etc? If the programmer wants to show his frame as a standalone
form, he can override CreateParams() on his own.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAPN1EhAhA-8aM_SNfzS7+CU7QNcAogvz1EdAz7QcriLwN6ejtA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<div>Using Canvas outside Paint may not be recommended
but it can be done in some widgetsets. The
component's duty is to not crash in designer or
anywhere else when it happens.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>Well, if the programmer writes his code so that it crashes, what
do you want to do with it?</p>
<p>Yes, we should handle exceptions in the designer. But your code
doesn't improve this.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CAPN1EhAhA-8aM_SNfzS7+CU7QNcAogvz1EdAz7QcriLwN6ejtA@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
So I would encourage the component author to rewrite
his code.<br>
</blockquote>
<div><br>
</div>
<div>Rewrite? Ok, then TCustomForm must be rewritten,
too. They now follow the same logic, at least
regarding CreateParams().</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>Rewrite his code = the custom component, not TFrame, not
TCustomForm.</p>
<p>It's basically a very bad idea to force create the handle when
the component is loaded (that is what you do when you access the
canvas).</p>
Ondrej<br>
</body>
</html>