TDirTree component  Version 1.23 for Delphi 3/4

What's this ?
 A Delphi-component called TDirTree.
 
 You may use it to display (and set) drives and/or directories
 in a treeview-style. (e.g. use it as a combination of 
  TDriveCombobox and TDirectoryListBox)

 - displays Explorer's icons and filenames or custom icons
 - You can decide which drives/dirs to display, you can also add "custom" dirs like archives or whatsoever

(C) 1997,1998,1999 by Markus Stephany. All rights reserved.
********************************************************************************************tdirtree is freeware and can be used in freeware, shareware and commercial productions without
my permission. you may modify the code, but please do not forget the documentation (and the
credits).

you must not sell the component or the source (except you made significant modifications).
********************************************************************************************

If there are any questions, comments or suggestions, or if you find any bugs, please send a
mail in English or German to :

MirBir.St@T-Online.de

And you can visit my homepage at :
http://home.t-online.de/home/MirBir.St/

==========
Disclaimer
==========
this software is provided "as is" without warranty of any kind, 
either expressed or implied.  the entire risk as to the
quality and performance of the software is with you.  should the
software prove defective, you assume the cost of all necessary
servicing, repair, or correction.  in no event shall the author,
copyright holder, or any other party who may redistribute the
software be liable to you for damages, including any general,
special, incidental, or consequential damages arising out of
the use or inability to use the software (including, but not limited
to, loss of data, data being rendered inaccurate, loss of business
profits, loss of business information, business interruptions, loss
sustained by you or third parties, or a failure of the
software to operate with any other software) even if the author,
copyright holder, or other party has been advised of the
possibility of such damages.

to the point : you cannot make me responsable for anything that goes wrong with this...

======
Usage
======

TDirTree is a descendant of TCustomTreeView.
The added properties/events/functions are :

- drive,directory   : reads/sets the selected drive/directory
- Reload            : reads the directorys again (use it e.g. with a shell-notification)
- OnAddDir          : in this event-handler you can decide whether to add a directory to
		      the dirtree or not.
** V1.02**

- ReadOnStart	    : decides whether the control reads its items at startup or only by
                      calling tdirtree.reload
** V1.1 **

- DirType 	    : You can set the file-attributes to decide which directories
                      to show (this works not for the drive-items (cause of NT))

- ShellIcons 
  (readonly)        : an imagelist where you can read the shell's small-icons
                      (maybe for a listview for files, you have not to create
                      another imagelist for small icons) (look at the sample prg for more)

- AllowNetwork      : enables/disables displaying of network-drives}

** V1.12 **

- GoBelowRecycleBin : enables/disables displaying of recycle bin's sub-directories

- DropDirectory     : the directory of the droptarget-node

** V1.13 **

- GetNodefromPath(path:string):ttreenode : returns the node belonging to the specified path
	if the path doesn't exist or the node is not yet created, it returns nil				      		

** V1.14 **
- RenamePart(oldpath,newname:string)
   renames the node belonging to the given path and update the children

- DeletePart(dpath:string)
   deletes the node belonging to the path and all its kids

- AddPath(expath,newsub:string)
   adds a new sub dir to the children of the existing path expath

** V1.15 **
- FastLoad : if true then do not check whether there are subdirectories at startup, just show all
   root items                                                        

- ClearNode(node:ttreenode) : delete all children of a specified node to add some kinda dynamic support (e.g. in
   OnCollapsed - event, next time node gets expanded, it will reread the subdirs).

** V1.16 **
NOTE: changed the format of OnAddDir, could cause a compiler error in existing applications
      moved the ShellIcons property to the public section, ''
      changed TDirName-Objects to TDirEntry-Records, ''

- OnGetIcon : here you can assign a custom event handler to use custom icons 
- OnFindDir : here you can assign a custom event handler for adding other files than directories to the tree      

the following three functions are no object functions, they are just exported :
- GetSysPathName( Path : string ) : string and
- GetShellPathName( Path : string ) : string to get "nice" names from the always uppercase directory-property
- FileOrDirExists( Path : string ) : returns the same as (FileExists(..) or DirectoryExists(..)) 

** V1.16a **

added tag-fields to the tdirrec and tdirentry-structures

** V1.17 **

fixed problem with removable drives, cd-roms will automatically be updated, floppies will be updated by clicking
a floppy's node (or one of its subfolders)

added procedure :

procedure ForcePath ( Path : string );  // to force adding a complete path to the tree, credits to ashley bass

** V1.18 **

