Class TCastlePackedGroup

Unit

Declaration

type TCastlePackedGroup = class(TCastleUserInterface)

Description

Abstract ancestor for containers that pack children, like TCastleHorizontalGroup and TCastleVerticalGroup.

Hierarchy

Overview

Fields

Protected FPackingValid: boolean;
Public nested const DefaultPadding = 0;
Public nested const DefaultSpacing = 0;

Methods

Protected procedure DoPackChildren(out InsideWidth, InsideHeight: Single); virtual; abstract;
Protected procedure PreferredSize(var PreferredWidth, PreferredHeight: Single); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure BeforeRender; override;
Public procedure Render; override;
Public procedure VisibleChange(const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean = false); override;
Public procedure EditorAllowResize(out ResizeWidth, ResizeHeight: Boolean; out Reason: String); override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Public property FrameColor: TCastleColor read FFrameColor write SetFrameColor;
Published property Frame: boolean read FFrame write SetFrame default false;
Published property Padding: Single read FPadding write SetPadding default DefaultPadding;
Published property Spacing: Single read FSpacing write SetSpacing default DefaultSpacing;
Published property AutoSizeWidth: Boolean read FAutoSizeWidth write SetAutoSizeWidth default true;
Published property AutoSizeHeight: Boolean read FAutoSizeHeight write SetAutoSizeHeight default true;
Published property FrameColorPersistent: TCastleColorPersistent read FFrameColorPersistent ;

Description

Fields

Protected FPackingValid: boolean;
 
Public nested const DefaultPadding = 0;
 
Public nested const DefaultSpacing = 0;
 

Methods

Protected procedure DoPackChildren(out InsideWidth, InsideHeight: Single); virtual; abstract;
 
Protected procedure PreferredSize(var PreferredWidth, PreferredHeight: Single); override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure BeforeRender; override;
 
Public procedure Render; override;
 
Public procedure VisibleChange(const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean = false); override;
 
Public procedure EditorAllowResize(out ResizeWidth, ResizeHeight: Boolean; out Reason: String); override;
 
Public function PropertySections(const PropertyName: String): TPropertySections; override;
 

Properties

Public property FrameColor: TCastleColor read FFrameColor write SetFrameColor;

If Frame, this is the frame's color. By default white.

Published property Frame: boolean read FFrame write SetFrame default false;
 
Published property Padding: Single read FPadding write SetPadding default DefaultPadding;
 
Published property Spacing: Single read FSpacing write SetSpacing default DefaultSpacing;
 
Published property AutoSizeWidth: Boolean read FAutoSizeWidth write SetAutoSizeWidth default true;

Whether the control's size is automatically adjusted to wrap children tightly.

Be careful to not create a recursive loop! Group's size calculation always looks at children size (even when auto-size is off, since it needs to arrange children next to each other anyway). This means that children size cannot depend on a parent. So a direct child of TCastleVerticalGroup or TCastleHorizontalGroup cannot use FullSize, or WidthFraction or HeightFraction. This would create a loop in calculations, which would be forcefully resolved by some control having undefined size.

So, you can only deactivate auto-size on a group if all children have explicitly defined size using their Width and Height properties.

Published property AutoSizeHeight: Boolean read FAutoSizeHeight write SetAutoSizeHeight default true;
 
Published property FrameColorPersistent: TCastleColorPersistent read FFrameColorPersistent ;

FrameColor that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write FrameColor directly.

See also
FrameColor
If Frame, this is the frame's color.

Generated by PasDoc 0.16.0.