begin
open(1)"X0"
sg! = BBjAPI().getSysGui()
win! = BBjAPI().getSysGui().addWindow(50,50,500,400,"")
grid! = win!.addGrid(100,101,102,5,5,490,350)
button! = win!.addButton(201,50,360,90,25,"RowHeader")
button!.setCallback(button!.ON_BUTTON_PUSH,"row_header2")
button2! = win!.addButton(301,150,360,120,25,"toggleRepaintEnabled")
button2!.setCallback(button!.ON_BUTTON_PUSH,"toggleRepaintEnabled")
grid!.setNumColumns(2)
grid!.setHasRowHeader(1)
grid!.setNumRows(50)
grid!.setHorizontalLinesVisible(1)
grid!.setVerticalLinesVisible(1)
grid!.setVerticalScrollable(1)
grid!.setColumnStyle(0,grid!.GRID_STYLE_INPUTN)
grid!.setColumnAlignment(0,grid!.GRID_ALIGN_RIGHT)
grid!.setColumnStyle(1,grid!.GRID_STYLE_INPUTE)
grid!.setColumnAlignment(1,grid!.GRID_ALIGN_LEFT)
font! = BBjAPI().getSysGui().makeFont("Courier",10,0)
grid!.setFont(font!)
grid!.setColumnMask(0,"### ##0B")
for row = 0 to 49
tmp$ = str(rnd(99999))
grid!.setCellText(row,0,tmp$)
tmp$ = str(10 * row:"#########0")
grid!.setCellText(row,1,tmp$)
next row
win!.setCallback(win!.ON_CLOSE,"do_ex")
process_events
do_ex:
release
row_header:
rowHeader! = grid!.getRowHeader()
v! = BBjAPI().makeVector()
for row = 0 to 49
v!.addItem("Row "+str(row))
next row
for row = 0 to 49
rowHeader!.setCellText(row,v!.getItem(row))
next row
return
row_header2:
if doEscape
escape
endif
if toggleRepaintEnabled
sg!.setRepaintEnabled(0)
endif
rowHeader! = grid!.getRowHeader()
if toggle
toggle = 0
else
toggle = 1
endif
print "toggle: ", toggle
for row = 0 to 49
wait .02
if toggle
rowHeader!.setCellText(row,"Row "+str(row))
else
rowHeader!.setCellText(row, "")
endif
next row
if doEscape
escape
endif
if toggleRepaintEnabled
sg!.setRepaintEnabled(1)
endif
return
toggleRepaintEnabled:
if toggleRepaintEnabled
toggleRepaintEnabled = 0
else
toggleRepaintEnabled = 1
endif
return
|