Tooltips and Trees
-
I've been trying to get tooltip hints working as the mouse passes over a TreeCtrl. I've created an OnToolTip handler, which does indeed get called when you settle the mouse on a tree item. What I can't figure is how to translate what's passed to the handler into a HTREEITEM or similar so I can find the co-responding tree item and, hence, build suitable text.:confused: I've got control IDs and a window handle available but I can't see how to translate either. I've been using a CMapPtrToPtr to map the HTREEITEM to the relevant data object though, on further study, it probably makes more sense to point the item data field at the object.
-
I've been trying to get tooltip hints working as the mouse passes over a TreeCtrl. I've created an OnToolTip handler, which does indeed get called when you settle the mouse on a tree item. What I can't figure is how to translate what's passed to the handler into a HTREEITEM or similar so I can find the co-responding tree item and, hence, build suitable text.:confused: I've got control IDs and a window handle available but I can't see how to translate either. I've been using a CMapPtrToPtr to map the HTREEITEM to the relevant data object though, on further study, it probably makes more sense to point the item data field at the object.
Do you handle TVN_GETINFOTIP? Tomasz Sowinski -- http://www.shooltz.com
-
Do you handle TVN_GETINFOTIP? Tomasz Sowinski -- http://www.shooltz.com
I think that's the message I handle (don't have the code with me here). Certainly the routine I put in get's called when I'd expect it to, I just don't know how to make sense of the parameters.
-
I think that's the message I handle (don't have the code with me here). Certainly the routine I put in get's called when I'd expect it to, I just don't know how to make sense of the parameters.
You should have pointer to NMTVGETINFOTIP structure, which is full of relevant information. Tomasz Sowinski -- http://www.shooltz.com
-
You should have pointer to NMTVGETINFOTIP structure, which is full of relevant information. Tomasz Sowinski -- http://www.shooltz.com
Yup, I think that's the structure (this would be a lot easier if I had the code here). The structure I get contains a window handle and a what is probably a controll id. But what I need to access the data and supply the text is the HTREEITEM handle, which just doesn't seem to be arround. Nor can I find anything in CTreeCtrl that seems intended to look it up.
-
Yup, I think that's the structure (this would be a lot easier if I had the code here). The structure I get contains a window handle and a what is probably a controll id. But what I need to access the data and supply the text is the HTREEITEM handle, which just doesn't seem to be arround. Nor can I find anything in CTreeCtrl that seems intended to look it up.
Yup, I think that's the structure (this would be a lot easier if I had the code here). The structure I get contains a window handle and a what is probably a controll id. You're probably talking about NMHDR - it contains a handle and an id. You can cast the pointer to *NMTVGETINFOTIP to get more info - assuming that you're really handling TVN_GETINFOTIP. Tomasz Sowinski -- http://www.shooltz.com
-
Yup, I think that's the structure (this would be a lot easier if I had the code here). The structure I get contains a window handle and a what is probably a controll id. You're probably talking about NMHDR - it contains a handle and an id. You can cast the pointer to *NMTVGETINFOTIP to get more info - assuming that you're really handling TVN_GETINFOTIP. Tomasz Sowinski -- http://www.shooltz.com
Thanks, that's probably it. I may well be looking at too generic a message too. I'll give it a go tonight.