 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Wade Guest
|
Posted: Wed Jan 28, 2004 2:31 pm Post subject: OOP Form Wizard in Cantools |
|
|
I am wondering what the advantage of using the FindComponent function
rather than the "Initialization - RegisterClasses"?
The reason I am wondering about this is: I created a form the normal
way. Than I go and use the "OOP Form Wizard" and it removes the
"Initialization - RegisterClasses" routine in the FormCreate procedure
and adds a FindComponent statement for each component on the form. My
thought is that the purpose for this is to save memory, is this true
and are there other advantages to this?
Thanks for the help,
Wade
|
|
| Back to top |
|
 |
Peter Morris [Droopy Eyes Guest
|
Posted: Wed Jan 28, 2004 5:19 pm Post subject: Re: OOP Form Wizard in Cantools |
|
|
Every control reference in your form is exposed as Public. If you make them
private then the Delphi streaming mechanism cannot find them in order to
assign their references and they all remain nil.
You can make them Private, and use FindControl to assign the references
instead. This gives the advantage that not all control references are
accessible from other classes.
--
Pete
=============
http://www.DroopyEyes.com - Delphi source code
Audio compression components, Fast Strings, DIB Controls
Read or write article on just about anything
http://www.HowToDoThings.com
|
|
| Back to top |
|
 |
Jacob Thurman Guest
|
Posted: Wed Jan 28, 2004 6:26 pm Post subject: Re: OOP Form Wizard in Cantools |
|
|
| Quote: | Every control reference in your form is exposed as Public. If you make
them
private then the Delphi streaming mechanism cannot find them in order to
assign their references and they all remain nil.
You can make them Private, and use FindControl to assign the references
instead. This gives the advantage that not all control references are
accessible from other classes.
|
Hey Pete,
It's actually published, not public. Semantically, there's no real
difference, I know, but being published is what allows them to be accessed
by the streaming system.
--
Jacob Thurman
Creator of Castalia - The ultimate Delphi Productivity Suite.
http://www.delphi-expert.com/
Super-Smart Syntax Highlighting
Fast, powerful code templates
Code Navigation Facilities you've only dreamed of
Automated Refactoring
Inline variable declaration
On-the fly syntax checking
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|