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 

Object Repository or New component

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Paul
Guest





PostPosted: Fri Jul 22, 2005 6:34 am    Post subject: Object Repository or New component Reply with quote



Hi all,

I use frames in the tree nodes. Frames contain different kind of components
(Edit, StringGrid) and I should be able to save information of these frames.
Problem is that only each frame knows how to do that and therefore I should
add method SaveData() to frame component.

I realize that it is possible write a new component that is derived from
TFrame but is it possible to use object repository instead ? I rather would
use Object Repository than writing a new component.

Saving nodes:
.....
TTreeNode *TempNodePointer;
String Path;

NodeList->Clear();
if(SaveDialog->Execute())
{
TempNodePointer=TreeView1->Items->GetFirstNode();
while(TempNodePointer)
{
Path=GetNodePath(TempNodePointer);
NodeList->Add(Path);
// TMyFrame is a parent class containing TMyFrame::SaveData(void){/*
does nothing*/}
reinterpret_cast <TMyFrame *> (TempNodePointer->Data)->SaveData();
//Derived class SaveData()-method Adds data to NodeList
TempNodePointer = TempNodePointer->GetNext();
}
NodeList->SaveToFile(SaveDialog->FileName);
}
.....

Modified TmyFrame class containing SaveData-method:

class TmyFrame : public TFrame
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TmyFrame(TComponent* Owner);
void __fastcall TmyFrame::SaveData(void);
};

Your suggestions on this would be greatly appreciated.

Thanks,
Pauli


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) 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.