-
Notifications
You must be signed in to change notification settings - Fork 7
/
ToolPanelDemo.bbj
60 lines (43 loc) · 1.51 KB
/
ToolPanelDemo.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
use com.basiscomponents.bc.SqlQueryBC
use java.sql.Types
use com.google.gson.JsonObject
? 'HIDE'
declare auto BBjTopLevelWindow wnd!
declare auto BBjListButton lb_db!
declare auto BBjListButton lb_tbl!
declare auto BBjToolButton btn_fit!
declare BBjGridExWidget grid!
lic!=System.getProperty("bbjgridexwidget.license")
if lic!=null() or str(lic!)="" then
a=msgbox("set license key in bbj.properties under bbjgridexwidget.license=<yourlicense>",48,"Demo for Enterprise Features")
release
fi
BBjGridExWidget.setLicenseKey(lic!)
wnd! = BBjAPI().openSysGui("X0").addWindow(10,10,800,600,"BBj Grid Ex Demo")
grid! = new BBjGridExWidget(wnd!,100,0,0,800,600)
grid!.setShowToolPanel(1)
grid!.setEnableRowGroup(1)
grid!.setSuppressValues(1)
grid!.setFunctionsReadOnly(0)
grid!.setRowGroupPanelShow(grid!.GRID_GROUPPANEL_SHOW_VISIBLE())
musicTypeStyle! = new JsonObject()
musicTypeStyle!.addProperty("background","gold")
grid!.addStyle(".music-type",musicTypeStyle!)
wnd! .setCallback(BBjAPI.ON_CLOSE,"byebye")
wnd! .setCallback(BBjAPI.ON_RESIZE,"resize")
gosub fillGrid
process_events
fillGrid:
declare SqlQueryBC sbc!
sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore"))
rs! = sbc!.retrieve("SELECT * FROM CDINVENTORY")
rs!.setAttribute(6,"TOOLPANEL_CLASS","music-type")
grid!.setData(rs!,"CDNUMBER")
return
byebye:
bye
resize:
ev! = BBjAPI().getLastEvent()
grid!.setSize(ev!.getWidth(),ev!.getHeight())
return