From abb81b4f29689ebcab04ae9a33ec44f501316873 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 2 Aug 2014 21:19:01 +0000 Subject: [PATCH] =?UTF-8?q?TestEgr=20:=20-=20migliorato=20Tree=20con=20vis?= =?UTF-8?q?ualizzazione=20nome=20entit=C3=A0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GeomDBTree.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/GeomDBTree.cpp b/GeomDBTree.cpp index 5af9c42..cf83576 100644 --- a/GeomDBTree.cpp +++ b/GeomDBTree.cpp @@ -194,18 +194,22 @@ bool CTestEGrDlg::InsertGeoObjInTree( int nId, IGeoObj* pGeoObj, HTREEITEM hParent) { int nImage ; - string sName ; + string sObj ; if ( pGeoObj != nullptr) { - sName = pGeoObj->GetTitle() + " " + ToString( nId) ; + string sName ; + if ( m_pGeomDB->GetName( nId, sName)) + sObj += sName + " (" + pGeoObj->GetTitle() + " " + ToString( nId) +")" ; + else + sObj = pGeoObj->GetTitle() + " " + ToString( nId) ; nImage = GetGeoObjImage( pGeoObj->GetType()) ; } else { nImage = ICO_NOGEO ; - sName = "Null " + ToString( nId) ; + sObj = "Null " + ToString( nId) ; } - HTREEITEM hItem = m_Tree.InsertItem( stringtoW( sName), nImage, nImage, hParent) ; + HTREEITEM hItem = m_Tree.InsertItem( stringtoW( sObj), nImage, nImage, hParent) ; return ( hItem != nullptr && m_Tree.SetItemData( hItem, nId) != 0) ; }