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

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Jun 26 10:15:12 EDT 2003


On Thu, 26 Jun 2003 16:38:47 +0200 (W. Europe Daylight Time)
Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:

> 
> 
> 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...

Only the designed components. But components can create child components.
e.g. TRadioGroup. 
Use TMenu.Parent for the parent component. Check if it is a TWinControl. If
not, then write a warning, that this kind of component is unsupported and
continue.


Mattias






More information about the Lazarus mailing list