TextWindow.WriteLine("To exit, click on the graphics window and press any key")
h = 350 'height
w = 680 'width
GraphicsWindow.Height = h
GraphicsWindow.Width = w
GraphicsWindow.KeyDown = OnKeyDown
GraphicsWindow.BackgroundColor = "Black"
GraphicsWindow.Show()
GraphicsWindow.BrushColor="Yellow"
X["A"]=60
Y["A"]=40
W["A"]=50
H["A"]=10
X["B"]=110
Y["B"]=50
W["B"]=10
H["B"]=50
X["C"]=110
Y["C"]=110
W["C"]=10
H["C"]=50
X["D"]=60
Y["D"]=160
W["D"]=50
H["D"]=10
X["E"]=50
Y["E"]=110
W["E"]=10
H["E"]=50
X["F"]=50
Y["F"]=50
W["F"]=10
H["F"]=50
X["G"]=60
Y["G"]=100
W["G"]=50
H["G"]=10
SegColor["A"][0]="Lime"
SegColor["A"][1]="#131313"
SegColor["A"][2]="Lime"
SegColor["A"][3]="Lime"
SegColor["A"][4]="#131313"
SegColor["A"][5]="Lime"
SegColor["A"][6]="Lime"
SegColor["A"][7]="Lime"
SegColor["A"][8]="Lime"
SegColor["A"][9]="Lime"
SegColor["B"][0]="Lime"
SegColor["B"][1]="Lime"
SegColor["B"][2]="Lime"
SegColor["B"][3]="Lime"
SegColor["B"][4]="Lime"
SegColor["B"][5]="#131313"
SegColor["B"][6]="#131313"
SegColor["B"][7]="Lime"
SegColor["B"][8]="Lime"
SegColor["B"][9]="Lime"
SegColor["C"][0]="Lime"
SegColor["C"][1]="Lime"
SegColor["C"][2]="#131313"
SegColor["C"][3]="Lime"
SegColor["C"][4]="Lime"
SegColor["C"][5]="Lime"
SegColor["C"][6]="Lime"
SegColor["C"][7]="Lime"
SegColor["C"][8]="Lime"
SegColor["C"][9]="Lime"
SegColor["D"][0]="Lime"
SegColor["D"][1]="#131313"
SegColor["D"][2]="Lime"
SegColor["D"][3]="Lime"
SegColor["D"][4]="#131313"
SegColor["D"][5]="Lime"
SegColor["D"][6]="Lime"
SegColor["D"][7]="#131313"
SegColor["D"][8]="Lime"
SegColor["D"][9]="Lime"
SegColor["E"][0]="Lime"
SegColor["E"][1]="#131313"
SegColor["E"][2]="Lime"
SegColor["E"][3]="#131313"
SegColor["E"][4]="#131313"
SegColor["E"][5]="#131313"
SegColor["E"][6]="Lime"
SegColor["E"][7]="#131313"
SegColor["E"][8]="Lime"
SegColor["E"][9]="#131313"
SegColor["F"][0]="Lime"
SegColor["F"][1]="#131313"
SegColor["F"][2]="#131313"
SegColor["F"][3]="#131313"
SegColor["F"][4]="Lime"
SegColor["F"][5]="Lime"
SegColor["F"][6]="Lime"
SegColor["F"][7]="#131313"
SegColor["F"][8]="Lime"
SegColor["F"][9]="Lime"
SegColor["G"][0]="#131313"
SegColor["G"][1]="#131313"
SegColor["G"][2]="Lime"
SegColor["G"][3]="Lime"
SegColor["G"][4]="Lime"
SegColor["G"][5]="Lime"
SegColor["G"][6]="Lime"
SegColor["G"][7]="#131313"
SegColor["G"][8]="Lime"
SegColor["G"][9]="Lime"
exiting="False"
Old_Second=999
Now_Second=0
GraphicsWindow.BrushColor = "Lime"
GraphicsWindow.FillRectangle(238,100,10,10)
GraphicsWindow.FillRectangle(238,150,10,10)
GraphicsWindow.FillRectangle(448,100,10,10)
GraphicsWindow.FillRectangle(448,150,10,10)
While exiting="False"
NowHour=CLOCK.Hour
NowMinute=CLOCK.Minute
NowSecond=Clock.Second
If OldSecond<>NowSecond then
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FillRectangle(0,0,100,30)
GraphicsWindow.BrushColor = "White"
GraphicsWindow.DrawText(0,0,Clock.Time)
OldSecond=NowSecond
If Text.GetLength(NowHour) < 2 THEN
NowHour=Text.Append("0",NowHour)
EndIf
If Text.GetLength(NowMinute) < 2 THEN
NowMinute=Text.Append("0",NowMinute)
EndIf
If Text.GetLength(NowSecond) < 2 THEN
NowSecond=Text.Append("0",NowSecond)
EndIf
TimeString=Text.Append(NowHour,TEXT.Append(NowMinute,NowSecond))
'TextWindow.WriteLine("Timestring= "+TimeString)
x_offset=0
For I=1 to 6
If I>1 then
'Shift right 80 pixel each digit, starting from the second
x_offset=x_offset+95
If I = 3 or i= 5 then
x_offset = x_offset + 25
EndIf
EndIf
Curr_value=Text.GetSubText(TimeString,I,1)
For Segment = 65 to 71
'TextWindow.WriteLine(Text.Append("Segment= ",text.GetCharacter(Segment)))
GraphicsWindow.BrushColor=SegColor[text.GetCharacter(Segment)][Curr_value]
If SegColor[text.GetCharacter(Segment)][Curr_value]="Lime" then
GraphicsWindow.FillRectangle(X[text.GetCharacter(Segment)]+x_offset+1,Y[text.GetCharacter(Segment)]+1,W[text.GetCharacter(Segment)]-2,H[text.GetCharacter(Segment)]-2)
Else
GraphicsWindow.FillRectangle(X[text.GetCharacter(Segment)]+x_offset,Y[text.GetCharacter(Segment)],W[text.GetCharacter(Segment)],H[text.GetCharacter(Segment)])
EndIf
EndFor
EndFor
EndIf
Endwhile
Program.End()
'-----------------------------------------------------------------------------------------------------------
'--- Take note of the fact that a key has been pressed.
'-----------------------------------------------------------------------------------------------------------
Sub OnKeyDown
exiting = "True"
EndSub