Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Tooltips and Trees

Tooltips and Trees

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorial
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Malcolm McMahon
    wrote on last edited by
    #1

    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.

    T 1 Reply Last reply
    0
    • M Malcolm McMahon

      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.

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Do you handle TVN_GETINFOTIP? Tomasz Sowinski -- http://www.shooltz.com

      M 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Do you handle TVN_GETINFOTIP? Tomasz Sowinski -- http://www.shooltz.com

        M Offline
        M Offline
        Malcolm McMahon
        wrote on last edited by
        #3

        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.

        T 1 Reply Last reply
        0
        • M Malcolm McMahon

          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.

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          You should have pointer to NMTVGETINFOTIP structure, which is full of relevant information. Tomasz Sowinski -- http://www.shooltz.com

          M 1 Reply Last reply
          0
          • T Tomasz Sowinski

            You should have pointer to NMTVGETINFOTIP structure, which is full of relevant information. Tomasz Sowinski -- http://www.shooltz.com

            M Offline
            M Offline
            Malcolm McMahon
            wrote on last edited by
            #5

            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.

            T 1 Reply Last reply
            0
            • M Malcolm McMahon

              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.

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              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

              M 1 Reply Last reply
              0
              • T Tomasz Sowinski

                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

                M Offline
                M Offline
                Malcolm McMahon
                wrote on last edited by
                #7

                Thanks, that's probably it. I may well be looking at too generic a message too. I'll give it a go tonight.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups