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

# TCustomHeaderControl

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

TCustomHeaderControl - base class for THeaderControl, a header strip of user-designed sections which allow selection of pages or actions

## Declaration

Source position: comctrls.pp line 2918

`type TCustomHeaderControl = class(TCustomControl)`
`protected`
`function CreateSection; virtual;` |  | CreateSection - method for creating a header section
`function CreateSections; virtual;` |  | CreateSections - method for creating a collection of header sections
`procedure Notification(); override;`
`procedure SectionClick(); virtual;` |  | SectionClick - method for emulating the OnSectionClick event
`procedure SectionResize(); virtual;` |  | SectionResize - method for emulating the OnSectionResize event
`procedure SectionTrack(); virtual;` |  | SectionTrack - method for emulating the OnSectionTrack event
`procedure SectionSeparatorDblClick(); virtual;` |  | SectionSeparatorDblClick - method for emulating the OnSectionSeparatorDblClick event
`procedure SectionEndDrag; virtual;` |  | SectionEndDrag - method for emulating the OnSectionEndDrag event
`function SectionDrag(); virtual;` |  | SectionDrag - method to emulate the OnSectionDrag 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;` |  | MouseLeave - a procedure that allows the programmer to simulate a mouse leaving the control, and initiates the same Action as that associated with the OnMouseLeave event
`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 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 UpdateState;` |  | UpdateState - bring the state of the control up-to-date
`protected`
`class function GetControlClassDefaultSize; override;` |  | GetControlClassDefaultSize - returns its own defaults, overriding inherited values
`public`
`property SectionFromOriginalIndex: THeaderSection; [r]` |  | SectionFromOriginalIndex - the section as defined by the original (unchanged) index
`constructor Create(); override;` |  | Create - constructor for TCustomHeaderControl: calls inherited Create, creates the sections and initialises style and bounds
`destructor Destroy; override;` |  | Destroy - destructor for TCustomHeaderControl: frees sections then calls inherited Destroy
`procedure Click; override;` |  | Click - a procedure that allows the programmer to simulate a mouse click over the control, and initiates the same Action as that associated with the OnClick event
`procedure DblClick; override;` |  | DblClick - a procedure that allows the programmer to simulate a mouse double-click over the control, and initiates the same Action as that associated with the OnDblClick event
`function GetSectionAt();` |  | GetSectionAt - find the index for the section located at point P
`procedure Paint; override;` |  | The default paint handler for the class
`procedure PaintSection(); virtual;` |  | PaintSection - method for painting the current section (specified by Index) of the Header
`published`
`property DragReorder: Boolean; [rw]` |  | DragReorder - find out if the sections are allowed to be re-ordered by dragging
`property Images: TCustomImageList; [rw]` |  | Images - the list of Images available for selection using this tool
`property Sections: THeaderSections; [rw]` |  | Sections - the short segments of the header, separated by vertical bars, that function as the elementary selection units of the header
`property OnSectionDrag: TSectionDragEvent; [rw]` |  | OnSectionDrag - event handler for dragging the section of header
`property OnSectionEndDrag: TNotifyEvent; [rw]` |  | OnSectionEndDrag - event handler for ending the drag process for this section
`property OnSectionClick: TCustomSectionNotifyEvent; [rw]` |  | OnSectionClick - event handler for mouse click on this section of header
`property OnSectionResize: TCustomSectionNotifyEvent; [rw]` |  | OnSectionResize - event handler for re-sizing this section of the header
`property OnSectionTrack: TCustomSectionTrackEvent; [rw]` |  | OnSectionTrack - event handler for tracking this section
`property OnSectionSeparatorDblClick: TCustomSectionNotifyEvent; [rw]` |  | OnSectionSeparatorDblClick - event handler for double-click on the separator between sections
`property OnCreateSectionClass: TCustomHCCreateSectionClassEvent; [rw]` |  | OnCreateSectionClass - event handler for creating a new section class
`end;`

## Inheritance

`TCustomHeaderControl` |  | TCustomHeaderControl - base class for THeaderControl, a header strip of user-designed sections which allow selection of pages or actions
`TCustomControl` |  | TCustomControl - a base class for many window controls
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TCustomHeaderControl - base class for THeaderControl, a header strip of user-designed sections which allow selection of pages or actions

THeaderControl offers a widget that could be placed along the edge of a Panel or Form, allowing a highly customised mechanism for selection. However, there are no intrinsically associated display areas, and it is the developer's responsibility to supply an index associated with the selection from the THeaderControl and determining what action is to occur or what is to be displayed in any attached Panel or Form.

## See also

Multi-PageControls |  | Multi-PageControls - controls that offer a selection of alternative pages for display

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