Class TRecentFiles

Unit

Declaration

type TRecentFiles = class(TComponent)

Description

Manage a list of recently open files.

This is designed as a base class, usable on it's own, but also as a parent for classes that show this list inside a menu. For Lazarus menu version, see TLazRecentFiles. For TCastleWindowBase menu version, see TCastleRecentFiles.

Hierarchy

  • TObject
  • TPersistent
  • TComponent
  • TRecentFiles

Overview

Fields

Public nested const DefaultMaxCount = 5;

Methods

Protected procedure MenuCreate; virtual;
Protected procedure MenuDestroy; virtual;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Add(const URL: String); virtual;
Public procedure Add(const URL: String; const Ignored: Boolean); deprecated 'use Add(URL)';
Public procedure Remove(const URL: String);
Public procedure LoadFromConfig(const Config: TCastleConfig);
Public procedure SaveToConfig(const Config: TCastleConfig);

Properties

Public property URLs: TStringList read FURLs;
Published property OnOpenRecent: TOnOpenRecent read FOnOpenRecent write FOnOpenRecent;
Published property MaxCount: Cardinal read FMaxCount write FMaxCount default DefaultMaxCount;

Description

Fields

Public nested const DefaultMaxCount = 5;
 

Methods

Protected procedure MenuCreate; virtual;

Create and destroy menu (or anything else that mirrors URLs contents).

Protected procedure MenuDestroy; virtual;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure Add(const URL: String); virtual;

Adds as the most recent file URL.

Note that we want to store only absolute URLs. So this method will always call AbsoluteURI (which will eventually call ExpandFileName on filename inside, and make sure it has appropriate protocol) on the given URL.

Public procedure Add(const URL: String; const Ignored: Boolean); deprecated 'use Add(URL)';

Warning: this symbol is deprecated: use Add(URL)

 
Public procedure Remove(const URL: String);

Remove URL.

Public procedure LoadFromConfig(const Config: TCastleConfig);

Load and save recently opened files list to/from the Config file.

Public procedure SaveToConfig(const Config: TCastleConfig);
 

Properties

Public property URLs: TStringList read FURLs;

List of currently stored URLs. This is readonly.

Published property OnOpenRecent: TOnOpenRecent read FOnOpenRecent write FOnOpenRecent;
 
Published property MaxCount: Cardinal read FMaxCount write FMaxCount default DefaultMaxCount;
 

Generated by PasDoc 0.16.0.