Class TCastleComponent

Unit

Declaration

type TCastleComponent = class(TComponent)

Description

Component with small CGE extensions.

Hierarchy

  • TComponent
  • TCastleComponent

Overview

Methods

Protected function GetInternalText: String; virtual;
Protected procedure SetInternalText(const Value: String); virtual;
Protected procedure SetName(const Value: TComponentName); override;
Public function PropertySection(const PropertyName: String): TPropertySection; virtual;
Public procedure SetTransient;

Description

Methods

Protected function GetInternalText: String; virtual;
 
Protected procedure SetInternalText(const Value: String); virtual;
 
Protected procedure SetName(const Value: TComponentName); override;
 
Public function PropertySection(const PropertyName: String): TPropertySection; virtual;

Section where to show property in the editor.

Public procedure SetTransient;

Ignore this component when serializing parent's TCastleUserInterface.Controls list or TCastleTransform.List, and do not show this component in CGE editor. This simply sets csTransient flag in ComponentStyle.

This is useful for children that are automatically managed by the parent, and should not be modified by user code. For example, TCastleCheckbox is internally composed from TCastleImageControl and TCastleLabel children, but we don't want to serialize or even show these children to user.

Note that if you want to prevent this component from serializing TCastleUserInterface.Controls list or TCastleTransform.List, but you still want it to be visible in CGE editor, then make it a "subcomponent" instead, by SetSubComponent(true).

In any case (csSubComponent and/or csTransient) the component is just not serialized as part of parent's Controls list. But if you will make the component published (which is normal for "subcomponents") then it will be serialized anyway, just as part of it's own property (like TCastleScrollView.ScrollArea). So to really avoid serializing the component, make it csSubComponent and/or csTransient, and do not publish it.


Generated by PasDoc 0.15.0.