GraphicsWindow.Height = 500
GraphicsWindow.Width = 500
GraphicsWindow.PenColor ="purple"
Turtle.Show()
Turtle.Speed = 8
Turtle.X = 250
Turtle.Y = 250
For i = 0 to 400 step 5
Turtle.Move(i)
Turtle.Turn(100)
Turtle.Turn(100)
EndFor
Turtle.turn(360)
Turtle.Hide()
x = 100
y = 100
w = 20
h = 20
stato1 = "true"
Nome_font = "Arial"
Grandezza_font = 14
Colore_font = 14
Testo_inserito = "prova"
GraphicsWindow.PenColor = Colore_font
GraphicsWindow.FontName = Nome_font
GraphicsWindow.FontSize = Grandezza_font
GraphicsWindow.MouseDown = OnMouseDown
TestoADestra = Controls.addtextbox (120,100)
Controls.TextTyped = reinserisci_testo
Controls.SetTextBoxText(testoadestra,Testo_inserito)
Sub reinserisci_testo
Controls.SetTextBoxText(testoadestra,Testo_inserito)
EndSub
if STATO1 = "false" then
GraphicsWindow.PenColor = "black"
GraphicsWindow.BrushColor = "white"
GraphicsWindow.FillRectangle(100,100,20,20)
GraphicsWindow.DrawRectangle(100,100,20,20)
endif
If stato1 = "true" Then
GraphicsWindow.PenColor = "black"
GraphicsWindow.BrushColor = "red"
GraphicsWindow.FillRectangle(100,100,20,20)
GraphicsWindow.DrawRectangle(100,100,20,20)
EndIf
Sub onmousedown
X2= GraphicsWindow.MouseX
y2 =GraphicsWindow.MouseY
GraphicsWindow.DrawBoundText(10,10,100,"OK")
If x < X2 And y < y2 And X2 > x and y2 > y And stato1 = "false" Then
GraphicsWindow.PenColor = "black"
GraphicsWindow.BrushColor= "red"
GraphicsWindow.FillRectangle(100,100,20,20)
GraphicsWindow.DrawRectangle(100,100,20,20)
stato1 = "true"
Else
GraphicsWindow.PenColor = "Black"
GraphicsWindow.BrushColor = "white"
GraphicsWindow.FillRectangle(100,100,20,20)
stato1 = "false"
EndIf
EndSub