Hello,
Why isn't my text in the center?
John.
B4X:
Sub GetListTempSensors()
Dim myselect As String
Dim sql As SQL = DBMdomotica.GetSQL
myselect = "SELECT tblinputs.*, tblmodules.code FROM tblinputs INNER JOIN tblmodules ON (tblinputs.idmodule = tblmodules.idmodule) WHERE tblmodules.soort = 'a'"
Dim myresult As List = DBMdomotica.SQLSelect(sql,myselect)
DBMdomotica.CloseSQL(sql)
If myresult.size > 0 Then
MainForm.WindowWidth = 20
MainForm.WindowHeight = 150
Dim r As Int
For r = 0 To myresult.Size - 1
Dim resultdata As Map = myresult.Get(r)
Dim mytemp As temperatuur
mytemp.beschrijving = resultdata.Get("beschrijving")
mytemp.inputid = resultdata.Get("idinput")
mytemp.idmodule = resultdata.Get("idmodule")
mytemp.modulecode = resultdata.Get("code")
mytemp.tempvalue = 0
Dim mypane As Pane
mypane.Initialize("")
mypane.Tag = mytemp.modulecode
Dim mytextlabel As Label
mytextlabel.Initialize("mytextlabel")
mytextlabel.Text = mytemp.beschrijving
mytextlabel.TextSize = 10
mytextlabel.Id = "myTextLabel"
mypane.AddNode(mytextlabel,5,5,90,20)
Dim mylabel As Label
mylabel.Initialize("myLabel")
mylabel.Id = "myLabel"
mylabel.Text = "30 °C"
mylabel.Tag = mytemp.modulecode
mylabel.TextSize = 16
'mylabel.Style = "-fx-text-alignment: justify"
mypane.AddNode(mylabel,5,25,90,40)
CSSUtils.SetBorder(mylabel,1,fx.Colors.Black,5)
CSSUtils.SetStyleProperty(mylabel,"-fx-text-alignment","center")
' CSSUtils.SetStyleProperty(mylabel,"-fx-hpos","center")
' CSSUtils.SetStyleProperty(mylabel,"-fx-vpos","center")
CSSUtils.SetBackgroundColor(mylabel, fx.Colors.Yellow)
PanelMain.AddNode(mypane,r*100,10,100,50)
MainForm.WindowWidth = MainForm.WindowWidth + 100
' 'Dim mygauge As Gauge
' 'mygauge.Initialize("gauge")
' 'mygauge.Tag = mytemp.modulecode
' 'PanelMain.AddNode("Gauge1",(r+1)*100,100,200,200)
' PanelMain.LoadLayout("Gauge")
' For Each n As Node In PanelMain.GetAllViewsRecursive
' 'If n.Id = "Gauge1" Then
'
' 'Log ("gauge " & n)
' 'Dim mygauge As Gauge = n
' Dim mypane As Pane = n
' mypane.Left = (r+1) * 100
' mypane.Top = 100
' Log (r)
'' InitGauge(mygauge,-5,50,mytemp.tempvalue,1,mytemp.beschrijving,"°C","DASHBOARD","")
' Exit
' 'End If
' Next
'InitGauge(mygauge,-5,50,mytemp.tempvalue,1,mytemp.beschrijving,"°C","DASHBOARD","")
listTemp.Add(mytemp)
Next
End If
End Sub
Why isn't my text in the center?
John.