Sign in Join
FPDoc Onlineexperiment

TControlBorderSpacing class

In unit Controls

Describes the (minimum) spacing around a control.

Declaration

pascal
TControlBorderSpacing = class(TPersistent)

Inheritance

  1. TControlBorderSpacing
  2. TPersistent

Description

TControlBorderSpacing defines the number of pixels reserved as spacing on the various borders for a control. TControlBorderSpacing is the type used to implement the BorderSpacing property in TControl.

Left, Top, Right, Bottom: Integer;
Defines the space available to the auto-sized control. For example: Control A lies left of control B. A has borderspacing Right=10 and B has borderspacing Left=5. Then A and B will have a minimum space of 10 between.
Around: Integer;
Same as Left, Top, Right and Bottom but specified all at once. This will be added to the effective Left, Top, Right and Bottom. Example: Left=3 and Around=5 results in a minimum spacing to the left of 8.
InnerBorder: Integer;
This is added to the preferred size. For example: A buttons widget returns 75x25 on GetPreferredSize. CalculatePreferredSize adds 2 times the InnerBorder to the width and height.
CellAlignHorizontal, CellAlignVertical: TControlCellAlign;
Used, for example, when the Parent ChildSizing.Layout defines a table layout.

See ChildSizing and TControlChildSizing for information about spacing around and between child controls on a control instance.

See also

Properties

ControlpublicThe control where the border spacing values are applied.
SpacepublicProvides indexed access to the border spacing value for a given anchor side.
AroundLeftpublicTotal border spacing reserved using the Around and Left properties.
AroundToppublicTotal border spacing reserved using the Around and Top properties.
AroundRightpublicTotal border spacing reserved using the Around and Right properties.
AroundBottompublicTotal border spacing reserved using the Around and Bottom properties.
ControlLeftpublicPosition for the left-hand edge of the associated Control after it has been adjusted for border spacing.
ControlToppublicPosition for the top edge of the associated Control after it has been adjusted for border spacing.
ControlWidthpublicTotal width for the control including border spacing values in Around, Left, and Right.
ControlHeightpublicTotal height for the control including border spacing values in Around, Top, and Bottom.
ControlRightpublicPosition for the right-hand edge of the associated Control after it has been adjusted for border spacing.
ControlBottompublicPosition for the bottom of the associated Control including assigned border spacing.
LeftpublishedThe border space on the left edge of the associated control.
ToppublishedThe border space on the top edge of the associated control.
RightpublishedThe border space on the right edge of the associated control.
BottompublishedThe border space on the bottom edge of the associated control.
AroundpublishedThe border space on each of the edges for the associated control.
InnerBorderpublishedSpace added to the preferred size for the widget.
CellAlignHorizontalpublishedThe horizontal alignment of the associated Control when the control ChildSizing uses a tabular layout.
CellAlignVerticalpublishedThe vertical alignment of the associated Control when the control ChildSizing uses a tabular layout.

Methods

ChangeprotectedInvalidates the control and signals the OnChange event handler.
GetOwnerprotectedGets the class where the border spacing values are used.
CreatepublicConstructor for the class instance.
AssignpublicCopies property values from the specified persistent object.
AssignTopublicCopies property value from the class instance to the specified persistent object.
IsEqualpublicTrue when the specified spacing is the same as the current settings in the class instance.
GetSpaceAroundpublicReturns the bounds with added Around space.
GetSideSpacepublicThe space on a control side including Around space.
GetSpacepublicGets the value for the indexed Space property.
AutoAdjustLayoutpublicAutomatically adjusts the size of the control using the specified proportions.

Events

OnChangepublishedEvent handler signalled when border spacing value(s) have been changed.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.