Skip to main content

TComponentState

TComponentState = set of TComponentStateE

Example

function ComponentIsUsable(const State: TComponentState): Boolean;
begin
Result := not (csDestroying in State) and
not (csLoading in State) and
not (csReading in State);
end;

Usage

TComponentState reports the active loading, streaming, destruction and design-time flags of a script-visible component.

Behavior and boundaries

  • The runtime function directly copies the current Velox TComponent.ComponentState set. It performs no remapping; correctness depends on the currently aligned member ordinals.
  • The property is read-only in Velox scripting. The component framework changes flags during streaming, design work and destruction.
  • Treat the value as an instantaneous snapshot. A lifecycle transition can occur after a check, so it is not a synchronization primitive.
  • Most Velox flow execution occurs at runtime, making design flags unusual, but components can still expose loading, reading, fix-up or destruction states.
  • Do not persist the set's bit pattern. Persist named application state instead if a flow needs a durable lifecycle record.

Additional Technical Info

TComponentState is the read-only state returned by the inherited ComponentState property of script-visible Delphi components. The PascalScript compiler calls its hidden element enumeration TComponentStateE; the installed Delphi source calls the corresponding host element type TComponentStateItem. Both current declarations contain the same eleven members in the same order.

MemberMeaning and relationship
csLoadingThe component and its children are being loaded; it remains set until loading completes.
csReadingProperties are currently being read from a stream. csLoading is also set.
csWritingProperties are currently being written to a stream.
csDestroyingDestruction has started or is imminent; avoid initiating new work against the component.
csDesigningThe component belongs to a form/design surface being manipulated at design time.
csAncestorThe component originated in an ancestor form; normally paired with csDesigning.
csUpdatingThe component is applying ancestor changes; normally paired with csAncestor.
csFixupsReferences to components in another form are still awaiting fix-up after loading.
csFreeNotificationOther components requested notification when this component is destroyed.
csInlineThe component is an inline/nested design instance such as an embedded frame.
csDesignInstanceThe component is the root object in a designer; it appears with csDesigning.

Related Code Library entries

  • Sets - set constructors, membership and operator rules.

External references

Created 2026-07-15