added procedure GoUp ( CollapseCurrent : Boolean ) to change to the Parent Directory, thanx to gerd volk gvolk@metronet.de for this suggestion

added property InitialDirectory : TFileName to set an initial directory
      +++property Directory isn't published anymore. in delphi, you now can use this new             property instead to select a directory on startup

********** revision 1.19 (jun 15,1998)

 fixed problem that tdirtree doesn't show anything in the ide

 added function CheckDrives :Boolean : checks if drives have been removed and/or added to the system, if so the return true

 added procedures BeginUpdate / EndUpdate to avoid too much change events getting fired



********** revision 1.20 (jun 20,1998)

 removed AllowNetWork property, instead added property :

 DriveTypes : [drtUnknown , drtRemovable , drtFixed , drtRemote , drtCDRom , drtRamDisk]
              what drivetypes to show ?

********** revision 1.21 (jul 04,1998)

 added property ShowShareOverlay : Boolean (default : False )
       if this is set to true, all paths that are shared will get a "hand" overlay icon
       (thanx for the idea to ashley bass )

 some code rewritten to be compatible with delphi 2, thanx to ash

********** revision 1.22 (jul 05,1998)

 added compiler switch MPDTSUBCLASS, if this condition isn't defined, no subclassing will be  
 generated and no wm_devicechange message will be captured ( there was an error reported by 
 harrie rooymans harrie.rooymans@tip.nl with the raize splitter component, i hope 
 subclassing is the problem, but i cannot check this )

 added property AcceptDropFiles : Boolean ( default : False )
       if this is enabled, cursor will change if files are dragged from explorer to the 
       dirtree and an event (s.b.) will get fired on dropping these files to dirtree

 added event OnDropFiles ( Sender : TObject ; x , y : Integer ; aDropDir : strings ; 
                           aDropFiles : TStrings ; Shift : TShiftState);
       this is fired when acceptdropfiles is true and some files from explorer are dropped 
       to tdirtree

 a bug with recreating the handle / the owner's handle fixed ( thanx to marcus luk 
 marcusl@globalpac.com for reporting)

**************History********************************

V 1.01 : first published release 04/01/97
V 1.02 : faster reloading, added property readonstart 04/04/97
V 1.1  : now it should run under NT without getting asked to insert a floppy disk or cd-rom,
		 added some properties 07/07/97
V 1.11 : some bugs fixed (hopeso) 07/18/97
V 1.12 : some bugs fixed, added properties 09/29/97
V 1.13 : added function getnodefrompath 10/11/97
V 1.14 : added procedures/functions and fixed a problem with BCB (items -> Items) 02/06/98
V 1.15 : added property FastLoad, added proc clearnode, speeded up getting "+"button state 02/27/98
V 1.15a: fixed another problem with BCB (Readonly -> ReadOnly) 03/08/98
V 1.16 : added some new stuff, error handling under nt, much stuff rewritten, details in dirtree.pas 03/14/1998
V 1.16a: added tag-fields to the directory-records 03/15/1998
V 1.17 : added ForcePath procedure , added automatic reloading of changed CD-Rom
V 1.18 : added GoUp procedure , added property InitialDirectory, use this rather than 
	 directory in delphi ide 06/13/1998
V 1.19 : fixed problem with showing nothing in delphi, added CheckDrives, BeginUpdate /
	 EndUpdate  06/15/98
V 1.20 : removed AllowNetwork property, therefore added DriveTypes to decide what types of
	 drives to show in TDirTree 06/20/98
V 1.21 : added property ShowShareOverlay to show "hand" icon for shared directories
         Some code rewritten so that TDirTree can now be compiled under d2 again 07/04/98
V 1.22 : added compiler switch to avoid subclassing owner's window procedure
	 added support for drag'n'drop files from explorer
         problem with recreating the window handle fixed 07/05/98 / 11/25/98:delphi 4 support
V 1.23 : fixed a bug with displaying nothing at startup when using different font sizes
	 (large/small) at design/run time

credits to all the people who reported bugs and suggestions to me,
especially to Feng Ting, Davendra Patel, Yuval Perlov, Doug Hay, botevi@bu.omega.bg, 
Sebastian Hildebrandt, Heiko Webers, Keith Speers, Ashley Bass, Jean Louis LeClef, 
Demian Lessa, Herbert Sauro, Adam Roslon, Jason Baldwin, Gerd Volk, 
Eric and Pat Leidlmair, Gerd Volk, MicheliN, Victor K
and all the others i forgot now...


Viel Spa beim Programmieren wnscht

Markus.

