BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OOP Form Wizard in Cantools

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Wade
Guest





PostPosted: Wed Jan 28, 2004 2:31 pm    Post subject: OOP Form Wizard in Cantools Reply with quote



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





PostPosted: Wed Jan 28, 2004 5:19 pm    Post subject: Re: OOP Form Wizard in Cantools Reply with 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.


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





PostPosted: Wed Jan 28, 2004 6:26 pm    Post subject: Re: OOP Form Wizard in Cantools Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.