QG_SetCellsPerRow
QG_SetCellsPerRow(areaRef; cellsPerRow):errorCode | |||
---|---|---|---|
![]() |
areaRef | Longint | QGrid area reference |
![]() |
cellsPerRow | Longint | Number of cells per row |
![]() |
error | Longint | Error result |
Specify the number of cells per row of the QGrid area
Contrary to how the QGrid area normally behaves, i.e. showing as many cells per row as its width allows, this command allows to specify a fixed number of cells per row. When necessary, QGrid will automatically display the horizontal scrollbar.
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
Parameter cellsPerRow specifies the number of cells per grid row.
TIP To set up the plug-in area as a horizontal strip (single row), set cellsPerRow to MAXLONG. For a vertical strip (single column), set the number of cells to 1.
TIP Setting cellsPerRow to zero will reset the plug-in area to display as many cells per row as its width allows.
Examples
// Set the plug-in area to display 3 cells per row C_LONGINT($err) $err:=QG_SetCellsPerRow (xGrid;3) ASSERT($err=qg_noErr)
// Set the plug-in area to display as many cells per row as its width allows C_LONGINT($err) $err:=QG_SetCellsPerRow (xGrid;0) ASSERT($err=qg_noErr)
// Set the plug-in area to display as a single row horizontal strip C_LONGINT($err) $err:=QG_SetCellsPerRow (xGrid;MAXLONG) ASSERT($err=qg_noErr)
Related commands
QG_GetCellsPerRow | Get the number of cells per row specified for the QGrid area |