-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGridExSample.bbj
39 lines (26 loc) · 936 Bytes
/
GridExSample.bbj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
use ::BBjGridExWrapper.bbj::BBjGridExWrapper
wnd! = BBjAPI().openSysGui("X0").addWindow(10,10,800,600,"BBjGridExWidget")
gridex! = new BBjGridExWidget(wnd!,100,10,10,780,500)
grid! = new BBjGridExWrapper(gridex!)
selection! = wnd!.addStaticText(101,10,530,400,30,"")
CALL "setupgrid.bbj"
wnd!.setCallback(BBjAPI.ON_CLOSE,"byebye")
wnd!.setCallback(BBjAPI.ON_RESIZE,"resize")
rem grid!.setCallback(BBjAPI.ON_GRID_SELECT_ROW,"on_grid_select")
process_events
on_grid_select:
ev! = BBjAPI().getLastEvent()
row = ev!.getRow()
info$ = "You selected "+grid!.getCellText(row,0)+": '"+grid!.getCellText(row,1)+"' by "+grid!.getCellText(row,2)
selection!.setText(info$)
return
resize:
ev! = BBjAPI().getLastEvent()
h = ev!.getHeight()
w = ev!.getWidth()
grid!.setSize(w-20,h-100)
selection!.setLocation(10,h-70)
return
byebye:
release