==============================================================================
==                                                                          ==
==  TFileHist v1.0 - VCL Component for Delphi 2.0                           ==
==                                                                          ==
==  Purpose: Maintain a history of recently used files                      ==
==                                                                          ==
==============================================================================

The TFileHist component features a number of functions to present a list of
recently opened files in an application. 

==========
Highlights
==========

* INI file maintenance
Automatically stores the file list in the application INI file. The INI file
name can be specified explicitly, or left to default to the application name
+ .INI in the application EXE directory.

* Menu Control
Automatically populates a chosen MenuItem. This can be a menu bar item (e.g. place 
the items at the bottom of the File Menu), a stand-alone menu bar item, or as
a sub-menu on a main menu or popup menu. If the menu already contains items 
(e.g. the File menu) a divider is added to the menu. The menu items for the files
are given short cut keys 1-9.

* History
A maximum of 9 items will be held. This is based on a practical limit of items 
to add to a menu, and the provision of a single shortcut key for each item.
New file names are added to the top of the list, with the oldest file being dropped
if at the limit of 9. The FileAdd method checks for the addition of duplicates,
and will remove the older occurence before adding the new item.

* Option to add a Clear History item to the selected menu. If enabled, and the option is chosen, a warning dialog is presented. If Yes chosen, the history will be cleared.

* Simple event to respond to file selection from the menu. The FileSelected event
has two parameters - FileName and ReOrder. FileName is obvious!! ReOrder is a 
Boolean var parameter which defaults to True. A True value will cause the selected
file entry to be promoted to the top of the history list. This is the normal 
behaviour in most commercial applications. Setting the value to False leaves 
the history order as is. For example, if a dialog is shown for OK/Cancel, and Cancel 
is selected, setting ReOrder to False will protect the history order.

* Simple method (AddFile) to add new items.

* ClearHistory method clears the internal list, the menu items, and the INI file. Unlike the Clear History menu item, no warning is given for an explicit  clear.

============
Installation
============

Standard stuff here. Copy the FileHist.DCU, FileHist.DCR and jtSplash.DCU files
to your standard add-ons directory (or anywhere on the VCL path), and use the
Component/Install menu option. The component will be added to the Samples page.

===============
Using THistFile
===============

1. Add a TFileHist component to your form.

2. Set the MenuItem property, using the popup list in the Object Inspector.

3. If you wish, enter a file name for the INI file entries.

4. At some appropriate place in your code, use the following to add items:

    FileHist1.AddFile(TheNewFileName)

5. Write an event handler for the OnFileSelected event. The generated handler is:

     procedure TForm1.FileHist1FileSelected(FileName: string; 
       var ReOrder: Boolean);

   Use the provided FileName to take the desired action. Set ReOrder to
   False if you want to preserve the existing order history.

6. To give the user the ability to clear the history, set the ShowClear property to True (this is the default).

7. To clear the item list explicitly, (perhaps based on a menu option) use the call:

    FileHist1.ClearHistory;

  ..... and that's all there is to it!


===========
Sample Apps
===========

3 sample applications are provided to demonstrate various ways of using
the THistFile component. They are stored in separate directories DEMO1/2/3.
Briefly, these apps are:

1. MDIAPP. Based on standard Delphi MDI template. Code added to store names of
files opened, and to process the OnFileSelected event. Modified the CreateMDIChild
procedure to check if file already open, in which case that window is made active.

2. TestHist. Demo to experiment with varies aspects of the component. Attach the
recent files list to various menus and submenus, add/clear files, etc. Note the
enabling/disabling of menus, adding divider lines where appropriate, etc.

3. PopupMRU. Show use of TFileHist on a popup menu. Simple BMP browser.

===================
Product Information
===================

This is released as freeware, without source, for personal or non-profit use only. 
All I ask is a credit in your splash screen or About Box.

For commercial or shareware use, please contact the author for details.

=============
Contacting Me
=============

Internet   : johntait@iol.ie

Compu$erve : 100420,2764

/////////////////////////////////////////////////////////////////////////////

John Tait-Doak
Dublin,
Ireland.
