![]() |
Virtual file-view (tree and list)
Hi,
I have some problem - I need to make "virtual file browser", something like browsers in burning software: ![]() ![]() but I know nothig how to do this. I must add (by drag'n'drop)/remove (also by drag'n'drop)/delete/rename files/folders. Files in virtual view shold have info about original files (such as size, attributes, etc.). I never used TThreeView. Maybe someone could help? Any example code, please? |
Re: Virtual file-view (tree and list)
Check out the
![]() ![]() Alternative: Use VirtualShellTools from ![]() |
Re: Virtual file-view (tree and list)
Zitat:
|
Re: Virtual file-view (tree and list)
Ah okay, now I have a clue what you mean ;)
To receive dropped files from Windows Explorer in your Application: ![]() ![]() Once you get the FileName of the dropped file(s), you have to gather the required information (size, file type and so on) to display it in your tree view. (Search for e.g. ![]() On information how to add entries with System Images (<- ![]() Or you use the even more powerful VirtualTreeView - if you're okay with German, I got a Tutorial for you: ![]() |
Re: Virtual file-view (tree and list)
Getting file info is easy, getting associated icons also :)
But I still don't know to implement this virtual tree :cry: Ok, add folders to tree component may be not to hard, but what about any folder content? How to receive and display in list component virtual content from virtual directory (how to remember draged content?)? This is one I don't understand how to write :cry: PS: I don't speak German :( |
Re: Virtual file-view (tree and list)
To retrieve files from a directory on your hard drive use the
![]() To store the content I would suggest that your write your own Class and/or Object structure, which represents a hierarchial structure (like in a 'Tree'). For example, you write a class called "TFolder" containing a List (e.g. a StringList) of a files you have in it and then you have a seperate List of "SubFolders" (TObjectList containing other TFolder instances for example). Using the List-Classes you can easily switch items between single instances of TFolder. The easiest way to display those element would be (as seen in your screenshot) to have a tree containing just the folders on the left, and then a list that contains all elements (files & folders) from the selected or the root Folder on the left. When using TTreeView you have to replicate the tree-like structure from your classes (here TFolder). You create a TTreeNode for each TFolder object by using
Delphi-Quellcode:
Use the "Parent" Parameter of this method to represent the hierarchial structure of TFolder.
TreeView.Items.AddChild
Greets, |
Re: Virtual file-view (tree and list)
Thank you, I will try :)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:07 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz