QG_SetCaptionAlignment

QG_SetCaptionAlignment(areaRef; horzAlignment; vertAlignment):error
areaRef Longint QGrid area reference
horzAlignment Longint Horizontal alignment
vertAlignment Longint Vertical alignment
error Longint Error result

Set the caption text alignment

Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.

Parameters horzAlignment and vertAlignment specify the alignment of text within the caption rectangle. Acceptable alignment values are listed below:

qg_AlignHorzLeft 0 Horizontally align to the left
qg_AlignHorzCenter 1 Horizontally align to the center
qg_AlignHorzRight 2 Horizontally align to the right
qg_AlignVertTop 0 Vertically align to the top
qg_AlignVertCenter 1 Vertically align to the center
qg_AlignVertBottom 2 Vertically align to the bottom

TIP Use the reserved value -1 to leave an alignment parameter unchanged while modifying the other.

NOTE If the command is not called, the default values are used (qg_AlignHorzLeft and qg_AlignVertTop for horizontal and vertical alignment respectively).

Example

   // Center the text within the caption rectangle horizontally and vertically

C_LONGINT($err)

$err:=QG_SetCaptionAlignment (xGrid;qg_AlignVertCenter;qg_AlignHorzCenter)
ASSERT($err=qg_noErr)

Related commands

QG_GetCaptionAlignment Get the caption text alignment
QG_SetCaptionFont Set the caption font
QG_SetCaptionColors Set the caption colors