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 

Selecting Node in TTreeView

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






PostPosted: Tue Jan 23, 2007 9:13 am    Post subject: Selecting Node in TTreeView Reply with quote



Hi

I'm relatively new to C++ Builder, and currently working with the
TTreeView component. I've succesfully incorporated the checkboxes and
all the functionality that I want with the program but for one issue
that I'm currently trying to solve.

In the TTreeView MouseDown method I get the node selected via the X and
Y values using the GetNodeAt(X,Y) as below.

ie. void __fastcall
TEvaluationFormNeXGeN::TimeLineTreeMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y) {
//lotsa code here
TTreeNode* selected_node = p_tree_view->GetNodeAt(X, Y);
//lotsa code here
}

Now the problem that I'm having is when I expand one of the nodes with
alot of children (more than the length of the TTreeView pane) the
TTreeView pane automatically scrolls to place the selected node in
focus i.e. right on top. Now the selected_node in the above code does
not point to the expanded node, but rather to the child of that node
that is the same distance from the expanded node that the expanded node
is to the root node since the root node is on top and the pane scrolled
downwards.

Now does anyone know how I can solve this problem (hopefully I have
explained myself clearly enough).
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.