Set Up Grid - GRID SENDMSG() Function 30

Syntax

TF$=SENDMSG(sysgui,id,30,0,grid_description${,context{,ERR=lineref}})

Description

For BBj-specific documentation, see Set Up Grid - GRID SENDMSG() Function 30 BBj.

This function combines the functionality of several other grid SENDMSG() functions to set several characteristics of a grid in one command. The return value is a one-byte string that indicates the success or failure of an operation; $01$ indicates success, $00$ indicates failure.

Parameter

Description

sysgui

SYSGUI channel.

id

Grid control ID.

30

Number of this SENDMSG() function.

0

Always zero.

grid_descriptions$

String that contains the grid parameters.

"ROWS:U(4),COLS:U(1),COLWIDTHS[cols]:U(2),INTERSPACE[cols]:U(2),
 USERSIZE:U(1),COLMASKS[cols]:C(mask_len)"

 


Field

Offset/Length

Description


ROWS

1,4

Number of grid rows, ranging from 0 to 2,100,000,000. Unsigned integer.


COLS

5,1

Number of columns in the grid, ranging from 0 to 255. Unsigned Integer


COLWIDTHS

(6,2)*COLS

Array of column widths in current units. A value must be provided for each column in the grid. Unsigned integer.


INTERSPACE

(6,2)*COLS,2

The default row height is based on the grid's font. The row height can be increased some number of pixels by setting interspace to a value greater than zero. Grid SENDMSG() Function 60 sets interspace with one value. To use Grid SENDMSG() Function 30 to set interspace, this array must be filled with values greater than zero. The number of array elements must equal the number of columns. If any array value is zero, this function will have no effect. If array values are all greater than zero but are not equal, the value of the first array element will be used. If any array values are less than zero, an !ERROR=41 will result.


USERSIZE

(6,2)*COLS+2,1

A flag that controls whether the user can change column widths. If the value of this parameter is 1, column widths can be changed. Unsigned integer.


COLMASKS$

(6,2)*COLS+3,m

Optionally sets a mask for each column in the grid mask. If this field is specified, a mask field must exist for each column in the grid. The mask is created according to the rules for masking INPUTE controls. Each mask field must be terminated with a null ($00$). If a column does not need a mask, enter an empty string as the mask. Columns with no mask defined can contain up to 255 characters.

Example

The following example uses SENDMSG() Function 30 to set column width:

sysgui=unt; open (sysgui)"X0"
print (sysgui)'window'(50,50,200,150,"Grid Sample",$$,$$) print (sysgui)'grid'(100,20,20,160,120,$9040$,8,3,3)
result$=sendmsg(sysgui,100,56,0,$000000$)
dim
ts$:"rows:u(4),cols:u(1),colwidth[3]:u(2),interspace[3]:u(2),usersize:u(1)"
ts.rows=8,ts.cols=3,ts.colwidth[1]=25,ts.colwidth[2]=50,ts.colwidth[3]=75
result$=sendmsg(sysgui,100,30,0,ts$); rem ' initialize grid escape



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.