Sub ShowTales(rset As DBResult)
Dim lmap As Map
lmap.Initialize
lmap.Clear
tvTables.Items.Clear
tvTables.SetColumns(Array As String("T0","T1", "T2", "T3","T4","T0","T1", "T2","f9","f10"))
Dim nc As Int=10
Dim i As Int
Dim t As Int
For i=0 To tvTables.ColumnsCount-1
tvTables.SetColumnWidth(i,97)
tvTables.SetColumnHeader(i,"")
tvTables.SetColumnSortable(i,False)
Next
tvTables.SingleCellSelection=True
Dim tc(nc) As Object
For Each row() As Object In rset.Rows
Dim lbl As Label
lbl.Initialize("lbl")
lbl.Text=row(1)
lbl.SetSize(85,85)
lmap.Put("tablepckey",row(0))
lmap.Put("occupied",row(3))
lmap.Put("currentcaptainname",row(4))
lmap.Put("currentwaitername",row(5))
lmap.Put("currentlyoccupiedpax",row(6))
lmap.Put("unsettled",row(7))
lmap.Put("billpckey",row(8))
lbl.Alignment="CENTER"
lbl.Style="-fx-background-color: green"
lbl.TextColor=fx.Colors.White
lbl.Font=fx.DefaultFont(20)
If lmap.Get("occupied") Then
lbl.Style="-fx-background-color: red"
End If
If lmap.Get("unsettled") Then
lbl.Style="-fx-background-color: yellow"
lbl.TextColor=fx.Colors.black
End If
lbl.Tag=lmap
tc(t)=lbl
t=t+1
If t >nc-1 Then
Dim tc1(nc) As Object
Dim ci As Int
t=0
For ci=0 To nc-1
tc1(ci)=tc(ci)
tc(ci)=""
Next
tvTables.Items.Add(tc1)
' tvTables.Items.Add(tc)
End If
Next
If t>0 Then
Dim tc1(nc) As Object
Dim ci As Int
t=0
For ci=t To nc-1
tc1(ci)=tc(ci)
Next
tvTables.Items.Add(tc1)
End If
End Sub
Sub Lbl_MouseClicked(EventData As MouseEvent)
Dim l As Label
l=Sender
Dim lm1 As Map
lm1=l.Tag
fx.Msgbox(MainForm, lm1.Get("tablepckey"),"tablepckey")
End Sub