HistoryFiles/fr

From Lazarus wiki
Jump to navigationJump to search

English (en) français (fr)

About

This component store the recent files list into an .ini file and show the result into a menu. It's possibile to insert the list into any point of your menu. A method help you to have access of all property and method of the Menu Items so for example do you can specify the image of each items.

The download contains the component, and two demo projects: one for Lazarus and one for Delphi.

Author

Andrea Russo

License

LGPL

Download

The latest stable release can be found on the Lazarus CCR Files page.

Change Log

  • Version 1.2.1 2009/05/22 new demo compatible with latest Lazarus version (tested on Lazarus 0.9.26.2), new demo for Kylix 3 Open Edition;
  • Version 1.2 mis à jour le 2009/05/22

Dependencies / System Requirements

  • None

Notes

Status: Stable

Issues: Tested on: Lazarus 0.9.18; Delphi 2,3,4,6,7,D2005,D2009 all personal or standard editions; Kylix 3 Open Edition

Installation

Open the package HistoryLazarus.lpk, compile and install it.

Usage

Properties


  • FileMustExist
    If true the files that don't exists will be deleted from the history list
    (default False)
  • IniFile
    This is the name of the IniFile with full path
    (default History.ini)
  • IniKey
    This is the name of the key into the ini file
  • LocalPath
    If specified all the files that have the path equal to LocalPath are shows into the list without the path.
    If ShowFullPath is false this value it's indifferent.
  • MaxItems
    This is the max lenght of the recent list showed and stored into the ini file (it's a lifo list).
    (default 5)
  • ParentMenu
    This is the TMenuItem parent of the history list.
  • Position
    This is the insert position of the list into the parent menu.
    The possible position is between 0 and the value of ParentMenu.Count
  • Separator
    To divide the list by the other menu items if do you want.
    Possible values: sepNone, sepTop, sepBottom, sepBoth
    (default sepNone)
  • ShowFullPath
    If true the file names are showed with full path otherwise not.
    (see also the LocalPath property)
    (default True)
  • ShowNumber
    If true an item number is showed before the file name.
    (default True)
  • Sorted
    If true the list is sorted.
    (default False)
  • Count
    Indicates the number of items of the history list.
    (read only)

Methods


  • UpdateList(thefile: string)
    Insert the file into the list and rebuild the history menu.
  • UpdateParentMenu
    Rebuild the menu
    (called also by UpdateList).

Events


  • OnClickHistoryItem
    procedure (Sender: TObject; Item: TMenuItem; const Filename: string)
    When one history item is clicked this event returns the related file name.
    By this event do you personalize the item menu clicked (properties like image or checked; or assign events like OnDrawItem,etc.).
  • OnCreateItem
    procedure (Sender: TObject; Item: TMenuItem; const Filename: string)
    When an history item is inserted into the parent menu this event returns this item and the filename.
    By this event do you personalize each item menu (properties like image or checked; or assign events like OnDrawItem,etc.).

Warning: Don't modify the tag property of the TMeuItem created by this component, this property is used into the source code.

Warning: Don't re-assign the OnClick events that it's used by the component to return the filename (OnClickHistoryItem);

The Demo Example Application

The zip file contains a demo project for Lazarus into the DemoLazarus folder.