BBjGrid::setFitToGrid

Description

Specifies whether to fit all columns into the displayed width of the BBjGrid.

Syntax

Return Value

Method

void

setFitToGrid(int fit)

Parameters

 

Variable

Description

fit

Specifies how columns will grow the grid is resized with one of the following styles listed below:

Style Value Constants

AUTO_RESIZE_OFF

Description

Turns the auto-resizing of columns off, but the grid will retain proportional values of the columns.

 

AUTO_RESIZE_NEXT_COLUMN

 

Only varies the size of the column after the one manually being resized.

 

AUTO_RESIZE_SUBSEQUENT_COLUMNS

 

Varies the size of all columns after the one resized.

 

AUTO_RESIZE_LAST_COLUMN

 

Varies the size of the last column only when any column in the grid is resized.

 

AUTO_RESIZE_ALL_COLUMNS

Varies the size of all columns in the grid when one column is manually resized.

Return Value

None.

Remarks

Using the fit value 0 is equivalent to AUTO_RESIZE_OFF.

Using the fit value 1 is equivalent to AUTO_RESIZE_ALL_COLUMNS.

Use of numeric constants is not recommended. Use one of the constants listed above.

Example

rem 'Turn the fit to grid option on for all columns in a BBjGrid object

rem 'Obtain the instance of the BBjAPI object
let myAPI!=BBJAPI()

rem 'Open the SysGui device
let SYSGUI=UNT
OPEN (SYSGUI)"X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui!=myAPI!.getSysGui()

rem 'Make the window
let MainWindow!=mySysGui!.addWindow(100,100,500,200,"Sample Window",$02$)
MainWindow!.setCallback(MainWindow!.ON_CLOSE,"APP_CLOSE")

rem 'Make and configure the grid
let myGrid!=MainWindow!.addGrid(100,3,3,297,197)
myGrid!.setNumRows(10)
myGrid!.setNumColumns(5)
myGrid!.setHasColumnHeader(mySysGui!.TRUE)
myGrid!.setUserResizable(mySysGui!.TRUE)
myGrid!.setVerticalLinesVisible(mySysGui!.TRUE)
myGrid!.setHorizontalLinesVisible(mySysGui!.TRUE)
boff!= MainWindow!.addButton(101,310,3,180,20,"AUTO_RESIZE_OFF",$$)
boff!.setCallback(boff!.ON_BUTTON_PUSH, "AUTO_RESIZE_OFF")
ball!= MainWindow!.addButton(102,310,26,180,20,"AUTO_RESIZE_ALL_COLUMNS",$$)
ball!.setCallback(ball!.ON_BUTTON_PUSH, "AUTO_RESIZE_ALL_COLUMNS")
blast!= MainWindow!.addButton(103,310,49,180,20,"AUTO_RESIZE_LAST_COLUMN",$$)
blast!.setCallback(blast!.ON_BUTTON_PUSH, "AUTO_RESIZE_LAST_COLUMN")
bnext!= MainWindow!.addButton(104,310,72,180,20,"AUTO_RESIZE_NEXT_COLUMN",$$)
bnext!.setCallback(bnext!.ON_BUTTON_PUSH, "AUTO_RESIZE_NEXT_COLUMN")
bnext!= MainWindow!.addButton(105,310,95,180,20,"AUTO_RESIZE_SUBSEQUENT_COLUMNS",$$)
bnext!.setCallback(bnext!.ON_BUTTON_PUSH, "AUTO_RESIZE_SUBSEQUENT_COLUMNS")
process_events

APP_CLOSE:
release

AUTO_RESIZE_OFF:
    myGrid!.setFitToGrid(mySysGui!.AUTO_RESIZE_OFF)
return

AUTO_RESIZE_ALL_COLUMNS:
    myGrid!.setFitToGrid(mySysGui!.AUTO_RESIZE_ALL_COLUMNS)
return

AUTO_RESIZE_LAST_COLUMN:
    myGrid!.setFitToGrid(mySysGui!.AUTO_RESIZE_LAST_COLUMN)
return

AUTO_RESIZE_NEXT_COLUMN:
    myGrid!.setFitToGrid(mySysGui!.AUTO_RESIZE_NEXT_COLUMN)
return

AUTO_RESIZE_SUBSEQUENT_COLUMNS:
    myGrid!.setFitToGrid(mySysGui!.AUTO_RESIZE_SUBSEQUENT_COLUMNS)
return

See Also

Fit Columns to Window - GRID SENDMSG() Function 29

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.