[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TControlChildSizing

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

How Child controls are to be sized relative to parent.

Declaration

Source position: controls.pp line 1806

type TControlChildSizing = class(TPersistent) end;

protected

  procedure Change; virtual;

  

Notifies Control and invokes the OnChange handler.

public

  constructor Create();

  procedure Assign(); override;

  procedure AssignTo(); override;

  function IsEqual();

  

True if the specified sizing is equal to this one.

  procedure SetGridSpacing();

  

Set all spaceing to the same value.

  property Control: TWinControl; [r]

  

The Control to which childsizing applies.

  property OnChange: TNotifyEvent; [rw]

  

Event handler for any change in the data.

published

  property LeftRightSpacing: Integer; [rw]

  

Minimum distance between children and client border.

  property TopBottomSpacing: Integer; [rw]

  

Minimum distance between children and client border.

  property HorizontalSpacing: Integer; [rw]

  

Minimum space between children.

  property VerticalSpacing: Integer; [rw]

  

Minimum space between children.

  property EnlargeHorizontal: TChildControlResizeStyle; [rw]

  

Various ways to fit controls into the available Width.

  property EnlargeVertical: TChildControlResizeStyle; [rw]

  

Various ways to fit controls into the available Height.

  property ShrinkHorizontal: TChildControlResizeStyle; [rw]

  

Various ways to fit controls into the available Width.

  property ShrinkVertical: TChildControlResizeStyle; [rw]

  

Various ways to fit controls into the available Height.

  property Layout: TControlChildrenLayout; [rw]

  

Allows to also arrange the child controls in rows or columns.

  property ControlsPerLine: Integer; [rw]

  

number of controls per line

Inheritance

TControlChildSizing

  

How Child controls are to be sized relative to parent.

|

TPersistent

?

TObject

Description

{ LeftRightSpacing, TopBottomSpacing: integer;
        minimum space between client border and nearest child control.
        For example: ClientLeftRight=5 means leftmost child's Left position is at least 5.

    HorizontalSpacing, VerticalSpacing: integer;
        minimum space between each child control.
  }

  {   Defines how child controls are resized/aligned.

      cesAnchorAligning, cssAnchorAligning
        Anchors and Align work like Delphi. For example if Anchors property of
        the control is [akLeft], it means fixed distance between left border of
        parent's client area. [akRight] means fixed distance between right
        border of the control and the right border of the parent's client area.
        When the parent is resized the child is moved to keep the distance.
        [akLeft,akRight] means fixed distance to left border and fixed distance
        to right border. When the parent is resized, the controls width is
        changed (resized) to keep the left and right distance.
        Same for akTop,akBottom.

        Align=alLeft for a control means set Left leftmost, Top topmost and
        maximize Height. The width is kept, if akRight is not set. If akRight
        is set in the Anchors property, then the right distance is kept and
        the control's width is resized.
        If there several controls with Align=alLeft, they will not overlapp and
        be put side by side.
        Same for alRight, alTop, alBottom. (Always expand 3 sides).

        Align=alClient. The control will fill the whole remaining space.
        Setting two children to Align=alClient does only make sense, if you set
        maximum Constraints.

        Order: First all alTop children are resized, then alBottom, then alLeft,
        then alRight and finally alClient.

      cesScaleChilds, cssScaleChilds
        Scale children, keep space between them fixed.
        Children are resized to their normal/advised size. If there is some space
        left in the client area of the parent, then the children are scaled to
        fill the space. You can set maximum Constraints. Then the other children
        are scaled more.
        For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and
        C.Width=30 (total=60). If the Parent's client area has a ClientWidth of
        120, then the children are scaled with Factor 2.
        If B has a maximum constraint width of 30, then first the children will be
        scaled with 1.5 (A.Width=15, B.Width=30, C.Width=45). Then A and C
        (15+45=60 and 30 pixel space left) will be scaled by 1.5 again, to a
        final result of: A.Width=23, B.Width=30, C.Width=67 (23+30+67=120).

      cesHomogenousChildGrowth, cssHomogenousChildDecrease
        Enlarge children equally.
        Children are resized to their normal/advised size. If there is some space
        left in the client area of the parent, then the remaining space is
        distributed equally to each child.
        For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and
        C.Width=30 (total=60). If the Parent's client area has a ClientWidth of
        120, then 60/3=20 is added to each Child.
        If B has a maximum constraint width of 30, then first 10 is added to
        all children (A.Width=20, B.Width=30, C.Width=40). Then A and C
        (20+40=60 and 30 pixel space left) will get 30/2=15 additional,
        resulting in: A.Width=35, B.Width=30, C.Width=55 (35+30+55=120).

      cesHomogenousSpaceGrowth
        Enlarge space between children equally.
        Children are resized to their normal/advised size. If there is some space
        left in the client area of the parent, then the space between the children
        is expanded.
        For example: 3 child controls A, B, C with A.Width=10, B.Width=20 and
        C.Width=30 (total=60). If the Parent's client area has a ClientWidth of
        120, then there will be 60/2=30 space between A and B and between
        B and C.
  }

The latest version of this document can be found at lazarus-ccr.sourceforge.net.