TControlBorderSpacing class
Describes the (minimum) spacing around a control.
Declaration
TControlBorderSpacing = class(TPersistent)Inheritance
- TControlBorderSpacing
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
Control | public | The control where the border spacing values are applied. |
Space | public | Provides indexed access to the border spacing value for a given anchor side. |
AroundLeft | public | Total border spacing reserved using the Around and Left properties. |
AroundTop | public | Total border spacing reserved using the Around and Top properties. |
AroundRight | public | Total border spacing reserved using the Around and Right properties. |
AroundBottom | public | Total border spacing reserved using the Around and Bottom properties. |
ControlLeft | public | Position for the left-hand edge of the associated Control after it has been adjusted for border spacing. |
ControlTop | public | Position for the top edge of the associated Control after it has been adjusted for border spacing. |
ControlWidth | public | Total width for the control including border spacing values in Around, Left, and Right. |
ControlHeight | public | Total height for the control including border spacing values in Around, Top, and Bottom. |
ControlRight | public | Position for the right-hand edge of the associated Control after it has been adjusted for border spacing. |
ControlBottom | public | Position for the bottom of the associated Control including assigned border spacing. |
Left | published | The border space on the left edge of the associated control. |
Top | published | The border space on the top edge of the associated control. |
Right | published | The border space on the right edge of the associated control. |
Bottom | published | The border space on the bottom edge of the associated control. |
Around | published | The border space on each of the edges for the associated control. |
InnerBorder | published | Space added to the preferred size for the widget. |
CellAlignHorizontal | published | The horizontal alignment of the associated Control when the control ChildSizing uses a tabular layout. |
CellAlignVertical | published | The vertical alignment of the associated Control when the control ChildSizing uses a tabular layout. |
Methods
Change | protected | Invalidates the control and signals the OnChange event handler. |
GetOwner | protected | Gets the class where the border spacing values are used. |
Create | public | Constructor for the class instance. |
Assign | public | Copies property values from the specified persistent object. |
AssignTo | public | Copies property value from the class instance to the specified persistent object. |
IsEqual | public | True when the specified spacing is the same as the current settings in the class instance. |
GetSpaceAround | public | Returns the bounds with added Around space. |
GetSideSpace | public | The space on a control side including Around space. |
GetSpace | public | Gets the value for the indexed Space property. |
AutoAdjustLayout | public | Automatically adjusts the size of the control using the specified proportions. |
Events
OnChange | published | Event 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.
