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

  1. TdfsMRUFileList v2.67
  2.  
  3.  
  4. Description:
  5.   A component that greatly simplifies adding MRU file lists to menus.
  6.   Features:
  7.     Defineable maximum number of items to be maintained in the list.
  8.     Automatic removal of item when selected, or not.
  9.     Items can exist on selected menu, or on submenu of selected menu.
  10.  
  11.  
  12. Contact Information:
  13.   The lateset version will always be available on the web at:
  14.     http://www.delphifreestuff.com
  15.   If you have any questions, comments or suggestions, please use the Delphi
  16.   Free Stuff Support Forum at: 
  17.     http://www.delphifreestuff.com/discus/
  18.   If, for some reason, you can not use the web-based support forum, you can
  19.   email me at bstowers@delphifreestuff.com.  However, the support forum will
  20.   always take precedence over direct email since it provides a resource that
  21.   others can use when they have a problem.  Every message posted to the forum
  22.   is emailed directly to this account, so emailing me directly will not get 
  23.   your message to me any faster.  It will only make the message less important
  24.   for me to respond to since only one person (you) is benefiting from it
  25.   instead of everyone interested.  Having said all that, please do email me 
  26.   directly if it is regarding something that isn't really support related, 
  27.   i.e. just to say thanks (as novel as that idea is).  
  28.  
  29.  
  30. Installation:
  31.   Delphi 1:
  32.     * Select the 'Options | Install Components' menu item.
  33.     * In the Install Components dialog, click the Add button.
  34.     * In the Add Module dialog, enter the full path name of the component's 
  35.       registration unit (the unit that ends with 'Reg.pas', i.e. 
  36.       'BrowseDrReg.pas') and click OK.
  37.     * In the Add Module dialog, click OK.
  38.     * The component library will be rebuilt and a new tab named 'DFS' will
  39.       be available on the Component Palette.
  40.   
  41.   Delphi 2, C++Builder 1:
  42.     * Select the 'Component | Install' menu item.
  43.     * In the Install Components dialog, click the Add button.
  44.     * In the Add Module dialog, enter the full path name of the component's 
  45.       registration unit (the unit that ends with 'Reg.pas', i.e. 
  46.       'BrowseDrReg.pas') and click OK.
  47.     * In the Add Module dialog, click OK.
  48.     * The component library will be rebuilt and a new tab named 'DFS' will be 
  49.       available on the Component Palette.
  50.  
  51.   Delphi 3, 4, 5, C++Builder 3 & 4:
  52.     * Do one of the following:
  53.       + Create a new package by selecting File | New and choosing Package from
  54.         the New tab in the dialog.
  55.       + Open an existing package file.  I suggest you do this if you already
  56.         have a package that you like to use for small, third party components.
  57.         I specifically have a package named "3rdParty.dpk" that I use for
  58.         small components that come from other people.  Or, if you are using
  59.         several of my components, you might create a "DFS.dpk" package and
  60.         use it for all of my DFS components.
  61.     * In the resulting package window, click the Add button.
  62.     * In the Add dialog, on the Add Unit tab, enter the full path name of the
  63.       component's registration unit (the unit that ends with 'Reg.pas', i.e.
  64.       'BrowseDrReg.pas') and click OK.
  65.     * You may want to add the other source files (*.pas) to the package as
  66.       well in the same manner as you did the registration unit.  While this is
  67.       not required, not doing it will cause compiler warnings when the package
  68.       is compiled.  The component will function fine either way, but I
  69.       personally find the warnings very irritating and am not happy until
  70.       every compiler warning and hint is gone.
  71.     * If this package is new, or it has never been installed, click the
  72.       Install button in the package window.  If this package is already
  73.       installed in Delphi, click the Compile button.
  74.  
  75.   C++Builder 5 and up:
  76.     * Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
  77.       for the last step (Compile or Install).
  78.     * Select the package the component has been added to, and choose 
  79.       Project | Edit Option Source to open the package options in the editor.
  80.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  81.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  82.     * Perform the final step from above, Compile or Install.
  83.     * For Borland's official word on this situation, open the C++Builder help
  84.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  85.       packages with DsgnIntf" section.
  86.  
  87.   Delphi 6 and up:
  88.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  89.       for the last step (Compile or Install).
  90.     * Add the DesignIDE package to the Requires list of the package into which
  91.       the component is being installed.
  92.     * Perform the final step from above, Compile or Install.
  93.     * This is necessary because of changes to the design-time support units
  94.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  95.       file in your Delphi 6 Help directory.  In the index, search for
  96.       "upgrade issues" and in the resulting list of topics, select the
  97.       "DsgnIntf renamed and related changes" topic.
  98.  
  99.  
  100. Known Issues:
  101.   * The component doesn't work well with the TMenuBar component (from Borland's
  102.     downloads page).  I can find no reason for it, as TMenuBar is quite simple.
  103.     The problem must lie in either TMenu or TToolBar, and how I do things.
  104.  
  105.  
  106. Revision History:
  107. 2.67:  + Changing RemoveObsoleteName, ClearItemName, ShowRemoveObsolete or
  108.          ShowClearItem properties didn't have any effect at run-time until the
  109.          MRU list was rebuilt.
  110.        + Updated for Delphi 6 compatibility.  See updated install directions
  111.          above.
  112. 2.66:  + Updated for C++Builder 5 compatibility.
  113. 2.65:  + Fixed nasty bug that caused AVs on exit.
  114.        + If more than 10 items were in the list, the '&' shortcut would be
  115.          screwed up (i.e. &10 conflicted with &1, &11, &12, etc.).  Thomas
  116.          Weinert sent me a nice fix for this:  1 through 0 are used, followed
  117.          by A through Z.  After that, no shortcut is given.
  118. 2.64:  + Fixed nasty bug that caused the component to load mru items at design
  119.          time.  This led to all sorts of nastiness.  Still not sure how that
  120.          snuck in. 
  121. 2.63:  + It's *really* D5 compatible now.  Small change between the D5 eval 
  122.          version and the real, shipping D5 version broke it.
  123. 2.62:  + There was an issue with auto loading not always working the way you
  124.          would expect, especially when using INI files.  Fixed.
  125. 2.61:  + Classname changed.
  126.        + D5 compatibility.
  127. 2.60:  + Two new events, OnCreateMRUItem and OnDestroyMRUItem.  These events
  128.          fire, surprisingly enough, when an MRU menu item has been created
  129.          (and had it's properties set) or when an item is about to be destroyed.
  130.          You can use these events to do things like set the ImageIndex property
  131.          (in D4) of the menu item.  You could also allocate some memory to be
  132.          associcated with an item in OnCreateMRUItem, and free that memory in
  133.          OnDestroyMRUItem.  In anticipation of the question I'm about to be
  134.          asked 50 times, you can tell MRU items that are "real" items (i.e. a
  135.          file the user has closed) from the "helper" MRU items (like the
  136.          seperator items and Remove Obsolete commands) by checking to see if the
  137.          Item.ItemNumber is greater than zero.  If it is, it's a "real" item.
  138.          I chose this approach over a property that exposes the menu items
  139.          themselves because the menu items change so much.  That is, if you just
  140.          had a property that contained all of the menu items, you'd have to know
  141.          when things changed so that you could go back and walk that list
  142.          resetting things like ImageIndex.  This method seems simpler from both
  143.          a usage (you) and implementation (me) standpoint.
  144. 2.50:  + Ugo Bernasconi added the MRUDisplay property.  I've extended it a bit,
  145.          and here's how it works:
  146.            mdFullPath:     Same behavior as prior versions.
  147.            mdFileNameExt:  Displays just the file name and extension.
  148.            mdFileNameOnly: Displays just the file name.
  149.            mdCustom:       Fires the OnGetDisplayName event, and uses whatever
  150.                            that handler places in the ADisplayName paramter.
  151.                            Upon entring the event, it will hold the same value
  152.                            as mdFullPath, but without it being shortened.
  153. 2.41:  + Having more than one MRU component use the same submenu for displaying
  154.          the MRU items would cause problems.  Many thanks to Eric Grange for
  155.          finding and fixing this.
  156. 2.40:  + Change order of declaration of UseRegistry property so that it is the
  157.          first property streamed in from the DFM file.  Also changed it to
  158.          'nodefault' so that a value is always streamed in.  This makes it
  159.          behave better when UseRegistry is set to FALSE at design time.
  160. 2.39:  + AutoSaveKey property didn't like to be changed when AutoSave was on.
  161. 2.38:  + Added MRUFLReg unit.  All IDE specific code (i.e. registering the
  162.          component, property editors, etc.) are contained in this unit.  This
  163.          was done for two primary reasons:  1) Using the component in a Delphi
  164.          or C++Builder expert would register the component as well.  2) Reduce
  165.          code size in some cases -- usually the smart linker removes this sort
  166.          of stuff since the app never references it, but now it's for certain
  167.          since it isn't even in the unit.  This change means that you need to
  168.          install the component using the new "registration" unit instead of
  169.          the unit containing the component.
  170. 2.37:  + Moved hard-coded strings to resourcestrings for Delphi/Builder 3 and
  171.          higher.  They are normal consts for older compilers.  This aids in
  172.          internationalizing an app.
  173. 2.36   + C++Builder doesn't like registry keys that don't end with a '\' char.
  174.          Delphi doesn't care.  I've updated the AutoSaveName property so that
  175.          it automatically appends a '\' on the end if there isn't one and it
  176.          is being used in C++Builder.
  177. 2.35   + The new Clear and Remove Obsolele menu items did not work well with all
  178.          possible options.  They have been cleaned up.
  179.        + New OnRemoveObsolete event.  This event is fired by the new
  180.          RemoveObsoleteItems for each MRU item.  You can use the event to
  181.          determine if the item is obsolete or not.  If the event is not
  182.          assigned, RemoveObsoleteItems assumes that each MRU item is a filename
  183.          and deletes the MRU item if that filename does not exist.  If the event
  184.          is assigned, your event handler decides what is obsolete (to be removed
  185.          from the MRU list) and what is not (not to be removed). The
  186.          OnRemoveObsolete event is useful if your MRU items are not filenames;
  187.          otherwise, you should be able to ignore this event and just let the
  188.          component handle it all.
  189.          RemoveObsoleteItems is useful for automatically cleaning up the MRU
  190.          menu, at program startup for example.
  191. 2.30   + Added four new related properties: ClearItemName, ShowClearItem,
  192.          ShowRemoveObsolete, RemoveObsoleteName.  The ShowXXX properties control
  193.          whether those items are visible on the MRU menu, and XXXName properties
  194.          allow you to change the text for those menu items.  The menu items do
  195.          pretty much what you would expect; Clear removes all items from the
  196.          MRU menu, and RemoveObsolete verifies that all items exist (it assumes
  197.          they are files) and removes them if they do not.  These features were
  198.          added by Coda Hale  <kenhale@dcalcoda.com> and many thanks go to him
  199.          for sharing.
  200.        + Added PopupMenu property.  I find this property useful for dealing with
  201.          a popup menu that I've attached to a tbsDropDown Style TToolButton's
  202.          DropDownMenu property. That lets you do a File Open toolbar button with
  203.          a dropdown that shows the MRU files.  Note that I've not done much in
  204.          the way of special handling of the popup, i.e. it is assumed that all
  205.          that will be on the popup menu is the MRU items.  If you put your own
  206.          items on it, the MRU code will remove them during population.  Also,
  207.          the new RemoveObsolete and ClearItems stuff aren't on the popup.  I
  208.          consider it (a dropdown toolbar menu) to be a shortcut to the real MRU
  209.          items, and only wanted the files on there.  I could be persuaded
  210.          otherwise if enough people tell me that they belong on both.
  211. 2.23   + Changing AutoSaveName at runtime will cause the MRU items to be
  212.          reloaded automatically.
  213.        + Fixed bug where inherted Loaded was never called.
  214. 2.22   + Minor change to get rid of compiler warning under Delphi 4.
  215. 2.21   + Added Version property.
  216.        + When using the registry to save items, if you assigned a key value
  217.          that did not begin with a '\' character to AutoSaveName, it would seem
  218.          to double the key.  Property now automatically inserts '\' if needed.
  219. 2.20   + Added new boolean property AddToTop.  If TRUE, items added with AddItem
  220.          method will be placed at the top of the list; if FALSE, they are placed
  221.          at the end of the list.  Also, if TRUE, extra items (when Maximum is
  222.          exceeded) are removed from the end of the list; if FALSE, the are
  223.          removed from the top of the list.
  224. 2.16   + Fixed problem with C++Builder 3 run-time packages.
  225. 2.15   + Updated for new DFS.INC file, component tab name, history/comments
  226.          file.
  227. 2.14   + Added UseRegistry property for D2/D3.  Now Win32 users can use
  228.          INI file.
  229.        + Added AutoSaveRootKey.  Can now use other than HKEY_CURRENT_USER
  230.          registry root key (D2/D3 only).
  231.        + Renamed RemoveItem to ClearItem, and added ClearAllItems method.
  232.          The RemoveAllItems method is generally not for applications as
  233.          it only removes items from a menu, not from the internal list.
  234.          ClearItem removes an item from the menu and the list, and you can
  235.          probably guess what ClearAllItems does.  :)
  236. 2.13   + Couple of silly mistakes because I renamed a bunch of stuff in
  237.          v2.12.  Thanks to Jean-Fabien Connault for pointing it out to me.
  238.        + Small change for C++Builder compatibility.
  239. 2.12   + Fixed bug in AddItem method.
  240.        + Fixed possible GPF in RemoveAllItems method.
  241.        + Fixed bug causing shortened items to lose their accelerator nums.
  242.        + Renamed to MRUFList.pas because of conflict with RX Lib.
  243.          UPGRADERS: MAKE SURE YOU DELETE OLD MRULIST VERSIONS OF THIS FILE.
  244.        + InsertItem did not honor the Index if the item was already in
  245.          the list.  It always moved to the top.
  246.        + Changed all "TFilename " types to "string" types because of a bug
  247.          in D2/D3 with the Huge Strings compiler option turned off.
  248. 2.11   + SetMaximum write method had a bug that could cause index
  249.          exceptions.  Thanks to Tim Frost.
  250. 2.10   + New property MaxCaptionWidth.  Set to 0, this performs as it
  251.          always has, however, setting it to reasonable width causes the
  252.          item to be shortened using '...' so that it does not take up more
  253.          space than specified.  Experiment with it for a few minutes and
  254.          you will see how it works.
  255. 2.07   + RemoveAllItems had a memory leak.  Plugged it.  Thanks to Robert
  256.          Galle (robert.galle@guest.arnes.si) for catching this one.
  257. 2.06   + Changed AddItem to work like other TList.Add methods, i.e. adds
  258.          the item to the end of the list.  If you are like me and prefer
  259.          that new items be added to the top of the MRU list, use the new
  260.          InsertItem method with an index of 0.
  261.        + Added ReplaceItem method to replace an existing MRU item with a
  262.          new one.  Thanks to Artem Berman (art@aber.kherson.ua) for this.
  263. 2.05   + Fixed nasty bug.  If you deleted the menu item that FileMenu
  264.          contained, it would cause all sorts of trouble.  See Notification
  265.          method override.
  266. 2.04   + Added "InsertSeparator"-Property (modification by Stefan Schlott)
  267. 2.03   + Changing the MRU list during the OnMRUItemClick event could lead
  268.          to corrupted values in the MRU list.  Fixed.
  269. 2.02   + Fixed problem with submenu not appearing in the right position.
  270. 2.01   + Added RemoveItem to remove a single item. Thanks to Peter Zehnder
  271.          (email: zehnderp@dial.eunet.ch) for this.
  272.        + RemoveItems renamed to RemoveAllItems because it will cause less
  273.          confusion with new RemoveItem method.
  274. 2.00:  + How about that?  A 1.00 release without any bug fixes!?!
  275.        + Added the ability to have MRU items appear at a specific place
  276.          on a menu.  If you select a submenu for the FileMenu property
  277.          (like the File menu), the items are appended to the end of that
  278.          menu.  If you select a menu item (like the Exit item), MRU items
  279.          will be inserted before that item.  I suggest you select a
  280.          separator because the list will create a separator of it's own,
  281.          and this will offset the entire MRU list.
  282.        + Added automatic saving and restoring of items.  If compiled under
  283.          Delphi 1.0, it saves to an INI file.  If D2, the registry.
  284.          This involves three new properties:
  285.            AutoSave:     Should items be saved and restored.
  286.            AutoSaveName: The filename (INI) or key (registry) to save to.
  287.            AutoSaveKey:  The section to save to.
  288.          For the registry, it would look like user\AutoSaveName\Key.
  289.        + Resource for 16 and 32-bit version.  This takes the place of a
  290.          DCR file, which can't be compatible with both.  See the $R
  291.          directive below.  To compile the resource file, use the following
  292.            Delphi 1: BRCC.EXE -foMRUList.r16 -31 MRUList.rc
  293.            Delphi 2: BRCC32.EXE -foMRUList.r32 -w32 MRUList.rc
  294. 1.00:  + Initial release
  295.  
  296.