rem 'Set visible columns and rows of a BBjGrid
sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(50,50,500,400,"BBjGrid",$00090083$)
window!.setCallback(window!.ON_CLOSE, "eoj")
rows=10
cols=10
grid! = window!.addGrid(101,10,10,480,280,$81e0$,rows,cols)
grid!.setEditable(1)
grid!.setHasColumnHeader(1)
for col = 0 to cols-1
grid!.setColumnHeaderCellText(col,str(col))
next col
grid!.setColumnHeaderCellText(0,"Line (0)")
grid!.setColumnWidth(0,80)
grid!.setColumnStyle(0,grid!.GRID_STYLE_TEXT)
grid!.setColumnHeaderCellText(1,"Description (1)")
grid!.setColumnWidth(1,420)
grid!.setColumnStyle(1,grid!.GRID_STYLE_TEXT)
grid!.setColumnHeaderCellText(2,"Color (2)")
grid!.setColumnWidth(2,80)
grid!.setColumnStyle(2,grid!.GRID_STYLE_TEXT)
grid!.setColumnHeaderCellText(3,"Text (3)")
grid!.setColumnWidth(3,80)
grid!.setColumnStyle(2,grid!.GRID_STYLE_TEXT)
grid!.setRowHeight(35)
grid!.setSnapToRowHeight(1)
for row = 0 to rows-1
grid!.setCellText(row,0,str(row:"##0"))
next row
setLeftColumn! = window!.addButton(102,10,300,150,25,"setLeftColumn")
setLeftColumn!.setCallback(setLeftColumn!.ON_BUTTON_PUSH,"setLeftColumn")
setColumnVisible! = window!.addButton(103,175,300,150,25,"setColumnVisible")
setColumnVisible!.setCallback(setColumnVisible!.ON_BUTTON_PUSH,"setColumnVisible")
column! = window!.addInputNSpinner(104,375,300,100,25,$$,"#0",0,cols-1)
setTopRow! = window!.addButton(105,10,350,150,25,"setTopRow")
setTopRow!.setCallback(setTopRow!.ON_BUTTON_PUSH,"setTopRow")
setRowVisible! = window!.addButton(106,175,350,150,25,"setRowVisible")
setRowVisible!.setCallback(setRowVisible!.ON_BUTTON_PUSH,"setRowVisible")
row! = window!.addInputNSpinner(107,375,350,100,25,$$,"#0",0,rows-1)
process_events
process_events
eoj:
release
setLeftColumn:
column = column!.getValue()
grid!.setLeftColumn(column)
return
setColumnVisible:
column = column!.getValue()
grid!.setColumnVisible(column)
return
setTopRow:
row = row!.getValue()
grid!.setTopRow(row)
return
setRowVisible:
row = row!.getValue()
grid!.setRowVisible(row)
return
|