#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 400
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
CreateColors(50,50)
CreateColors(50,100)
CreateColors(50,150)
End Sub
Sub CreateColors(l As Int, t As Int)
Private pnGauge As Pane
pnGauge.Initialize("")
MainForm.RootPane.AddNode(pnGauge,l,t,270,49)
Dim mycolors(3,15), mynames(3,15) As String
mycolors(1,1)="255,255,255"
mycolors(1,2)="192,192,192"
mycolors(1,3)="255,0,0"
mycolors(1,4)="255,255,0"
mycolors(1,5)="0,255,0"
mycolors(1,6)="0,255,255"
mycolors(1,7)="0,0,255"
mycolors(1,8)="255,0,255"
mycolors(1,9)="255,128,128"
mycolors(1,10)="128,255,0"
mycolors(1,11)="128,255,128"
mycolors(1,12)="128,128,255"
mycolors(1,13)="128,255,255"
mycolors(1,14)="255,128,255"
mycolors(2,1)="0,0,0"
mycolors(2,2)="128,128,128"
mycolors(2,3)="128,0,0"
mycolors(2,4)="128,128,0"
mycolors(2,5)="0,128,0"
mycolors(2,6)="0,128,128"
mycolors(2,7)="0,0,128"
mycolors(2,8)="128,0,128"
mycolors(2,9)="255,128,0"
mycolors(2,10)="255,255,128"
mycolors(2,11)="0,255,128"
mycolors(2,12)="128,0,255"
mycolors(2,13)="0,128,255"
mycolors(2,14)="255,0,128"
mynames(1,1)="white"
mynames(1,2)="ltgray"
mynames(1,3)="red"
mynames(1,4)="yellow "
mynames(1,5)="green"
mynames(1,6)="ltblue"
mynames(1,7)="blue"
mynames(1,8)="magenta"
mynames(1,9)="pink"
mynames(1,10)="lime"
mynames(1,11)="pastelgreen"
mynames(1,12)="ltviolet"
mynames(1,13)="pastelblue"
mynames(1,14)="pastelviolet"
mynames(2,1)="black"
mynames(2,2)="gray"
mynames(2,3)="dkred"
mynames(2,4)="brown"
mynames(2,5)="dkgreen"
mynames(2,6)="aqua"
mynames(2,7)="dkblue"
mynames(2,8)="dkviolet"
mynames(2,9)="orange"
mynames(2,10)="ltyellow"
mynames(2,11)="ltgreen"
mynames(2,12)="blviolet"
mynames(2,13)="skyblue"
mynames(2,14)="hotpink"
Dim myWidth As Int
myWidth=15dip
For y=1 To 2
For x=1 To 14
Dim cLabel As Label
cLabel.Initialize("")
pnGauge.AddNode(cLabel,x*(myWidth+2),(y-1)*(myWidth+2),myWidth, myWidth)
Dim r, g, b As Int
Dim RGBColor() As String
RGBColor=Regex.Split(",", mycolors(y,x))
r=RGBColor(0)
g=RGBColor(1)
b=RGBColor(2)
cLabel.Style=$"-fx-background-color:rgb(${r},${g},${b});"$
Next
Next
pnGauge.PrefWidth=(x*(myWidth+2))+myWidth '270
pnGauge.PrefHeight=((y-1)*(myWidth+2))+myWidth '49
End Sub