Controls.TWinControl.CustomAlignPosition

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Controls.pas

	procedure CustomAlignPosition(Control: TControl;
		var NewLeft: Integer;
		var NewTop: Integer;
		var NewWidth: Integer;
		var NewHeight: Integer;
		var AlignRect: TRect;
		AlignInfo: TAlignInfo); virtual;


Unit: Controls

Type: method

Visibility: protected

Member Of: TWinControl

C++ Information

From Controls.hpp

	virtual void __fastcall CustomAlignPosition(Controls::TControl * Control,
		int & NewLeft,
		int & NewTop,
		int & NewWidth,
		int & NewHeight,
		Types::TRect & AlignRect,
		const Controls::TAlignInfo & AlignInfo);


Unit: Controls

Type: method

Visibility: protected

Member Of: TWinControl

Description

Returns aligned position of custom-aligned child control.


CustomAlignPosition determines the specific position of custom-aligned child controls. CustomAlignPosition is called once for each child control with an Align property of alCustom, in an order previously determined by calls to CustomAlignInsertBefore.

CustomAlignPosition triggers the OnAlignPosition event. If this event is defined, CustomAlignPosition uses the alignment parameters it obtains from OnAlignPosition. Defining this event allows users to set the alignment parameters without overriding CustomAlignPosition.

These are the parameters:



Control The child control being placed.

NewLeft | NewTop | NewWidth | NewHeight

Location and size of child control, as determined by container's size and the Anchors TControl_Anchors constraints for the control. CustomAlignPosition can modify these values to reposition the control.

AlignRect

The client area in which the control is aligned. CustomAlignPosition can modify this value.

AlignInfo

Alignment information in a TAlignInfo.

As implemented in TWinControl, CustomAlignPosition does nothing.



See Also

Personal tools
Translations
Newest Version