Board index » cppbuilder » complex TWinControl derived component...

complex TWinControl derived component...

"De Smet Mattias" <upanishad...@hotmail.com> wrote in message
news:3dbfbf07$1@newsgroups.borland.com...

Quote
> But now, I can't position and resize the components in these
> upper and lower 'panels'. Because the Parent pointer is
> assigned after construction.

Because the main component wraps the sub-components, the main component
receives all of the user input.  That is the nature of components.  As such,
you'll have to intercept the user's input from the main component and
manually dispatch it to the sub-components as needed.

Quote
> And I would need to paint the controls on construction.

No, you wouldn't.  Why would you think that?

Gambit

 

Re:complex TWinControl derived component...


"Remy Lebeau (TeamB)" <gambi...@yahoo.com> schreef in bericht
news:3dc01ed5$1@newsgroups.borland.com...

Quote

> "De Smet Mattias" <upanishad...@hotmail.com> wrote in message
> news:3dbfbf07$1@newsgroups.borland.com...

> > But now, I can't position and resize the components in these
> > upper and lower 'panels'. Because the Parent pointer is
> > assigned after construction.

> Because the main component wraps the sub-components, the main component
> receives all of the user input.  That is the nature of components.  As
such,
> you'll have to intercept the user's input from the main component and
> manually dispatch it to the sub-components as needed.

The Buttons I used on sub-components already responded to user input (like
mouse click), but making them visible was more of a problem. (and changing
their position was also hard). I noticed that Invalidate is called when
Parent is assigned a value, and I'll try to execute the positioning of the
buttons at that time.

(Maybe I'm programming this component to much with the JavaSwing way of
making it)

Quote
> > And I would need to paint the controls on construction.

> No, you wouldn't.  Why would you think that?

Because nothing else happens after construction, and my subcomponents are
not visible (or correctly positioned).

It's starting to work when I use the Invalidate method to put the
subcomponents in their place.

Could you tell me what the relation is between these functions (Invalidate,
Update, Repaint). When is one of them better than the other, or when will
they be called?
If you know a good reference for VCL component writing, please tell me, so I
won't bother you all this time.
Lots of thanks for the given advice,
Mattias

Other Threads