BBjGrid::fillGridWithColumns

Description

In BBj 2.03 and higher, this method specifies whether to fit all columns into the displayed width of the BBjGrid.

Syntax

Return Value

Method

void

fillGridWithColumns(int fit)

Parameters

Variable

Description

fit

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

If fit equals zero, then all columns in the parent window will be proportionately stretched to take all available space in the grid. If fit equals any other number than zero, then the number of columns will be proportionately stretched to take all available space according to that number.

Return Value

None.

Remarks

The behavior of this method is the same as the behavior of Fit Columns to Window - GRID SENDMSG() Function 29..

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,300,200,"Sample Window",$02$)
MainWindow!.setCallback(MainWindow!.ON_CLOSE,"APP_CLOSE")

rem 'Make and configure the grid
let myGrid!=MainWindow!.addGrid(100,3,3,197,197)
myGrid!.setNumRows(10)
myGrid!.setNumColumns(5)
myGrid!.setVerticalLinesVisible(mySysGui!.TRUE)
myGrid!.setHorizontalLinesVisible(mySysGui!.TRUE)

rem 'scale up the first column to take all available space
b1!= MainWindow!.addButton(101,210,3,80,20,"1",$$)
b1!.setCallback(b1!.ON_BUTTON_PUSH, "SET_1")

rem 'proportionally scale the first 3 columns to take all available space
b3!= MainWindow!.addButton(102,210,26,80,20,"3",$$)
b3!.setCallback(b3!.ON_BUTTON_PUSH, "SET_3")

rem 'proportionally scale all 5 columns to take all available space
b5!= MainWindow!.addButton(103,210,49,80,20,"5",$$)
b5!.setCallback(b5!.ON_BUTTON_PUSH, "SET_5")

rem 'set all columns to the same size
beq!= MainWindow!.addButton(104,210,72,80,20,"equal",$$)
beq!.setCallback(beq!.ON_BUTTON_PUSH, "SET_EQ")
process_events

SET_1:
    myGrid!.fillGridWithColumns(1)
return

SET_3:
    myGrid!.fillGridWithColumns(3)
return

SET_5:
    myGrid!.fillGridWithColumns(5)
return

SET_EQ:
    for i=0 to 4
        myGrid!.setColumnWidth(i,20)
    next i
return

APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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