Difference between revisions of "FCL/id"

From Free Pascal wiki
Jump to navigationJump to search
Line 20: Line 20:
 
=== Dokumentasi ===
 
=== Dokumentasi ===
  
Currently, the FCL is not documented (feel free to contribute;
+
Saat ini, FCL tidak didokumentasikan (Anda bebas untuk berkontribusi;
also take a look at [http://lazarus-ccr.sourceforge.net/docs/fcl/index.html Reference for 'fcl']).
+
juga lihat di [http://lazarus-ccr.sourceforge.net/docs/fcl/index.html Referensi untuk 'fcl']).
For Delphi compatible units, you could consult the Delphi documentation.
+
Untuk unit kompatibel Delphi, Anda dapat merujuk ke dokumentasi Delphi.
You can always take a look at the source files in the [http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/ source repository].
+
Anda selalu dapat melihat kode file sumber di [http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/ repositori sumber].
  
 
=== Contoh ===
 
=== Contoh ===

Revision as of 18:44, 3 February 2008

Deutsch (de) English (en) español (es) suomi (fi) français (fr) Bahasa Indonesia (id) 日本語 (ja) русский (ru) 中文(中国大陆)‎ (zh_CN)

Free Component Library (FCL) teridiri dari kumpulan unit yang menyediakan komponen (umumnya kelas) untuk tugas-tugas umum. Dimaksudkan agar kompatibel dengan Delphi's Visual Component Library (VCL), tetapi FCL terbatas hanya komponen non-visual. Di lain pihak, FCL melebihi VCL.

Lihat Free Component Library untuk status pengembangan saat ini dan tinjauan atas komponen yang tersedia (meskipun ini tidak konsisten dengan Reference for 'fcl' Lazarus). Anda juga dapat memeriksa repositori sumber. Catatan bahwa ada juga beberapa file spesifik-platform dalam FCL.

Setelah contoh, Anda dapat menemukan daftar beberapa komponen FCL.

Pemakaian

Untuk menggunakan komponen FCL Anda perlu menyertakan nama dalam klausul uses pada program atau unit ANda (lihat contoh di bawah). Konfigurasi kompilator standar disiapkan untuk mencari direktori fcl terhadap unit tersebut. Anda juga dapat menetapkan path pencarian dengan opsi kompilator baris perintah dalam bentuk -Fu<path-to-fcl-units>.

Dokumentasi

Saat ini, FCL tidak didokumentasikan (Anda bebas untuk berkontribusi; juga lihat di Referensi untuk 'fcl'). Untuk unit kompatibel Delphi, Anda dapat merujuk ke dokumentasi Delphi. Anda selalu dapat melihat kode file sumber di repositori sumber.

Contoh

The following program illustrates the use of the class TObjectList in the FCL unit Contnrs (providing various containers, including lists, stacks, and queues):

<delphi> program TObjectListExample;

uses
  Classes, { from RTL for TObject }
  Contnrs; { from FCL for TObjectList }

type
   TMyObject = class(TObject)  { just some application-specific class }
   private
     FName: String; { with a string field }
   public
     constructor Create(AName: String); { and a constructor to create it with a given name }
     property Name: String read FName; { and a property to read the name }
  end;

constructor TMyObject.Create(AName: String);
begin
  inherited Create;
  FName := AName;
end;

var
  VObjectList: TObjectList; { for a list of objects; it is a reference to such a list! }

begin
  VObjectList := TObjectList.Create  { create an empty list }
  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.</delphi>

This program must be compiled in an object-oriented mode, such as -Mobjfpc or -Mdelphi.

Komponen FCL

This is not an exhaustive list (to avoid duplication of effort). It only mentions some important components, or components that are otherwise not easy to find.

Classes
Base classes for Object Pascal extensions in Delphi mode
Contnrs
Some common container classes
FPCUnit
Unit testing framework (based on Kent Beck's unit testing framework, e.g. cf. JUnit), documenting article about FPCUnit
XMLRead, XMLWrite and DOM
Detailed at the XML Tutorial