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

# TCustomSplitter

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

TCustomSplitter : the base type for TSplitter

## Declaration

Source position: extctrls.pp line 596

`type TCustomSplitter = class(TCustomControl)`
``
`class procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`protected`
`procedure CheckAlignment;` |  | CheckAlignment - ensure control is correctly aligned
`function CheckNewSize(); virtual;` |  | CheckNewSize - ensure new size is appropriate: returns True if sucessful
`function FindAlignControl;` |  | FindAlignControl - returns the main alignment control
`function FindAlignOtherControl;` |  | FindAlignOtherControl - returns another alignment control (the splitter may have to align two controls)
`procedure MouseDown(); override;` |  | MouseDown - a procedure that allows the programmer to simulate a mouse button being down over the control, and initiates the same Action as that associated with the OnMouseDown event
`procedure MouseEnter; override;` |  | MouseEnter - a procedure that allows the programmer to simulate a mouse entering the control, and initiates the same Action as that associated with the OnMouseEnter event
`procedure MouseLeave; override;` |  |
`procedure MouseMove(); override;` |  | MouseMove - a procedure that allows the programmer to simulate a mouse being moved over the control, and initiates the same Action as that associated with the OnMouseMove event
`procedure MouseUp(); override;` |  | MouseUp - a procedure that allows the programmer to simulate a mouse button being Up over the control, and initiates the same Action as that associated with the OnMouseUp event
`procedure Paint; override;` |  | The default paint handler for the class
`procedure SetAlign(); override;` |  | Set up the Align rules for this control
`procedure SetAnchors(); override;` |  | Set the rules for anchoring this control
`procedure SetResizeAnchor(); virtual;` |  |
`procedure SetResizeControl(); virtual;` |  |
`procedure StartSplitterMove();` |  | StartSplitterMove - method for starting movement of the splitter, given the mouse position MouseXY
`procedure StopSplitterMove();`
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomSplitter: calls inherited Create then sets initial alignment, size and style
`procedure AnchorSplitter();` |  | AnchorSplitter - anchor the splitter to Acontrol using the specified Kind of anchor
`property ResizeControl: TControl; [rw]` |  | ResizeControl - the control that is to be re-sized with the splitter
`function GetOtherResizeControl;` |  | GetOtherResizeControl - find out which other control is to be re-sized
`procedure MoveSplitter();` |  | MoveSplitter - by an amount specified by Offset
`procedure SetSplitterPosition();` |  | SetSplitterPosition - to specified NewPosition
`function GetSplitterPosition;` |  | GetSplitterPosition - returns the current position of the splitter
`property Align;` |  | Used to align the control to the top, bottom, left or right of its client.
`property AutoSnap: Boolean; [rw]` |  | AutoSnap - automatically snaps to a grid point or grid line in the Form designer
`property Beveled: Boolean; [rw]` |  | Whether the edges of the splitter bar are bevelled
`property Cursor;` |  | The type of cursor to be used with this control
`property MinSize: Integer; [rw]` |  | Minimum size for splitter - default 30 pixels
`property OnCanResize: TCanResizeEvent; [rw]` |  | Event handler for receiving permission to resize
`property OnMoved: TNotifyEvent; [rw]` |  | Event handler for occasion when splitter has moved
`property ResizeAnchor: TAnchorKind; [rw]` |  | ResizeAnchor - the kind of anchor to be used for resizing
`property ResizeStyle: TResizeStyle; [rw]` |  | Style for resizing - as a line, a pattern, full update, or none
`end;`

## Inheritance

`TCustomSplitter` |  | TCustomSplitter : the base type for TSplitter
`TCustomControl` |  | TCustomControl - a base class for many window controls
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TCustomSplitter: the base type for TSplitter

A Splitter is a vertical or horizontal bar that can be placed on a panel or form, to separate sub-panels functionally and allow re-sizing of the constituent sub-panels

This class defines many of the basic properties for the children classes, such as positioning, sizing and alignment

    { TCustomSplitter is a control for interactively resizing another control.
        It is a vertical or horizontal bar anchored to a side of a control.
        You can either set the Align property to alLeft (alRight,alTop,alBottom),
        then it will become a vertical bar, aligned to the left and when the user
        moves it with the mouse, the control to the left with the same Align=alLeft
        will be resized.
        The second more flexible possibility is to set the properties Align=alNone,
        AnchorSides and ResizeAnchor.
        }

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