 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Tue Jan 23, 2007 9:13 am Post subject: Selecting Node in TTreeView |
|
|
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 |
|
 |
|
|
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
|
|