QG_SetSelectionOptions

QG_SetSelectionOptions(areaRef; selectionFlags; frameColor; frameWidth):errorCode
areaRef Longint QGrid area reference
selectionFlags Longint Selection method
frameColor Longint Color of selection frame
frameWidth Longint Width of selection frame
error Longint Error result

Set the user selection options for 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 selectionFlags specifies the user selection options. QGrid defines the following constants for selectionFlags:

qg_SelectionNotAllowed 1 No user selection is allowed
qg_SelectOneCell 2 Only single cell selection is allowed (default)
qg_SelectManyCells 6 Multiple cell selection is allowed

Parameter frameColor specifies the color used for highlighting (framing) the user-selected cells, and must be expressed in 4D's RGB color notation (0x00RRGGBB - see OBJECT SET RGB COLORS in 4D's documentation).

Parameter frameWidth specifies the frame width in pixels.

NOTE If the command is not called for a QGrid area, the defaults will apply: the user selection option will be set to qg_SelectOneCell, the frame color will be set to 0x00FF0000 (RGB Red) and the frame width will be 2 pixels.

Example

   // Set the area to multi-cell selection mode,
   // and the selection frame to red, 4 pixels thick.

C_LONGINT($err)

$err:=QG_SetSelectionOptions (xGrid;qg_SelectManyCells;0x00FF0000;4)
ASSERT($err=qg_noErr)

Related commands

QG_GetSelectionOptions Get the user selection options for a QGrid area