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 

TTreeView / AddNodeObject problem - deletion and additional

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





PostPosted: Mon Jun 21, 2004 11:11 am    Post subject: TTreeView / AddNodeObject problem - deletion and additional Reply with quote



I created own component derived from TCustomTreeView. Each node contains
data derived from my class TTNData.
The problem occurs when I create nodes; it looks as follows:

1) I create nodes using code below (first level of the tree):

Items->AddNode (NULL, NULL, d->TreeText, d, naAdd);

where d is data object (containg text to be displayed in field TreeText). I
do it several times (for all DB entries).

2) I checked that addition function for iserted nodes is called - and as for
now it looks ok.

3) Suddenly - after creating - CustomTreeView deletes all nodes and inserts
its again (Deletion and Addition events are called). I don't have any idea
why this happens; its problem for me, because i wanted (very much Smile to make
delete my data in OnDeletion event - and its quite hard to make loading data
on OnAddition event.

It happens only for first level of tree; i tried to make inserting in way
like this:
TTreeNode * last = this->Items->GetFirstNode();
d->FTreeNode = this->Items->AddNode (NULL, last, d->TreeText, d, naAdd);

but it doesn't help.

For next levels, code:

Items->AddChildObject (Node, (*it)->TreeText, (*it));

works very good.

It worked ok in BCB5; problems occurs in BCB6.

I would apreciatie for any help

--
--
Kuba Poskrobko
[email]posk (AT) o2 (DOT) pl[/email]



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