 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Paul Guest
|
Posted: Fri Jul 22, 2005 6:34 am Post subject: Object Repository or New component |
|
|
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 |
|
 |
|
|
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
|
|