Sign in Join
FPDoc Onlineexperiment

CompWriterPas unit

Contains types, classes, and routines used to serialize components into Pascal code.

The following features and functionality are currently implemented:

  • signature begin, end, version
  • boolean, set of boolean
  • char, widechar, custom char, set of custom char
  • integers, custom int, set of custom int
  • strings, codepage system and UTF8
  • float, currency
  • enum, custom enum range
  • set of enum, set of custom enum range
  • variant: integers, boolean, string, floats, currency
  • method
  • persistent
  • component children, use SetParentComponent or optional Parent
  • collection
  • IInterfaceComponentReference
  • with ancestor
  • ancestor: change ComponentIndex -> call SetChildPos
  • reference foreign root, reference foreign component
  • create components before setting properties to avoid having to set references later
  • inline component, csInline, call SetInline, inherited inline, inline on inherited
  • TComponent.Left/Right via DesignInfo
  • DefineProperties
  • RegisterDefinePropertiesPas

TCompWriterPas is used in the implementation of the TCustomFormEditor class in the Lazarus IDE.

Author: Mattias Gaertner

compwriterpas.pas is part of the lazutils package.

Classes and records

TCompWriterPasclassSerializes a component to Pascal code.

Procedures and functions

CallDefinePropertiesPasprocedure
RegisterDefinePropertiesPasprocedure
UnregisterDefinePropertiesPasprocedure
WriteComponentToPasStreamprocedure

Types

TCWPChildrenStepenumeration
TCWPDefinePropertiesEventprocedure type
TCWPDefinePropertiesProcprocedure type
TCWPFindAncestorEventprocedure typeSpecifies an event handler used to find ancestor class in TCompWriterPas.
TCWPGetMethodNameprocedure typeSpecifies an event handler used to get property information and an identifier name for a property.
TCWPGetParentPropertyEventprocedure typeSpecifies an event handler used to get a parent property name for a component instance.
TCWPOptionenumerationEnumeration which defines options available in TCompWriterPas.
TCWPOptionssetSet type used to stores values from the TCWPOption enumeration.

Constants

CSPDefaultAccessClassconstantDefault class name used to access protected TComponent members.
CSPDefaultAssignOpconstantDefault value for the AssignOp property in TCompWriterPas.
CSPDefaultExecCustomProcconstantDefault value for the ExecCustomProc property in TCompWriterPas.
CSPDefaultExecCustomProcUnitconstantDefault value for the ExecCustomProcUnit property in TCompWriterPas.
CSPDefaultMaxColumnconstantDefault value for the MaxColumn property in TCompWriterPas.
CSPDefaultSignatureconstantDefault signature written before serialized component data.
CSPDefaultSignatureBeginconstantDefault begin signature written before a serialized component.
CSPDefaultSignatureEndconstantDefault end signature written after a serialized component.
CSPVersionconstantComponent Serialization to Pascal version.
CWPSkipParentNameconstantParent property name to skip when writing component data.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.