-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBBjGridExWrapper.bbj
61 lines (51 loc) · 1.6 KB
/
BBjGridExWrapper.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
60
61
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
use com.basiscomponents.db.ResultSet
use com.basiscomponents.db.DataRow
class public BBjGridExWrapper
field private BBjGridExWidget gridex!
field private ResultSet rs! = new ResultSet()
field private DataRow rec! = new DataRow()
field public BBjNumber NumRows
field public BBjNumber NumColumns
method private BBjGridExWrapper()
methodend
method public BBjGridExWrapper(BBjGridExWidget theGrid!)
#gridex! = theGrid!
methodend
method public void setCellText(BBjNumber row, BBjNumber col, BBjVector v!)
#checkAndAdjustDimension()
r=row
c=col
it! = v!.iterator()
while it!.hasNext()
val! = it!.next()
#rs!.get(r).setFieldValue("C"+str(c),val!)
c=c+1
if c>#NumColumns-1 then
c=0
r=r+1
if r>#NumRows-1 then
break
fi
fi
wend
#gridex!.setData(#rs!)
methodend
method private void checkAndAdjustDimension()
if #rec!.getColumnCount() < #NumColumns then
#rec! = new DataRow()
for i=0 to #NumColumns-1
#rec!.setFieldValue("C"+str(i),"")
next
fi
if #rs!.size()>#NumRows then
for i=#NumRows to #rs!.size()-1
#rs!.remove(#rs!.size())
next
else
while #rs!.size()<#NumRows
#rs!.add(#rec!.clone())
wend
fi
methodend
classend