counter = 0
GraphicsWindow.Width = 500
GraphicsWindow.Height = 600
GraphicsWindow.FontSize = 11
GraphicsWindow.Title = "Обратный таймер"
GraphicsWindow.BrushColor = "Blue"
Controls.ButtonClicked = OnButtonClick
Controls.TextTyped = OnTextTyped
Edit_1 = Controls.AddTextBox(50,50)
Controls.SetSize(Edit_1, 300,25)
Controls.SetTextBoxText(Edit_1,"1000")
Button_1 = Controls.AddButton("запустить обратный таймер ", 50,150)
Controls.SetSize(Button_1, 300,50)
Sub OnTextTyped
edit = Controls.LastTypedTextBox
myres = Controls.GetTextBoxText(edit)
EndSub
Sub OnButtonClick
button = Controls.LastClickedButton
If button = Button_1 Then
Controls.HideControl(edit)
counter = myres
Timer.Interval = 1000
Timer.Tick = Ontick
EndIf
Endsub
Sub Ontick
counter = counter - 1
GraphicsWindow.BrushColor = " White"
GraphicsWindow.FillRectangle(0,0,500,200)
GraphicsWindow.BrushColor = " Red"
GraphicsWindow.FontSize = 25
GraphicsWindow.DrawText(200,50,counter)
Endsub
|