Sign in Join
Wiki copytemporary

HistoryFiles: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: HistoryFiles

OldNewLine
1+### About
2+
3+This component stores the recent files list into an .ini file and shows the result into a menu. It's possible to insert the list into any point of your menu. A method helps you to have access to all the properties and methods of the Menu Items, so for example you can specify the image of each item.
4+
5+The download contains the component and two demo projects: one for Lazarus and one for Delphi.
6+
7+### Author
8+
9+Andrea Russo
10+
11+### License
12+
13+[LGPL](http://www.opensource.org/licenses/lgpl-license.php)
14+
15+### Download
16+
17+The latest stable release can be found on the [Lazarus CCR Files page](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=208312).
18+
19+### Change Log
20+
21+- Version 1.3.1 2019/12/16 Fix for Freepascal \> 3.0; tested on Lazarus 2.0.6
22+- Version 1.3.0 2014/07/09 Added LastItemIndex, GetItemValue, DeleteItem, ItemBitmap, ItemSelectedBitmap, CheckLastItem, ClearLastItem. New demos for Delphi and Lazarus. Added unicode support for Lazarus. Tested on Lazarus 1.2.4
23+- 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;
24+- Version 1.2 2006/10/12
25+
26+### Dependencies / System Requirements
27+
28+- None
29+
30+### Notes
31+
32+Status: Stable
33+
34+Issues: Tested on: Lazarus 2.0.6 (on Windows 10 and Debian); Delphi 2,3,4,6,7,D2005,D2009, D10.2 all personal or standard editions; Kylix 3 Open Edition
35+
36+### Installation
37+
38+Open the package HistoryLazarus.lpk, compile and install it.
39+
40+### Usage
41+
42+Properties
43+
44+------------------------------------------------------------------------
45+
46+- FileMustExist\
47+ If true the files that don't exists will be deleted from the history list\
48+ (default False)
49+
50+- IniFile\
51+ This is the name of the IniFile with full path\
52+ (default History.ini)
53+
54+- IniKey\
55+ This is the name of the key into the ini file
56+
57+- LocalPath\
58+ If specified all the files that have the path equal to LocalPath are shows into the list without the path.\
59+ If ShowFullPath is false this value it's indifferent.
60+
61+- MaxItems\
62+ This is the max lenght of the recent list showed and stored into the ini file (it's a lifo list).\
63+ (default 5)
64+
65+- ParentMenu\
66+ This is the TMenuItem parent of the history list.
67+
68+- Position\
69+ This is the insert position of the list into the parent menu.\
70+ The possible position is between 0 and the value of ParentMenu.Count
71+
72+- Separator\
73+ To divide the list by the other menu items if do you want.\
74+ Possible values: sepNone, sepTop, sepBottom, sepBoth\
75+ (default sepNone)
76+
77+- ShowFullPath\
78+ If true the file names are showed with full path otherwise not.\
79+ (see also the LocalPath property)\
80+ (default True)
81+
82+- ShowNumber\
83+ If true an item number is showed before the file name.\
84+ (default True)
85+
86+- Sorted\
87+ If true the list is sorted.\
88+ (default False)
89+
90+- Count\
91+ Indicates the number of items of the history list.\
92+ (read only)
93+
94+- CheckLastItem\
95+ If true the last item used it's automatically checked\
96+ (with a normal check or with an image if the ItemSelectedBitmap it's assigned)
97+
98+- ItemBitmap\
99+ If it is assigned is the image used for the menù items
100+
101+- ItemSelectedBitmap\
102+ If it is assigned is the image used for the menù item selected (if CheckLastItem=true)
103+
104+- LastItemIndex\
105+ It's the relative index (0..Count-1) of the last item used (selected or added)
106+
107+Methods
108+
109+------------------------------------------------------------------------
110+
111+- UpdateList(thefile: string)\
112+ Insert the file into the list and rebuild the history menu.
113+
114+- UpdateParentMenu\
115+ Rebuild the menu\
116+ (called also by UpdateList).
117+
118+- GetItemValue(const Index : integer): string\
119+ The index is the relative index into the history list (0..Count-1).\
120+ Return the value (the full filename) assigned at the item.
121+
122+- DeleteItem(const Index : integer)\
123+ The index is the relative index into the history list (0..Count-1).\
124+ Delete the item from the menù.
125+
126+- ClearLastItem\
127+ Clear the value of LastItemIndex
128+
129+Events
130+
131+------------------------------------------------------------------------
132+
133+- OnClickHistoryItem\
134+ procedure (Sender: TObject; Item: TMenuItem; const Filename: string)\
135+ When one history item is clicked this event returns the related file name.\
136+ By this event do you personalize the item menu clicked (properties like image or checked; or assign events like OnDrawItem,etc.).
137+
138+- OnCreateItem\
139+ procedure (Sender: TObject; Item: TMenuItem; const Filename: string)\
140+ When a history item is inserted into the parent menu this event returns this item and the filename.\
141+ By this event you can personalize each item menu (properties like image or checked; or assign events like OnDrawItem,etc.).
142+
143+> **Warning:** Don't modify the tag property of the TMenuItem created by this component, this property is used in the source code.
144+
145+> **Warning:** Don't re-assign the OnClick events that's used by the component to return the filename (OnClickHistoryItem);
146+
147+### The Demo Example Application
148+
149+The zip file contains a demo project for Lazarus into the DemoLazarus folder.
150+
151+### See also
152+
153+- [[Using INI Files]]
154+
155+---
156+*From the Free Pascal wiki, page "HistoryFiles", as it stood on 2019-12-16 after a change by Arusso, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
157+Category: Components
158+Category: Lazarus-CCR

Back to history