[Lazarus] TFrame improvements

Juha Manninen juha.manninen62 at gmail.com
Mon Nov 29 17:18:46 CET 2021


On Mon, Nov 29, 2021 at 1:32 PM Ondrej Pokorny via lazarus <
lazarus at lists.lazarus-ide.org> wrote:

> There are many scenarios when the Canvas cannot be accessed and it is a
> common mistake to access it when not allowed.
>
> I didn't study the issue further but to me it looks strange that setting
> some parameters in CreateParams helps with it. Juha, your commit
> description "Somehow fixes issue ..." doesn't help to understand your
> change either.
>

The commit message is not perfect but the committed code is, now that I
fully understand the issue.
CreateParams for Frame now follows the same logic as CreateParams for Form.
It allows a Frame to stand without a parent in the designer or even at
runtime in some hypothetical situation(?).
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.


So I would encourage the component author to rewrite his code.
>

Rewrite? Ok, then TCustomForm must be rewritten, too. They now follow the
same logic, at least regarding CreateParams().

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20211129/713a3b89/attachment-0001.html>


More information about the lazarus mailing list