home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d123456 / DFS.ZIP / BrowseDr.txt < prev    next >
Text File  |  2001-06-28  |  19KB  |  320 lines

  1. TdfsBrowseDirectoryDlg v2.62
  2.  
  3.  
  4. Description:
  5.   A dialog that displays the user's system in a heirarchial manner and
  6.   allows a selection to be made.  It is a wrapper for SHBrowseForFolder(),
  7.   which is rather messy to use directly.
  8.  
  9.  
  10. Contact Information:
  11.   The lateset version will always be available on the web at:
  12.     http://www.delphifreestuff.com
  13.   If you have any questions, comments or suggestions, please use the Delphi
  14.   Free Stuff Support Forum at: 
  15.     http://www.delphifreestuff.com/discus/
  16.   If, for some reason, you can not use the web-based support forum, you can
  17.   email me at bstowers@delphifreestuff.com.  However, the support forum will
  18.   always take precedence over direct email since it provides a resource that
  19.   others can use when they have a problem.  Every message posted to the forum
  20.   is emailed directly to this account, so emailing me directly will not get 
  21.   your message to me any faster.  It will only make the message less important
  22.   for me to respond to since only one person (you) is benefiting from it
  23.   instead of everyone interested.  Having said all that, please do email me 
  24.   directly if it is regarding something that isn't really support related, 
  25.   i.e. just to say thanks (as novel as that idea is).  
  26.  
  27.  
  28. Installation:
  29.   Delphi 1:
  30.     * This component is not compatible with Delphi 1.
  31.  
  32.   Delphi 2, C++Builder 1:
  33.     * Select the 'Component | Install' menu item.
  34.     * In the Install Components dialog, click the Add button.
  35.     * In the Add Module dialog, enter the full path name of the component's
  36.       registration unit (the unit that ends with 'Reg.pas', i.e.
  37.       'BrowseDrReg.pas') and click OK.
  38.     * In the Add Module dialog, click OK.
  39.     * The component library will be rebuilt and a new tab named 'DFS' will be
  40.       available on the Component Palette.
  41.  
  42.   Delphi 3, 4, 5, C++Builder 3 & 4:
  43.     * Do one of the following:
  44.       + Create a new package by selecting File | New and choosing Package from
  45.         the New tab in the dialog.
  46.       + Open an existing package file.  I suggest you do this if you already
  47.         have a package that you like to use for small, third party components.
  48.         I specifically have a package named "3rdParty.dpk" that I use for
  49.         small components that come from other people.  Or, if you are using
  50.         several of my components, you might create a "DFS.dpk" package and
  51.         use it for all of my DFS components.
  52.     * In the resulting package window, click the Add button.
  53.     * In the Add dialog, on the Add Unit tab, enter the full path name of the
  54.       component's registration unit (the unit that ends with 'Reg.pas', i.e.
  55.       'BrowseDrReg.pas') and click OK.
  56.     * You may want to add the other source files (*.pas) to the package as
  57.       well in the same manner as you did the registration unit.  While this is
  58.       not required, not doing it will cause compiler warnings when the package
  59.       is compiled.  The component will function fine either way, but I
  60.       personally find the warnings very irritating and am not happy until
  61.       every compiler warning and hint is gone.
  62.     * If this package is new, or it has never been installed, click the
  63.       Install button in the package window.  If this package is already
  64.       installed in Delphi, click the Compile button.
  65.  
  66.   C++Builder 5 and up:
  67.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  68.       for the last step (Compile or Install).
  69.     * Select the package the component has been added to, and choose
  70.       Project | Edit Option Source to open the package options in the editor.
  71.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  72.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  73.     * Perform the final step from above, Compile or Install.
  74.     * For Borland's official word on this situation, open the C++Builder help
  75.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  76.       packages with DsgnIntf" section.
  77.  
  78.   Delphi 6 and up:
  79.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  80.       for the last step (Compile or Install).
  81.     * Add the DesignIDE package to the Requires list of the package into which
  82.       the component is being installed.
  83.     * Perform the final step from above, Compile or Install.
  84.     * This is necessary because of changes to the design-time support units
  85.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  86.       file in your Delphi 6 Help directory.  In the index, search for
  87.       "upgrade issues" and in the resulting list of topics, select the
  88.       "DsgnIntf renamed and related changes" topic.
  89.  
  90.   Help File:
  91.     Delphi 3:
  92.       * Copy BrowseDr.Hlp to your Delphi\Help directory.
  93.       * Edit the DELPHI3.CNT file and add the following line to the Index section:
  94.           :Index TdfsBrowseDirectoryDlg =browsedr.hlp
  95.       * Delete the hidden Delphi3.Gid file.
  96.   
  97.     Delphi 2:
  98.       * Copy BrowseDr.Hlp and BrowseDr.Kwf to your Delphi\Help directory.
  99.       * Use the HelpInst tool included with Delphi to install the BrowseDr.Kwf
  100.         into Delphi\Bin\Delphi.Hdx file.
  101.   
  102.  
  103. Notes:
  104.   * If you are using C++Builder 1, you will get a compiler warning about the
  105.     CSIDL_INTERNET identifier redefininiton not matching.  The problem is that
  106.     it is defined in SHLOBJ.H but not in SHLOBJ.PAS, so I have to declare it.
  107.     But, when Builder creates the HPP file for the unit, it defines that
  108.     constant with "(byte)", whereas the SHLOBJ.H value has no explicit type.
  109.     I have no idea how to convince Builder 1 that this constant should be a
  110.     word, so you will either have to live with the compiler warning (it won't
  111.     hurt anything) or edit the BROWSEDR.HPP file and fix the define by hand:
  112.  
  113.       #define CSIDL_INTERNET 0x0001
  114.  
  115.     This problem has been solved in Builder 3 by using the $EXTERNSYM
  116.     compiler directive, but this is not supported in Builder 1.  If you know
  117.     how to get it to stop generating this "(byte)" type into the HPP file,
  118.     please email me.
  119.   * If you attach code to the OnSelChanged event, you will need to add ShlObj
  120.     to your uses clause (or MyShlObj -- see next note).
  121.   * Requires Delphi 3 or Delphi v2.01's ShlObj unit.  If you don't have the
  122.     2.01 update, you can get the equivalent using Pat Ritchey's ShellObj unit.
  123.     It is freely available on his web site at
  124.     http://ourworld.compuserve.com/homepages/PRitchey/
  125.     If you use either 2.01's ShlObj or Pat's ShellObj unit, see the included
  126.     ShellFix.Txt file for fixing bugs in them.  Delphi 3 has no known problems.
  127.  
  128.  
  129. Known Issues:
  130.   * Status text will not display computer names in network neighborhood.  I've
  131.     tried everything I know, but I just can't figure out why it won't work.
  132.  
  133.  
  134. Revision History:
  135.  2.62   + Updated for Delphi 6 compatibility.  See updated install directions
  136.           above.
  137.         + Worked on some problems with the status text label.
  138.  2.61   + Updated for C++Builder 5 compatibility.
  139.  2.60   + Setting Selection property to an empty string ('') after the dialog
  140.           had been displayed wouldn't clear the selection, so future executions
  141.           would revert to the last selection.  It only worked if you gave it a
  142.           specific directory, or if the dialog had never been displayed.
  143.         + Added new flags for Options property:
  144.            bfIncludeURLs: The browse dialog box can display URLs. The bfUseNewUI
  145.              and bfIncludeFiles flags must also be set. If these three flags are
  146.              not set, the browser dialog box will reject URLs. Even when these
  147.              flags are set, the browse dialog box will only display URLs if the
  148.              folder that contains the selected item supports them. When the
  149.              folder's IShellFolder::GetAttributesOf method is called to request
  150.              the selected item's attributes, the folder must set the
  151.              SFGAO_FOLDER attribute flag. Otherwise, the browse dialog box will
  152.              not display the URL.
  153.            bfNewDialogStyle: Use the new user-interface. Setting this flag
  154.              provides the user with a larger dialog box that can be resized. It
  155.              has several new capabilities including: drag and drop capability
  156.              within the dialog box, reordering, context menus, new folders,
  157.              delete, and other context menu commands.
  158.            bfShareable: The browse dialog box can display shareable resources on
  159.              remote systems. It is intended for applications that want to expose
  160.              remote shares on a local system. The bfUseNewUI flag must also be
  161.              set.
  162.            bfUseNewUI: Use the new user-interface including an edit box. This
  163.              flag is equivalent to bfEditBox and bfNewDialogStyle.
  164.  
  165.           NOTE:  All of these new flags require v5.0 of SHELL32.DLL.  Currently,
  166.           the only way to have v5.0 of SHELL32.DLL is to use Windows 2000.  I
  167.           suspect that Internet Explorer v5.5 may also install this version of
  168.           SHELL32.DLL when the final version is released, but this is purely
  169.           a guess on my part at this point.  However, these flags are ignored on
  170.           systems that do not have v5.0, so setting these flags and using the
  171.           dialog on an older system will have no adverse effect.  That means you
  172.           can use the new style dialog flag so that Windows 2000 systems will
  173.           show the new style dialog, while NT, 98, 95, etc. users will see no
  174.           change and continue to use the normal (old style) browse dialog.  Also
  175.           note that setting a flag that requires another flag will enable the
  176.           required flag, i.e. bfShareable requires bfUseNewUI, so setting
  177.           bfShareable to TRUE will also set bfUseNewUI to TRUE.  This further
  178.           means that you can not turn off bfUseNewUI until you have also turned
  179.           off all options that require it, i.e. bfUseNewUI can not be set to
  180.           FALSE until bfShareable is set to FALSE.  
  181.  2.59   + It's *really* D5 compatible now.  Small change between the D5 eval
  182.           version and the real, shipping D5 version broke it.
  183.  2.58   + Component classname changed.
  184.         + D5 compatibility.
  185.  2.57   + Updated for C++Builder 4 compatibility.
  186.  2.56   + Added public read-only Handle property that allows access to the
  187.           browse dialog window handle while available.
  188.         + The bfIncludeFiles Options value seems to require v4.71 of
  189.           SHELL32.DLL, even though this is not documented by Microsoft.  I have
  190.           determined that the option has no effect on a standard Win95 system,
  191.           regardless of what the docs say, so beware.
  192.  2.55   + At some point I "over-optimized" the SetEnableOKButton method, and
  193.           the EnableOKButton property wouldn't work right any more.
  194.  2.54   + Got rid of yet another of those pesky system error dialogs.  Thanks
  195.           again to Stefan Hoffmeister.
  196.  2.53   + Took care of the double error message dialogs when running on NT and
  197.           accessing a drive without a disk in it.  Since only the normal (i.e.
  198.           what you seen in explorer) error dialog is now displayed, this solves
  199.           the known issue about the caption being wrong in the other error
  200.           dialog.  Many thanks to Stefan Hoffmeister for fixing this.
  201.  2.52   + Added BrowseDrReg unit.  All IDE specific code (i.e. registering the
  202.           component, property editors, etc.) are contained in this unit.  This
  203.           was done for two primary reasons:  1) Using the component in a Delphi
  204.           or C++Builder expert would register the component as well.  2) Reduce
  205.           code size in some cases -- usually the smart linker removes this sort
  206.           of stuff since the app never references it, but now it's for certain
  207.           since it isn't even in the unit.  This change means that you need to
  208.           install the component using the new "registration" unit instead of
  209.           the unit containing the component.
  210.  2.51   + You could get a range check sometimes in when using with Delphi 4
  211.           because of change to the HFONT type in Windows.pas.  Fixed.  Thanks
  212.           to Jordan Russel for finding and fixing this.
  213.  2.50   + Added new Options property flag, bfEditBox.  This flag indicates that
  214.           an edit box should be displayed above the tree view where the user
  215.           can type a selection.  This requires v4.71 of SHELL32.DLL (ships with
  216.           Internet Explorer 4.0 and above) be installed.  If not, the edit box
  217.           will simply not be there.
  218.         + Added new OnValidateFailed event.  This event fires when the user
  219.           types an entry into the edit box (see bfEditBox above) that is not
  220.           a valid path.  If bfEditBox is not specified, this event never fires.
  221.         + Updated the demo to show the new bfEditBox option and OnValidateFailed
  222.           event in use.
  223.  2.39   + Minor update for Delphi 4 compatibility (DFS.INC updated).
  224.  2.38   + Added Version property so you can quickly and easily tell what version
  225.           is installed in the IDE.
  226.  2.37   + Fixed bug that could cause lockups on NT machines.  Thanks to Michael
  227.           Lang (mwlang@mindspring.com) for finding it.
  228.  2.36   + Got the C++Builder 3 compiler to shut up about redefinition warning.
  229.  2.35   + Fixed problem with C++Builder 3 and run-time packages.
  230.  2.34   + Now *really* compatible with C++Builder 3.  See Notes section above.
  231.  2.33   + Now compatible with C++Builder 3.
  232.  2.32   + Fixed compatibility problem with C++Builder 1.
  233.  2.31   + Fixed bug that caused exception if Selection property was set to '\';
  234.  2.30   + Now has a help file!
  235.         + Added SelectionPIDL runtime property. See help file.  This has changed
  236.           the format of the OnSelChanged event.  You will need to regenerate
  237.           any event handlers you have for this.
  238.         + Added DisplayName property.  See help file.
  239.         + Added some new TRootID identifiers.  See help file.
  240.         + Using both bfComputers and bfDirectoriesOnly in the Options property
  241.           would not return valid paths.
  242.         + ShowSelectionInStatus property didn't work if StatusText property was
  243.           blank when Execute was called.
  244.  2.25   + Setting the Selection property to a UNC filename didn't work, only
  245.           local file paths did.  Fixed.  You can now assign it things like:
  246.             Selection := '\\shared_pc\shared_folder'
  247.           and it will start in that location if it exists; if not, it just
  248.           starts in the root.
  249.  2.24   + Updated for new DFS.INC file, component tab name, history/comments
  250.           file.
  251.  2.23   + Removed ShellMalloc._Release call under Delphi 3.  I thought this
  252.           was necessary for parameters allocated in functions where the
  253.           param was not "out".  Turns out this isn't the case, "var" params
  254.           will clean up themselves too.  So, what does "out" do then?
  255.           Thanks to Andrius Adamonis <andrius@prototechnika.lt> for pointing
  256.           this out to me.
  257.         + Problem with selecting hidden folders.  Thanks to David Taylor
  258.           <djtaylor@hermes02.globalnet.co.uk> for this.
  259.  2.22   + Will now return computer name if bfComputer is in Options property
  260.           It will NOT show the current name in the status text.  I can't
  261.           get it to work, so if anyone knows how, please email me.  Thanks
  262.           to Libor Kral (kral@brno.bohem-net.cz) for this one.
  263.  2.21   + Small change for C++Builder compatibility.
  264.  2.20   + Reintroduced the idDesktopExpand.  It still uses an undocumented
  265.           technique, but should be much more likely to survive the next
  266.           upgrade like IE4.
  267.         + idInternet is no longer enclosed in $IFDEFs.  Microsoft has
  268.           documented it, so it is an "official feature".  You still need to
  269.           be aware of the need for IE4 to be installed on the user's system.
  270.         + Added Caption property.
  271.         + Add Parent property to be more flexible about who the parent
  272.           window of the dialog is.
  273.         + Added ShowSelectionInStatus property.
  274.  2.10   + Updated to work with Delphi 3.
  275.         + Bug when used on machine with Internet Explorer 4.0 beta.  If you
  276.           want the new item (idInternet) available, define WANT_INTERNET
  277.           below.  NOTE: It is your responsibility to ensure that IE4 is on
  278.           the user's machine.  If it isn't, idInternet will cause idDesktop
  279.           to be the root, and will cause it to expand the first level.
  280.           There is no Internet root item on machines without IE4 installed.
  281.           I have removed the idDesktopExpanded item entirely since the
  282.           undocumented code I was using for it now has a documented purpose.
  283.         + Added bfIncludeFiles to Options.  Thanks to Arentjan
  284.           (ajbanck@pop3.worldaccess.nl) for this.
  285.         + Changed SetSelection so that it only appends backslash if the
  286.           selection is an existing directory.  Thanks to Arentjan for this.
  287.  2.03   + The area available for the status text is limited (by the API),
  288.           and using it for showing the selected path can cause that text to
  289.           wrapped around under the tree control.  As a work around for this,
  290.           I now test FStatusText to see if it is a valid directory, and if
  291.           so, shorten it using ellipses ("...") to make the most of the path
  292.           as possible fit.  If it is not a directory, the text is just
  293.           shortened at the end of the string.  This behavior can be disabled
  294.           by setting FitStatusText to FALSE.  It is enabled by default.
  295.  2.02   + Setting Selection property to 'C:\' would cause the root item to
  296.           be selected (i.e. Desktop) instead of the drive object.  Fixed.
  297.  2.01   + Added ImageIndex property to return the index of the selection's
  298.           image in the system image list.  See demo for how to use this.
  299.         + Made the interogation of of the parent window handle more robust.
  300.           Some people were doing property editors and it was breaking.
  301.  2.00:  + Calling as a function is no longer supported.  Too complicated to
  302.           support all the new properties that way.
  303.         + Added StatusText property.  If this property is empty ('') when
  304.           Execute is called, it will not be available during the life of
  305.           the dialog at all.
  306.         + Selected property changed to Selection.  Now available at design
  307.           time.  Setting the value causes that value, if it exists, to be
  308.           selected in the tree.
  309.         + Added EnableOKButton property.  Use in conjunction with the
  310.           OnSelChange event to control when the OK button is enabled.
  311.         + Simplified DoSelChanged method.  Boy, was I asleep when I wrote
  312.           that one... Doh.
  313.  1.01:  + Now uses Delphi 2.01 ShlObj unit.
  314.         + Added callback stuff.  See the DoInitialized and DoSelChanged
  315.           methods, Center property, and OnSelChange event.
  316.         + Added Center property.
  317.         + Added OnSelChange event.
  318.  1.00:  + Initial release
  319.  
  320.