View previous topic :: View next topic |
Author |
Message |
HienTau
Joined: 16 Jun 2005 Posts: 12
|
Posted: Mon Dec 12, 2005 4:08 pm Post subject: TreeView problem |
|
|
It seems that on Windows 98 the current tree node of a TreeView cannot be determined through "afterSelect". The DFL treeview example contains an afterSelect delegate method, which should change a label to the current tree view's path (which it doesn't):
Quote: | private void onTreeSelect(Object sender, TreeViewEventArgs ea)
{
selnode.text = ea.node.fullPath;
}
|
The problem does not occur on Win2000 or higher.
Fortunately getNodeAt() and mouseDown work perfectly as a replacement. Nevertheless: Is that a bug or did I get something wrong? |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Tue Dec 13, 2005 2:11 pm Post subject: Re: TreeView problem |
|
|
Strange! Here's the part of DFL that calls onAfterSelect():
Code: | case TVN_SELCHANGEDA:
nmtv = cast(NM_TREEVIEW*)nmh;
switch(nmtv.action)
{
case TVC_BYMOUSE:
onAfterSelect(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam,
TreeViewAction.BY_MOUSE));
break;
case TVC_BYKEYBOARD:
onAfterSelect(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam,
TreeViewAction.BY_KEYBOARD));
break;
//case TVC_UNKNOWN:
default:
onAfterSelect(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam,
TreeViewAction.UNKNOWN));
}
break; |
and the fullPath of a TreeNode uses cached text. This makes me think maybe the NM_TREEVIEW.newItem.lParam isn't a valid pointer to TreeNode on Win9x, but why just there, the documentation says it's a 32bit value, and why isn't it crashing? I'll continue to look into it.
- Chris |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Mon Dec 19, 2005 11:11 pm Post subject: Re: TreeView problem |
|
|
This should be fixed in snapshot 20051219. Thanks for letting me know about this.
- Chris |
|
Back to top |
|
|
HienTau
Joined: 16 Jun 2005 Posts: 12
|
Posted: Tue Dec 20, 2005 6:07 am Post subject: |
|
|
You're welcome. Thanks for fixing it so fast.
*DFL motivation level rises* |
|
Back to top |
|
|
|