控件基本属性Padding, Margins, Align...

一幅图说明Padding, Margins的用法。

scale:缩放控件,不会影响到控件的size属性,1为不缩放, 充许负值。 缩放原点,2D的为控件原点,即左上角。3D的为控件中心。

rotation:旋转控件,2D的旋转支点是可调整的,rotation center 默认为(0.5,0.5).控件的左上角为(0,0),右下角为(1,1).RotationAngle是旋转角度,顺时针方向。

3D情况下,支点永远为控件中心。循右手法则。

一个控件的缩放发生在旋转前,这是因为旋转支点是可调整的。

anchors: 指定当前控件与parent控件的边框的关联。 当parent控件resize时,当前控件保持与parent边框的相对距离保持不变。该属性只在parent->resize时产生影响。

TAlignLayout can have one of the following values:

ValueMeaning

Bottom

The control moves and pins to the bottom of its parent and resizes to fill the width of its parent. The height of the control is not affected. If another most side-pinned control already occupies part of the parent area, the control resizes to fill the remaining width of its parent. The anchors are set to [akLeft,akBottom,akRight].

Center

The control moves to the center of the parent area. The control's size is not affected. If another side-pinned control already occupies part of the parent area, the control moves to the center of the remaining parent area. The control is not anchored to its parent.

到client区域的中心位置。不设瞄点。

一般占用客户区域的情况,如果已有其它停靠了边框的控件,则会自动调整计算剩下的区域。后面不再说明这种情况。

Client

The control resizes to fill the client area of its parent. If another side-pinned control already occupies part of the parent area, the control resizes to fit within the remaining parent area. The anchors are set to [akLeft,akTop,akRight,akBottom].

Contents

The control resizes to fill the entire bounds of its parent, overlapping it.
The anchors are set to [akLeft,akTop,akRight,akBottom]

占用parent整个区域,非client区,瞄点上下左右。

Fit

The control resizes to fit the parent area, preserving its aspect ratio. The control moves to the center of the parent area. The anchors are set to [akLeft,akTop,akRight,akBottom].

调整控件大小,保持纵横比,到parent的区域,居中显示,并设置了4个瞄点。

FitLeft

The control resizes to fit the parent area, preserving its aspect ratio. The control moves to and pins to the left side of the parent. The anchors are set to [akLeft,akTop,akRight,akBottom].

类同fit,但是不是居中显示,而是停靠在parent左边框。4瞄点。

FitRight

The control resizes to fit the parent area, preserving its aspect ratio. The control moves to and pins to the right side of the parent. The anchors are set to [akLeft,akTop,akRight,akBottom].

Horizontal

The control resizes to fill the height of its parent. The width of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent.
The anchors are set to [akLeft,akRight].

控件宽度占满client区域,并瞄点左右。

英文解释像是有问题,

HorzCenter

The control is centered horizontally within the client area of the parent and resizes to fill the height of its parent. The width of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent. The anchors are set to [akTop,akBottom].

调节控件高度占满parent client区哉,同时水平居中控件,设置瞄点[上,下]。 其它停靠边框的控件会挤占客户区。

Left

The control moves and pins to the left side of its parent and resizes to fill the height of its parent. The width of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent. The anchors are set to [akLeft,akTop,akBottom].

MostBottom

The control moves and pins to the bottom of its parent, set to be the bottommost, and resizes to fill the width of its parent. The height of the control is not affected. The anchors are set to [akLeft,akRight,akBottom].

基本等同bottom,区别(当有多个bottom控件时)是它会移动到最下面。

MostLeft

The control moves and pins to the left side of its parent, set to be the leftmost, and resizes to fill the height of its parent. The width of the control is not affected. If another most side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent.
The anchors are set to [akLeft,akTop,akBottom].

MostRight

The control moves and pins to the right side of its parent, set to be the rightmost, and resizes to fill the height of its parent. The width of the control is not affected. If another most side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent. The anchors are set to [akTop,akRight,akBottom].

MostTop

The control moves and pins to the top of its parent, set to be the topmost, and resizes to fill the width of its parent. The height of the control is not affected. The anchors are set to [akLeft,akTop,akRight].

None

The control remains where it was placed. This is the default value. No automatic positioning and sizing are performed. The anchors are set to [akLeft,akTop].

Right

The control moves and pins to the right side of its parent and resizes to fill the height of its parent. The width of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining height of its parent. The anchors are set to [akRight,akTop,akBottom].

Scale

The control resizes and moves to maintain the relative position and size as its container resizes. The anchors are set to [akLeft,akTop,akRight,akBottom].

设置4瞄点,当parent resize时,本控件比例缩放。 

Top

The control moves and pins to the top of its parent and resizes to fill the width of its parent. The height of the control is not affected. If another most side-pinned control already occupies part of the parent area, the control resizes to fill the remaining width of its parent. The anchors are set to [akLeft,akTop,akRight].

VertCenter

The control is centered vertically within the client area of the parent and resizes to fill the width of its parent. The height of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining width of its parent. The anchors are set to [akLeft,akRight].

垂直居中。左右瞄点。占整个客户区。

Vertical

The control resizes to fill the width of its parent. The height of the control is not affected. If another side-pinned control already occupies part of the parent area, the control resizes to fill the remaining width of its parent.
The anchors are set to [akTop,akRight].

调整高度,占整个客户区,上下瞄点。

原文地址:https://www.cnblogs.com/khzide/p/4430314.html