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 

How to suppress adding component to DFM

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Mark L. Tiede
Guest





PostPosted: Tue Aug 19, 2003 2:39 pm    Post subject: How to suppress adding component to DFM Reply with quote



Here is a code stub:

procedure TObjectPalette.CreateSheets;
begin
RemoteMonitorSheet := TTabSheet.Create( Self );
with RemoteMonitorSheet do begin
PageControl := Self;
Caption := 'Remote Monitor Objects';
Parent := Self;
end;

I made the owner of TTabSheet be SELF hoping to suppress the writing of the
TTabSheet object to the DFM when the form was saved. It still wrote its
Caption property to the DFM.

How can I suppress that? I don't want any part of that stored in the DFM
because my Create method of the TObjectPalette is going to create another
instance of the TTabSheet again and I end up with TWO of them when I reload
the DFM.


Back to top
Mark L. Tiede
Guest





PostPosted: Wed Aug 20, 2003 6:25 pm    Post subject: Re: How to suppress adding component to DFM Reply with quote



Peter,

In my actual code, the TTabSheet was really my own object class. I ended
up overriding the WriteState method in my class. I made it do nothing.
Consequently, the TabSheet object doesn't get written to the DFM. That is
the behavior I wanted.

However, I still don't understand why I even had to do that. I suspect that
when tabsheets have their PageControl property set, they are changed so that
the owner is the Pagecontrol. I couldn't find anything in tracing through
the code that proves that though.


"Peter Thörnqvist" <peter3 (AT) nospam (DOT) peter3.com> wrote

Quote:
Try creating a new TPageControl descendant where you override GetChildren
and do nothing.

--
Regards,

Peter Thornqvist (JVCL Coordinator)
http://jvcl.sourceforge.net





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing 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.