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. OnEndlabeleditTree ()

OnEndlabeleditTree ()

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
2 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.
  • B Offline
    B Offline
    Binayak
    wrote on last edited by
    #1

    Hi, I have enabled editing of the labels on the tree control and I want to see what user has edited in the label in the OnEndlabeleditTree () function, so that I can either commit the change or, reject the change. what should I use the check the user input in the label? code: void CGeneratorView::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult) { TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; HTREEITEM hItem = pTVDispInfo->item.hItem; if () //check edited text ????????????????????????????? { *pResult = TRUE; } else { *pResult = FALSE; } }

    P 1 Reply Last reply
    0
    • B Binayak

      Hi, I have enabled editing of the labels on the tree control and I want to see what user has edited in the label in the OnEndlabeleditTree () function, so that I can either commit the change or, reject the change. what should I use the check the user input in the label? code: void CGeneratorView::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult) { TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR; HTREEITEM hItem = pTVDispInfo->item.hItem; if () //check edited text ????????????????????????????? { *pResult = TRUE; } else { *pResult = FALSE; } }

      P Offline
      P Offline
      Phil Hamer
      wrote on last edited by
      #2

      pTVDispInfo->item.pszText has the text, but if the user canceled the editing then it will be NULL. So you might do something like: LPCTSTR lpszText = pTVDispInfo->item.pszText; if (lpszText != NULL && IsValidText(lpszText)) { *pResult = TRUE; } else { *pResult = FALSE; } where IsValidText is some function you write to check the edited text.

      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