AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Virtual file-view (tree and list)

Ein Thema von WojTec · begonnen am 9. Apr 2009 · letzter Beitrag vom 9. Apr 2009
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#1

Virtual file-view (tree and list)

  Alt 9. Apr 2009, 11:50
Hi,

I have some problem - I need to make "virtual file browser", something like browsers in burning software:

http://img175.imagevenue.com/loc202/..._122_202lo.JPG

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?
  Mit Zitat antworten Zitat
Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#2

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 12:01
Check out the Delphi-Referenz durchsuchenTShellTreeView and Delphi-Referenz durchsuchenTShellListView Components [which are included in your Delphi installation]

Alternative: Use VirtualShellTools from www.mustangpeak.net
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 12:19
Zitat von mirage228:
Check out the Delphi-Referenz durchsuchenTShellTreeView and Delphi-Referenz durchsuchenTShellListView Components
These components I know and using, but I don't need treeview for physical file structure, but for fully virtual tree with draged files from explorer - structure will be stored only in memory (like Nero or similar software - compilation view). I don't have idea how to write this
  Mit Zitat antworten Zitat
Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#4

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 12:26
Ah okay, now I have a clue what you mean

To receive dropped files from Windows Explorer in your Application: Hier im Forum suchenWM_DROPFILES, Hier im Forum suchenDragAcceptFiles. You will find a lot of example code with these two search terms.
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. Hier im Forum suchenGetFileSize and/or browse your Delphi Help )

On information how to add entries with System Images (<- Hier im Forum suchenShGetFileInfo) you may want to search for a tutorial regarding TTreeView (I don't any now, sorry - but maybe the Delphi Help is useful for you as well).
Or you use the even more powerful VirtualTreeView - if you're okay with German, I got a Tutorial for you: http://www.delphi-treff.de/tutorials...rtualtreeview/
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#5

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 12:44
Getting file info is easy, getting associated icons also

But I still don't know to implement this virtual tree 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

PS: I don't speak German
  Mit Zitat antworten Zitat
Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#6

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 12:56
To retrieve files from a directory on your hard drive use the Hier im Forum suchenFindAllFiles function that has been posted here in the forum.

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 TreeView.Items.AddChild Use the "Parent" Parameter of this method to represent the hierarchial structure of TFolder.

Greets,
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#7

Re: Virtual file-view (tree and list)

  Alt 9. Apr 2009, 15:32
Thank you, I will try
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz