2010-02-11 22:14 UTC
I'm trying to populate a treeview with a series of folders and subfolders. I want the key to be the folders actual path, like "c://test//folder01". When I use this string as the key only the "parent" (or first round) of folders are added. If I use the same string as the lable "folder01" there are no probelms, but now I can't get the full path to that folder. Am I making any sense?
Have a look at this and see if something jumps out: i is the full path
;(dcl_tree_clear BlockManager_PaletteManager_NavTreeControl)
;;; Populate Tree View ;
;;;(setq dir "c:\\test\\") ;
;;;(setq i "c:\\test\\Folder 01\\Folder01a\\Folder01aa\\") ;
;;;(bm:AddFolders "c:\\test\\")
(defun bm:AddFolders (dir /)
(setq folderList (bm:GetSubFolders dir))
(if folderList
(foreach
i folderList
(if (not (= (setq temp (vl-string-left-trim dir i)) ""))
(progn (setq folder (bm:strParse temp "\\"))
(cond ((= (length folder) 1)
(dcl_Tree_AddParent
BlockManager_PaletteManager_NavTreeControl
(car folder) i 0 0 1
)
)
((> (length folder) 1)
(dcl_Tree_AddChild
BlockManager_PaletteManager_NavTreeControl
(cadr folder)(car folder) i 0 0 1
)
)
)
)
)
)
)
)
Thanks
Have a look at this and see if something jumps out: i is the full path
;(dcl_tree_clear BlockManager_PaletteManager_NavTreeControl)
;;; Populate Tree View ;
;;;(setq dir "c:\\test\\") ;
;;;(setq i "c:\\test\\Folder 01\\Folder01a\\Folder01aa\\") ;
;;;(bm:AddFolders "c:\\test\\")
(defun bm:AddFolders (dir /)
(setq folderList (bm:GetSubFolders dir))
(if folderList
(foreach
i folderList
(if (not (= (setq temp (vl-string-left-trim dir i)) ""))
(progn (setq folder (bm:strParse temp "\\"))
(cond ((= (length folder) 1)
(dcl_Tree_AddParent
BlockManager_PaletteManager_NavTreeControl
(car folder) i 0 0 1
)
)
((> (length folder) 1)
(dcl_Tree_AddChild
BlockManager_PaletteManager_NavTreeControl
(cadr folder)(car folder) i 0 0 1
)
)
)
)
)
)
)
)
Thanks