[lazarus] Patch: progressbar smooth and vertical (win32)

Michael Van Canneyt michael.vancanneyt at wisa.be
Thu Jun 26 09:59:04 EDT 2003




On Thu, 26 Jun 2003, Micha Nelissen wrote:

> Michael Van Canneyt wrote:
> > On Thu, 26 Jun 2003, Micha Nelissen wrote:
> >
> >> The first one is Sender.Parent for sure. But the second one:
> >> DrawMenuBar wants a handle of the window of the menu which needs to
> >> be redrawn. Which often happens to be Sender.Owner. What guarantees
> >> me that Sender.Owner is a TWinControl? It could be a TComponent just
> >> as well....We're just lucky here that all menuitems on a form are
> >> owned by the form, but they could have been owned by a TButton just
> >> as well...no restriction there. How to get the form of the menu it's
> >> on? It could be a popup menu as well...
> >
> > AFAIK, the owner should always be the form.
>
> If I may ask, why? The owner is only responsible for memory management, in
> delphi at least, is this different for the lcl? I don't know what prevents
> me from writing in TForm1:
>
> Button1 := TButton1.Create(Self)
> MenuItem1 := TMenuItem.Create(Button1);

Yes, this is of course possible.

But the streaming mechanism creates all components with the form as
the owner...

Michael.






More information about the Lazarus mailing list