FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TreeView problem

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
HienTau



Joined: 16 Jun 2005
Posts: 12

PostPosted: Mon Dec 12, 2005 4:08 pm    Post subject: TreeView problem Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Dec 13, 2005 2:11 pm    Post subject: Re: TreeView problem Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Mon Dec 19, 2005 11:11 pm    Post subject: Re: TreeView problem Reply with quote

This should be fixed in snapshot 20051219. Thanks for letting me know about this.
- Chris
Back to top
View user's profile Send private message
HienTau



Joined: 16 Jun 2005
Posts: 12

PostPosted: Tue Dec 20, 2005 6:07 am    Post subject: Reply with quote

You're welcome. Thanks for fixing it so fast. Razz
*DFL motivation level rises*
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
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, 2005 phpBB Group