TRecentMenu is a component that records the
history of files loaded by your program very easy by using only two functions.
This component can arrange the files list in menus and load file icons from
shell.
Top
- Run Delphi.
- Choose "Install Component..." from "Component" menu.
- Select "MCoPRecentMenu.pas"
- Select a package.
- Click OK.
- Add "res.dcr" to the packege.
- Compile the packege.
- Choose "Environment Options..." from "Tools" menu.
- Choose "Library" tab.
- Add "RecentMenu" directory to "Library Path".
- Click OK.
- Component will be appeared on "dihav" tab in "Component Palette".
Top
- AddToWindowsRecent: Boolean
Determines if the file added to windows recent documents.
- MaxNumberOfFiles: Integer
The maximum number of files that will be stored.
- Menus:
TRecentMenuParentItems
The list of menus to add recent files items.
- RegistryKey:
String
The registry key that data will be stored.
- OnClick:
TRecentItemClick
When a recent item on the menus clicked this event will be occurred.
- OnCreateItem:
TRecentItemChange
When a recent item created this event will be occurred.
- OnDestroyItem:
TRecentItemChange
When a recent item destroyed this event will be occurred.
Top
- procedure AddFile(FileName: TFileName);
Adds
the given file to the recent.
- procedure MakeRecentMenus;
Use this procedure every time you want to make menus or refresh items.
Top
- TCaptionFormat
= (cfFileName, cfFileNameWithExtension, cfFileAddress);
-
TRecentItemClick = procedure (Sender: TMenuItem; FileName: TFileName) of
object;
The Sender is the menu item that is clicked and the
FileName is the address and name of the file.
- TRecentItemChange = procedure (Sender:
TRecentMenu; Item: TMenuItem; FileName: TFileName) of object;
The
Item is the item that is created or destroyed and FileName is the address of
its file.
-
TRecentMenuParentItems = class(TOwnedCollection)
Collection of TRecentMenuParentItem for more help visit Delphi help about
TOwnedCollection.
Top
This class records the menu that displays recent
files
- CaptionFormat:
TCaptionFormat
Determinates the
items caption format.
- DisplayFileNumber:
Boolean
Determinates if the number of the files displays on the
caption.
- ExtractFileIconFromShell:
Boolean
Determinates if the icon extracted from shell. (Your menu
must have an ImageList)
- Hint: String
The
items hint format.
- ImageIndex: Integer
The image
index of items. (Your menu must have an ImageList)
- InsertionIndex: Integer
The
position of the items in the menu.
- MaxNumberOfFiles: Integer
The maximum number of files that will be displayed in the menu.
- MaxWidth:
Integer
Specifies the maximum width of item caption, if you don't
want to set limit set this property 0.
Do not set this property
less than 50 otherwise your program will trapped in a loop.
The control uses desktop window font to measure the
width of the text.
- ParentItem: TMenuItem
The
parent item that will contain recent items.
- ParentMenu: TPopupMenu
The
menu that will contain recent items.
For more help visit Delphi help about
TCollectionItem.
Top
Visit dihav website.