| Class TMRUFileList (unit MRUFList) |
TComponent
| Constructors |
constructor Create(Owner: TComponent);| Functions |
procedure AddItem(aFile: string);
procedure AddStringList(Files: TStringList);
procedure AddStrings(Files: TStrings);
procedure ClearAllItems;
procedure ClearItem (aFile: string);
destructor Destroy;
procedure InsertItem(Index: integer; aFile: string);Call the users event handler.
function Load: boolean;
procedure RemoveAllItems;
procedure ReplaceItem(OldItem, NewItem: string);
function Save: boolean;
function GetVersion: TDFSVersion;
procedure Loaded;
procedure MRUClicked(Sender: TObject);
procedure Notification(AComponent: TComponent; Operation: TOperation);
procedure PopulateMenu;Update menu now that all are added.
procedure SetAutoSaveName(const Val: string);
procedure SetFileMenu(Val: TMenuItem);
procedure SetInsertSeparator(Val: boolean);
procedure SetMaxCaptionWidth(Val: integer);
procedure SetMaximum(Val: byte);
procedure SetSubmenuName(Val: string);
procedure SetUseSubmenu(Val: boolean);
procedure SetVersion(const Val: TDFSVersion);| Properties |
property AddToTop : boolean
property AutoSave : boolean
property AutoSaveKey : string
property AutoSaveName : string
property FileMenu : TMenuItem
property InsertSeparator : boolean
property MaxCaptionWidth : integer
property Maximum : byte
property RemoveOnClick : boolean
property SubmenuName : string
property UseSubmenu : boolean
property Version : TDFSVersion
property Items : TStringList| Events |
event OnMRUItemClick : TMRUClick| Variables |
FAddToTop : boolean;
FAutoSave : boolean;
FAutoSaveKey : string;
FAutoSaveName : string;
FFileMenu : TMenuItem;
FInhibitUpdate : boolean;
FInsertSeparator : Boolean;
FMaxCaptionWidth : integer;
FMaximum : byte;
FMenuItems : TStringList;
FOnMRUClick : TMRUClick;
FRemoveOnClick : boolean;
FSubmenuName : string;
FUseRegistry : boolean;
FUseSubmenu : boolean;| Constructors |
constructor Create(Owner: TComponent);Needs to do nothing more than initialize properties to defaults and create } { the list variable.
| Functions |
procedure AddItem(aFile: string);Yes, redo the menu.
procedure AddStringList(Files: TStringList);Yes, redo the menu.
procedure AddStrings(Files: TStrings);Update menu now that all are added.
procedure ClearAllItems;Method to clear all current MRU items.
Our placement menu item has been deleted.
procedure ClearItem (aFile: string);Method to clear a single item by name from the MRU items.
Don't forget the object, too! - RGL
destructor Destroy;
procedure InsertItem(Index: integer; aFile: string);Methods to add items to the MRU list
Call the users event handler.
function Load: boolean;Methods to load and save items.
redo the menu.
procedure RemoveAllItems;Method to remove all MRU items from the menu, but NOT from the internal } { list. You probably want ClearAllItems.
Add to the menu
procedure ReplaceItem(OldItem, NewItem: string);Yes, redo the menu.
function Save: boolean;
function GetVersion: TDFSVersion;
procedure Loaded;Cleanup the list variable
procedure MRUClicked(Sender: TObject);MenuItem OnClick handler
procedure Notification(AComponent: TComponent; Operation: TOperation);We need to know if our menu item is deleted.
procedure PopulateMenu;Method to place items on menu
Update menu now that all are added.
procedure SetAutoSaveName(const Val: string);Value not different, do nothing.
procedure SetFileMenu(Val: TMenuItem);Note: an ELSE clause is not needed since if new value is more than old, } { nothing needs to be done.
procedure SetInsertSeparator(Val: boolean);Redo the menu according to new value.
procedure SetMaxCaptionWidth(Val: integer);Redo the menu according to new value.
procedure SetMaximum(Val: byte);Property methods
procedure SetSubmenuName(Val: string);
procedure SetUseSubmenu(Val: boolean);Add MRU items to new menu.
procedure SetVersion(const Val: TDFSVersion);| Properties |
property AddToTop : boolean
property AutoSave : booleanMenu to place MRU items on.
property AutoSaveKey : stringThe filename (INI) or key (registry) to save to.
property AutoSaveName : stringSave and restore MRU items automatically.
property FileMenu : TMenuItemEvent for MRU item selection
property InsertSeparator : booleanMRU items placed on a submenu?
property MaxCaptionWidth : integerThe section to save to.
property Maximum : byte
property RemoveOnClick : booleanMaximum number of items on MRU list
property SubmenuName : string
property UseSubmenu : booleanRemove MRU item when selected?
property Version : TDFSVersion
property Items : TStringListThe MRU Items. Read Only.
| Events |
event OnMRUItemClick : TMRUClickCaption of submenu item, if needed
| Variables |
FAddToTop : boolean;Property variables
FAutoSave : boolean;
FAutoSaveKey : string;
FAutoSaveName : string;
FFileMenu : TMenuItem;
FInhibitUpdate : boolean;Internal use
FInsertSeparator : Boolean;
FMaxCaptionWidth : integer;
FMaximum : byte;
FMenuItems : TStringList;
FOnMRUClick : TMRUClick;Event variables
FRemoveOnClick : boolean;
FSubmenuName : string;
FUseRegistry : boolean;
FUseSubmenu : boolean;