Set Best Fit - GRID SENDMSG() Function 24

Syntax

TF$=SENDMSG(sysgui,id,24,extra_pixels,string_list{,context{,ERR=lineref}})

Description

This function adjusts the width of each column. The width of each column is set by taking the width of the corresponding string in the list and adding the extra_pixels value.

Parameter

Description

Sysgui

SYSGUI channel.

id

Grid control ID.

24

Number of this SENDMSG() function.

extra_pixels

Extra pixels to be added to the width of each column.

string_list

List of strings terminated with line feeds ($0A$). There should be one string for each column.

The return value is a one-byte string that indicates the success or failure of an operation; $01$ indicates success, $00$ indicates failure.

Example

The following shows the use of Grid SENDMSG() Function 24 to set variable column widths:

let sysgui=unt; open (sysgui)"X0"
print (sysgui)'window'(50,50,200,150,"",$$,$$)
print (sysgui)'grid'(100,20,20,160,120,$9040$,3,3,3)
result$=sendmsg(sysgui,100,68,150/4,$$); rem row height
for col=0 to 2
result$=sendmsg(sysgui,100,36,col,chr(1)); rem column width
next col
result$=sendmsg(sysgui,100,57,0,$$); rem turn off color change highlighting
for row=0 to 2
tf$=sendmsg(sysgui,100,48,row,$$)
for col=0 to 2
tf$=sendmsg(sysgui,100,22,col,fill(col+1,"Y"))
next col
next row
tf$=sendmsg(sysgui,100,24,10,"XX"+$0a$+"XXX"+$0a$+"XXXX"+$0a$)
escape

See Also

Set Column Width - Grid SENDMSG() Function 36 and Fit Columns to Window - Grid SENDMSG() Function 29.

BBjGrid::setFitToGrid