TPersistent Branch
Go Up to Objects, Components, and Controls
The TPersistent branch includes all VCL classes that descend from TPersistent but not from TComponent. Persistence determines what gets saved with a form file or data module and what gets loaded into the form or data module when it is retrieved from memory.
Because of their persistence, objects from this branch can appear at design time. However, they can't exist independently. Rather, they implement properties for components. Properties are only loaded and saved with a form if they have an owner. The owner must be some component. TPersistent introduces the GetOwner method, which lets the Form Designer determine the owner of the object.
Classes in this branch are also the first to include a published section where properties can be automatically loaded and saved. A DefineProperties method lets each class indicate how to load and save properties.
Following are some of the classes in the TPersistent branch of the hierarchy:
- Graphics such as: Vcl.Graphics.TBrush, Vcl.Graphics.TFont, and Vcl.Graphics.TPen.
- Classes such as Vcl.Graphics.TBitmap and Vcl.Graphics.TIcon, which store and display visual images, and Vcl.Clipbrd.TClipboard, which contains text or graphics that have been cut or copied from an application.
- String lists, such as System.Classes.TStringList, which represent text or lists of strings that can be assigned at design time.
- Collections and collection items, which descend from System.Classes.TCollection or System.Classes.TCollectionItem. These classes maintain indexed collections of specially defined items that belong to a component. Examples include Vcl.ComCtrls.THeaderSections and Vcl.ComCtrls.THeaderSection or Vcl.ComCtrls.TListColumns and Vcl.ComCtrls.TListColumns.
Following are some of the other classes in the TPersistent branch of the hierarchy:
- TGraphicsObject, an abstract base class for graphics objects such as: TBrush, TFont, and TPen.
- TGraphic, an abstract base class for objects such as TBitmap and TIcon, which store and display visual images.
- TStrings, a base class for objects that represent a list of strings.
- TClipboard, a class that contains text or graphics that have been cut or copied from an application.
- TCollection, TOwnedCollection, andTCollectionItem, classes that maintain indexed collections of specially defined items.