Yashied Posted January 19, 2011 Share Posted January 19, 2011 (edited) This is just an example. Note, library required.expandcollapse popup#Include <GUIConstantsEx.au3> #Include <GUIImageList.au3> #Include <GUITreeView.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm, $hTreeView, $hImageList, $hItem, $hNext, $hSelect = 0, $hInput, $Input, $Dummy1, $Dummy2 Global $X, $Y, $sPath, $sRoot = @HomeDrive $hForm = GUICreate('MyGUI', 600, 600) $Input = GUICtrlCreateInput('', 20, 20, 560, 19) $hInput = GUICtrlGetHandle(-1) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateTreeView(20, 50, 560, 530, -1, $WS_EX_CLIENTEDGE) $hTreeView = GUICtrlGetHandle(-1) $Dummy1 = GUICtrlCreateDummy() $Dummy2 = GUICtrlCreateDummy() If _WinAPI_GetVersion() >= '6.0' Then _WinAPI_SetWindowTheme($hTreeView, 'Explorer') EndIf $hImageList = _GUIImageList_Create(16, 16, 5, 1) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 3) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 4) _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImageList) $sRoot = StringRegExpReplace($sRoot, '\\+\Z', '') $sPath = StringRegExpReplace($sRoot, '^.*\\', '') If StringInStr($sPath, ':') Then $sRoot &= '\' $sPath &= '\' EndIf ;_GUICtrlTreeView_BeginUpdate($hTreeView) _TVUpdate($hTreeView, _GUICtrlTreeView_AddChild($hTreeView, 0, $sPath, 0, 0)) ;_GUICtrlTreeView_EndUpdate($hTreeView) GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') GUISetState() _GUICtrlTreeView_Expand($hTreeView, _GUICtrlTreeView_GetFirstItem($hTreeView)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Dummy1 ; Update GUISetCursor(1, 1) $hItem = _GUICtrlTreeView_GetFirstChild($hTreeView, GUICtrlRead($Dummy1)) If $hItem Then While $hItem $hNext = _GUICtrlTreeView_GetNextSibling($hTreeView, $hItem) If Not _TVUpdate($hTreeView, $hItem) Then _GUICtrlTreeView_Delete($hTreeView, $hItem) EndIf $hItem = $hNext WEnd _WinAPI_RedrawWindow($hTreeView) EndIf GUISetCursor(2, 0) Case $Dummy2 ; Menu $hItem = GUICtrlRead($Dummy2) $sPath = _TVGetPath($hTreeView, $hItem, $sRoot) ConsoleWrite('-------------------------------' & @CR) ConsoleWrite('Handle: ' & $hItem & @CR) ConsoleWrite('Path: ' & $sPath & @CR) If _WinAPI_PathIsDirectory($sPath) Then ConsoleWrite('Type: ' & 'Directory' & @CR) Else ConsoleWrite('Type: ' & 'File' & @CR) EndIf ConsoleWrite('X: ' & MouseGetPos(0) & @CR) ConsoleWrite('Y: ' & MouseGetPos(1) & @CR) ConsoleWrite('-------------------------------' & @CR) EndSwitch WEnd Func _TVGetPath($hTV, $hItem, $sRoot) Local $Path = StringRegExpReplace(_GUICtrlTreeView_GetTree($hTV, $hItem), '([|]+)|(\\[|])', '\\') If Not $Path Then Return '' EndIf If Not StringInStr($Path, ':') Then Return StringRegExpReplace($sRoot, '(\\[^\\]*(\\|)+)\Z', '\\') & $Path EndIf Return $Path EndFunc ;==>_TVGetPath Func _TVSetPath($hTV, $hItem, $sRoot) GUICtrlSetData($Input, _WinAPI_PathCompactPath($hInput, _TVGetPath($hTV, $hItem, $sRoot), 554)) $hSelect = $hItem EndFunc ;==>_TVSetPath Func _TVUpdate($hTV, $hItem) Local $hImageList = _SendMessage($hTV, $TVM_GETIMAGELIST) Local $Path = StringRegExpReplace(_TVGetPath($hTV, $hItem, $sRoot), '\\+\Z', '') Local $hSearch, $hIcon, $Index, $File $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then If Not @error Then If FileExists($Path) Then ; If _WinAPI_PathIsDirectory($Path) Then ; ; Access denied ; EndIf Else Return 0 EndIf EndIf Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If @extended Then _GUICtrlTreeView_AddChild($hTV, $hItem, $File, 0, 0) EndIf WEnd FileClose($hSearch) EndIf $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If Not @extended Then $hIcon = _WinAPI_ShellExtractAssociatedIcon($Path & '\' & $File, 1) $Index = _GUIImageList_ReplaceIcon($hImageList, -1, $hIcon) _GUICtrlTreeView_AddChild($hTV, $hItem, $File, $Index, $Index) _WinAPI_DestroyIcon($hIcon) EndIf WEnd FileClose($hSearch) EndIf Return 1 EndFunc ;==>_TVUpdate Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Local $hItem = DllStructGetData($tNMTREEVIEW, 'NewhItem') Local $iState = DllStructGetData($tNMTREEVIEW, 'NewState') Local $hTV = DllStructGetData($tNMTREEVIEW, 'hWndFrom') Local $ID = DllStructGetData($tNMTREEVIEW, 'Code') Local $tTVHTI, $tPoint Switch $hTV Case $hTreeView Switch $ID Case $TVN_ITEMEXPANDEDW If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) If BitAND($iState, $TVIS_SELECTED) Then _TVSetPath($hTV, _GUICtrlTreeView_GetSelection($hTV), $sRoot) EndIf Else If Not BitAND($iState, $TVIS_EXPANDED) Then _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 0) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 0) Else _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 1) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 1) If Not _GUICtrlTreeView_GetItemParam($hTV, $hItem) Then _GUICtrlTreeView_SetItemParam($hTV, $hItem, 0x7FFFFFFF) GUICtrlSendToDummy($Dummy1, $hItem) EndIf EndIf EndIf Case $TVN_SELCHANGEDW If BitAND($iState, $TVIS_SELECTED) Then If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf Case $NM_RCLICK $tPoint = _WinAPI_GetMousePos(1, $hTV) $tTVHTI = _GUICtrlTreeView_HitTestEx($hTV, DllStructGetData($tPoint, 1), DllStructGetData($tPoint, 2)) $hItem = DllStructGetData($tTVHTI, 'Item') If BitAND(DllStructGetData($tTVHTI, 'Flags'), $TVHT_ONITEM) Then _GUICtrlTreeView_SelectItem($hTreeView, $hItem) If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) Else GUICtrlSendToDummy($Dummy2, $hItem) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Edited January 20, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
MvGulik Posted January 19, 2011 Share Posted January 19, 2011 "On the fly" ? You mean dynamically updated when a folder is changed? (add/del/rename) "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Yashied Posted January 19, 2011 Author Share Posted January 19, 2011 (edited) Another algorithm. expandcollapse popup#Include <GUIConstantsEx.au3> #Include <GUIImageList.au3> #Include <GUITreeView.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm, $hTreeView, $hImageList, $hItem = 0, $hSelect = 0, $hInput, $Input, $Dummy1, $Dummy2 Global $X, $Y, $sPath, $sRoot = @HomeDrive $hForm = GUICreate('MyGUI', 600, 600) $Input = GUICtrlCreateInput('', 20, 20, 560, 19) $hInput = GUICtrlGetHandle(-1) GUICtrlSetState(-1, $GUI_DISABLE) ;$hTreeView = _GUICtrlTreeView_Create($hForm, 20, 50, 560, 530, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) ;_GUICtrlTreeView_SetHeight($hTreeView, 18) GUICtrlCreateTreeView(20, 50, 560, 530, -1, $WS_EX_CLIENTEDGE) $hTreeView = GUICtrlGetHandle(-1) $Dummy1 = GUICtrlCreateDummy() $Dummy2 = GUICtrlCreateDummy() If _WinAPI_GetVersion() >= '6.0' Then _WinAPI_SetWindowTheme($hTreeView, 'Explorer') EndIf $hImageList = _GUIImageList_Create(16, 16, 5, 1) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 3) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 4) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 51) _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImageList) $sRoot = StringRegExpReplace(FileGetLongName($sRoot), '\\+\Z', '') $sPath = StringRegExpReplace($sRoot, '^.*\\', '') If StringInStr($sPath, ':') Then $sRoot &= '\' $sPath &= '\' EndIf If _WinAPI_PathIsDirectory($sRoot) Then $hItem = _GUICtrlTreeView_AddChild($hTreeView, 0, $sPath, 0, 0) If FileClose(FileFindFirstFile($sRoot & '\*')) Then _GUICtrlTreeView_AddChild($hTreeView, $hItem, '', 2, 2) EndIf EndIf GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') GUISetState() If $hItem Then _GUICtrlTreeView_Expand($hTreeView, $hItem) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Dummy1 ; Update GUISetCursor(1, 1) _TVUpdate($hTreeView, GUICtrlRead($Dummy1)) GUISetCursor(2, 0) Case $Dummy2 ; Menu $hItem = GUICtrlRead($Dummy2) $sPath = _TVGetPath($hTreeView, $hItem, $sRoot) ConsoleWrite('-------------------------------' & @CR) ConsoleWrite('Handle: ' & $hItem & @CR) ConsoleWrite('Path: ' & $sPath & @CR) If _WinAPI_PathIsDirectory($sPath) Then ConsoleWrite('Type: ' & 'Directory' & @CR) Else ConsoleWrite('Type: ' & 'File' & @CR) EndIf ConsoleWrite('X: ' & MouseGetPos(0) & @CR) ConsoleWrite('Y: ' & MouseGetPos(1) & @CR) ConsoleWrite('-------------------------------' & @CR) EndSwitch WEnd Func _TVGetPath($hTV, $hItem, $sRoot) Local $Path = StringRegExpReplace(_GUICtrlTreeView_GetTree($hTV, $hItem), '([|]+)|(\\[|])', '\\') If Not $Path Then Return '' EndIf If Not StringInStr($Path, ':') Then Return StringRegExpReplace($sRoot, '(\\[^\\]*(\\|)+)\Z', '\\') & $Path EndIf Return $Path EndFunc ;==>_TVGetPath Func _TVSetPath($hTV, $hItem, $sRoot) GUICtrlSetData($Input, _WinAPI_PathCompactPath($hInput, _TVGetPath($hTV, $hItem, $sRoot), 554)) $hSelect = $hItem EndFunc ;==>_TVSetPath Func _TVUpdate($hTV, $hItem) Local $hImageList = _SendMessage($hTV, $TVM_GETIMAGELIST) Local $Path = StringRegExpReplace(_TVGetPath($hTV, $hItem, $sRoot), '\\+\Z', '') Local $hIcon, $hSearch, $hSubitem Local $Index, $File _WinAPI_LockWindowUpdate($hTV) _GUICtrlTreeView_Delete($hTV, _GUICtrlTreeView_GetFirstChild($hTV, $hItem)) $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then If Not @error Then If FileExists($Path) Then ; If _WinAPI_PathIsDirectory($Path) Then ; ; Access denied ; EndIf Else _GUICtrlTreeView_Delete($hTV, $hItem) _WinAPI_LockWindowUpdate(0) Return 0 EndIf EndIf Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If @extended Then $hSubItem = _GUICtrlTreeView_AddChild($hTV, $hItem, $File, 0, 0) If FileClose(FileFindFirstFile($Path & '\' & $File & '\*')) Then _GUICtrlTreeView_AddChild($hTV, $hSubItem, '', 2, 2) EndIf EndIf WEnd FileClose($hSearch) EndIf $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If Not @extended Then $hIcon = _WinAPI_ShellExtractAssociatedIcon($Path & '\' & $File, 1) $Index = _GUIImageList_ReplaceIcon($hImageList, -1, $hIcon) _GUICtrlTreeView_AddChild($hTV, $hItem, $File, $Index, $Index) _WinAPI_DestroyIcon($hIcon) EndIf WEnd FileClose($hSearch) EndIf _GUICtrlTreeView_SetItemParam($hTV, $hItem, 0x7FFFFFFF) _WinAPI_LockWindowUpdate(0) Return 1 EndFunc ;==>_TVUpdate Func _WinAPI_LockWindowUpdate($hWnd) Local $Ret = DllCall('user32.dll', 'int', 'LockWindowUpdate', 'hwnd', $hWnd) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==>_WinAPI_LockWindowUpdate Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Local $hItem = DllStructGetData($tNMTREEVIEW, 'NewhItem') Local $iState = DllStructGetData($tNMTREEVIEW, 'NewState') Local $hTV = DllStructGetData($tNMTREEVIEW, 'hWndFrom') Local $ID = DllStructGetData($tNMTREEVIEW, 'Code') Local $tTVHTI, $tPoint Switch $hTV Case $hTreeView Switch $ID Case $TVN_ITEMEXPANDEDW If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) If BitAND($iState, $TVIS_SELECTED) Then _TVSetPath($hTV, _GUICtrlTreeView_GetSelection($hTV), $sRoot) EndIf Else If Not BitAND($iState, $TVIS_EXPANDED) Then _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 0) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 0) Else _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 1) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 1) If Not _GUICtrlTreeView_GetItemParam($hTV, $hItem) Then GUICtrlSendToDummy($Dummy1, $hItem) EndIf EndIf EndIf Case $TVN_SELCHANGEDW If BitAND($iState, $TVIS_SELECTED) Then If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf Case $NM_RCLICK $tPoint = _WinAPI_GetMousePos(1, $hTV) $tTVHTI = _GUICtrlTreeView_HitTestEx($hTV, DllStructGetData($tPoint, 1), DllStructGetData($tPoint, 2)) $hItem = DllStructGetData($tTVHTI, 'Item') If BitAND(DllStructGetData($tTVHTI, 'Flags'), $TVHT_ONITEM) Then _GUICtrlTreeView_SelectItem($hTreeView, $hItem) If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) Else GUICtrlSendToDummy($Dummy2, $hItem) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY "On the fly" ? You mean dynamically updated when a folder is changed? (add/del/rename) Yes. Edited January 20, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Yashied Posted January 19, 2011 Author Share Posted January 19, 2011 (edited) Deleted. Edited January 19, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Beege Posted January 19, 2011 Share Posted January 19, 2011 Great example Yashied! Thanks for sharing. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
qwert Posted February 15, 2011 Share Posted February 15, 2011 This looks like a great start to a special-purpose directory viewer that I've been thinking about. But I've never worked with Tree Views in au3 ... or anywhere else, for that matter ... so I have these questions: Can someone point out where I would add a column for File Date? Also, what's a good method to get a File Name returned to the script if I double click on its entry? Thanks for any help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 15, 2011 Moderators Share Posted February 15, 2011 qwert, Yashied has released an updated version of this UDF here - you may want to use that in your project instead. As to TreeViews in general, you cannot add columns - you could only add the date to the filename to display. And if you look at my version of a folder treeview here you will see how to get a doubleclick to return the selected name. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
qwert Posted February 16, 2011 Share Posted February 16, 2011 Thanks for your reply.Over the past day, I've explored the examples you pointed to and also explored the tree view examples in help. I quickly found that I was reading too much "directory tree" into the purpose and functions of tree views.But before I abandon my idea, I wanted to show exactly what I was trying for and ask: is this impossible in a simple script? Yashied's examples just seemed so close.Again, thanks for any help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 16, 2011 Moderators Share Posted February 16, 2011 qwert, As I mentioned above, the only way I can see to produce a treeview like that is to concatenate the additional data to the filename and set the whole string as the item. However, I can imagine all sorts of problems getting the column spacing correct if you tried to do it that way - you would have to measure the length of the filename and then add just enough tabs to align everything. It is by no means impossible, but would add significantly to the time taken to fill the tree each time. I suggest asking Yashied in his other topic - I think he has abandoned this one - as he is far more knowledgeable about these things that I am. Sorry I cannot be of more help myself. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Syed23 Posted July 26, 2012 Share Posted July 26, 2012 (edited) This is really awesome! is there a way to use checkbox instead of folder icons? i tried by giving the exStyle but not worked may be i am using it in wrong place and suggestion for me? Edited July 26, 2012 by Syed23 Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] Link to comment Share on other sites More sharing options...
caleb41610 Posted October 3, 2012 Share Posted October 3, 2012 qwert,As I mentioned above, the only way I can see to produce a treeview like that is to concatenate the additional data to the filename and set the whole string as the item. However, I can imagine all sorts of problems getting the column spacing correct if you tried to do it that way - you would have to measure the length of the filename and then add just enough tabs to align everything. It is by no means impossible, but would add significantly to the time taken to fill the tree each time. I suggest asking Yashied in his other topic - I think he has abandoned this one - as he is far more knowledgeable about these things that I am. Sorry I cannot be of more help myself. M23Picking one of those even-spaced ascii-art fonts would make the spacing pretty easy I would think Multi-Connection TCP Server Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now