-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteste.hcb
162 lines (137 loc) · 4.34 KB
/
teste.hcb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
' Arquivo de teste
Imports System
Imports System.Drawing
Imports System.Forms
Imports VGA
Module Info
Dim InfoForm as Control
Dim Info1Label as Control
Dim Info2Label as Control
Dim Info3Label as Control
Public Sub Exibe
Form.Initialize InfoForm
InfoForm.Left = 300
InfoForm.Top = 30
InfoForm.Width = 300
InfoForm.Height = 110
InfoForm.Text = "Informacoes"
Label.Initialize Info1Label
Info1Label.Top = 5
Info1Label.Left = 5
Info1Label.Width = 290
Info1Label.Height = 15
Info1Label.Text = "- Apenas suporta letras e numeros"
Info1Label.Visible = 1
Control.Add InfoForm, Info1Label
Label.Initialize Info2Label
Info2Label.Top = 25
Info2Label.Left = 5
Info2Label.Width = 290
Info2Label.Height = 15
Info2Label.Text = "- Campo de texto simples"
Info2Label.Visible = 1
Control.Add InfoForm, Info2Label
Label.Initialize Info3Label
Info3Label.Top = 45
Info3Label.Left = 5
Info3Label.Width = 290
Info3Label.Height = 15
Info3Label.Text = "- Navegacao apenas usando tecla TAB"
Info3Label.Visible = 1
Control.Add InfoForm, Info3Label
Control.Show InfoForm
End
End
Module Program
Dim MainForm as Control
Dim HelloWorldLabel as Control
Dim OkButton as Control
Dim TempTextBox as Control
Dim TempText as String
Dim CopiaButton as Control
Dim HelloWorldText as String
Public Sub Main(args as String)
VGA.Mode640x480x2
Application.Initialize
Form.Initialize MainForm
MainForm.Top = 30
MainForm.Left = 10
MainForm.Width = 200
MainForm.Height = 110
MainForm.Text = "Navegue usando TAB"
Label.Initialize HelloWorldLabel
String.Copy HelloWorldText, "HELLO WORLD"
HelloWorldLabel.Text = HelloWorldText
HelloWorldLabel.Top = 8
HelloWorldLabel.Left = 4
HelloWorldLabel.Width = 200
HelloWorldLabel.Height = 10
HelloWorldLabel.Visible = 1
Control.Add MainForm, HelloWorldLabel
Button.Initialize OkButton
OkButton.Text = "Enter aqui para SAIR"
OkButton.Top = 21
OkButton.Left = 4
OkButton.Width = 190
OkButton.Height = 20
OkButton.Visible = 1
OkButton.OnKeyPress = AddressOf(OkButton_OnKeyPress)
OkButton.OnClick = AddressOf(OkButton_OnClick)
Control.Add MainForm, OkButton
TextBox.Initialize TempTextBox
String.Copy TempText, "Digite seu nome aqui"
TempTextBox.Text = TempText
TempTextBox.Top = 43
TempTextBox.Left = 4
TempTextBox.Width = 190
TempTextBox.Height = 20
TempTextBox.Visible = 1
TempTextBox.OnKeyPress = AddressOf(TempTextBox_OnKeyPress)
Control.Add MainForm, TempTextBox
Button.Initialize CopiaButton
CopiaButton.Text = "Aplicar Texto"
CopiaButton.Top = 66
CopiaButton.Left = 4
CopiaButton.Width = 190
CopiaButton.Height = 20
CopiaButton.Visible = 1
CopiaButton.OnClick = AddressOf(CopiaButton_OnClick)
Control.Add MainForm, CopiaButton
Info.Exibe
Application.Run MainForm
Graphics.Mode80x25x16
Try
Throw DivByZeroError
Catch Error
Console.Write "Erro simulado em "
Console.Write ErrorFile()
Console.Write ":"
Console.WriteUInt16 ErrorLine()
End
End
Sub OkButton_OnKeyPress(ctrl as Control, e as KeyboardEventArgs)
String.Copy HelloWorldText, "PRESSIONADO "
Dim ptr as PtrByteArray
ptr = HelloWorldText
@ptr = @ptr + 14
ptr = e.AsciiChar
Control.Redraw HelloWorldLabel
End
Sub OkButton_OnClick(ctrl as Control, e as MouseEventArgs)
Application.Exit 0
End
Sub DizHello
String.Copy HelloWorldText, "Hello "
String.Concat HelloWorldText, TempText
Control.Redraw HelloWorldLabel
End
Sub TempTextBox_OnKeyPress(ctrl as Control, e as KeyboardEventArgs)
If e.AsciiChar == 13 Then
DizHello
e.Cancel = 1
End
End
Sub CopiaButton_OnClick(ctrl as Control, e as MouseEventArgs)
DizHello
End
end