Sign in Join
Wiki copytemporary

FCL/fr

Bahasa Indonesia · Deutsch · English · Español · Français · Suomi · Русский · 中文(中国) · 日本語

The Free Component Library (FCL) consists of a collection of units, providing components (mostly classes) for common tasks. It intends to be compatible with Delphi's Visual Component Library (VCL), but the FCL is restricted to non-visual components. On the other hand, the FCL also goes beyond the VCL.

See Free Component Library for the current development status and an overview of the available components (though this seems inconsistent with Reference for 'fcl' in Lazarus). You can also check the source repository. Note that there are also some platform specific files in the FCL.

Usage

Pour utiliser un composant de la FCL, vous devez inclure son nom dans la clause uses de votre programme ou unité (voir l'exemple ci-dessous). La configuration par défaut du compilateur est reglée pour chercher le dossier de la FCL afin d'atteindre ces unités. Vous pouvez également régler le chemin approprié avec une option de la ligne de commande du compilateur de la forme -Fu<chemin-vers-les-unités-fcl>.

Documentation

Actuellement la FCL n'est pas documentée (libre à vous de contribuer; voyez également sur Reference our la FCL). Pour les unités compatibles Delphi, vous pouvez consulter la documentation de Delphi. Vous pouvez toujours également jeter un oeil sur les fichiers source dans le dépôt de sources.

Exemple

Le programme suivant illustre l'utilisation de la classe TObjectList dans l'unité FCL Contnrs (qui offre divers conteneurs, incluant listes, piles et queues):

pascal
 program TObjectListExample;
 
 uses
   Classes, { de la RTL pour TObject }
   Contnrs; { de la FCL pour TObjectList }
 
 type
    TMyObject = class(TObject)  { juste une classe spécifique à l'application }
    private
      FName: String; { avec un champ chaîne }
    public
      constructor Create(AName: String); { et un constructeur pour le créer avec un nom donné }
      property Name: String read FName; { et une proriété pour lire le nom }
   end;
 
 constructor TMyObject.Create(AName: String);
 begin
   inherited Create;
   FName := AName;
 end;
 
 var
   VObjectList: TObjectList; { pour une liste d'objets; il s'agit d'une référence à une telle liste! }
 
 begin
   VObjectList := TObjectList.Create  { crée une liste vide }
   with VObjectList do
   begin
     Add(TMyObject.Create('Thing One'));
     Writeln((Last as TMyObject).Name);
     Add(TMyObject.Create('Thing Two'));
     Writeln((Last as TMyObject).Name);
   end;
 end.

Ce programme doit être compilé en momde orienté-objet, tel que -Mobjfpc ou -Mdelphi.


From the Free Pascal wiki, page "FCL/fr", as it stood on 2020-02-14 after a change by Trev, 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.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 5 people, 2007–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
PaulatreidesNew page: {{FCL}} The ''Free Component Library'' (FCL) consists of a collection of units, providing components (mostly classes) for common tasks. It intends to be compatible with Delphi's ''Visual ...
LazarusBobUsage
LazarusBobDocumentation
LazarusBobExample
VincentText replace - "delphi>" to "syntaxhighlight>" (minor)
OlafExemple (minor)
TrevFixed syntax highlighting; deleted category included in page template (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.