QGrid
![]() |
![]() ![]() |
QG_UpdateArea(areaRef; updateType; firstCell; lastCell):errorCode | |||
![]() |
areaRef | Longint | QGrid area reference |
![]() |
updateType | Longint | Type of update |
![]() |
firstCell | Longint | First cell index |
![]() |
lastCell | Longint | Last cell index |
![]() |
error | Longint | Error result |
Updates the contents of a QGrid area.
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
Parameter updateType specifies the kind of update that will apply. QGrid defines the following constants for updateType:
qg_Update_Grid | 2 | Update everything in the grid |
qg_Update_CellContents | 8 | Cell contents have changed |
Pass qg_Update_Grid in updateType to update everything in the grid area.
QGrid will re-evaluate the number of cells using the expression specified with QG_SetNumCells and will redraw the grid cells. Any existing user selection of cells will be deleted. Parameters firstCell and lastCell are not used in this case and could be omitted.
Pass qg_Update_CellContents in updateType to refresh the grid area after changes affecting the contents of the cell picture or caption objects. Cells will be redrawn using the expressions specified with QG_SetCellPicture and QG_SetCellCaption, but their number will be preserved. Any existing user selection of grid cells will be preserved also.
Optional parameters firstCell and lastCell can be used in this second case. When used, they specify a range of cells that needs to be updated instead of the whole grid. When parameter lastCell is not present, only the cell with index firstCell is updated.
Example
`--------------------------------------------------------------------- ` (1) update area xGrid C_LONGINT($err) $err:=QG_UpdateArea (xGrid;qg_Update_Grid) If ($err # qg_noErr) ` Handle the error End if `--------------------------------------------------------------------- ` (2) notify area xGrid that the contents of cells 13 to 20 have changed C_LONGINT($err;$startIndex;&endIndex) $startIndex:=13 $endIndex:=20 $err:=QG_UpdateArea (xGrid;qg_Update_CellContents;$startIndex;&endIndex) If ($err # qg_noErr) ` Handle the error End if |