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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
| DIM Frame1 AS Frame DIM btn9 AS Button DIM btn8 AS Button DIM btn7 AS Button DIM btn6 AS Button DIM btn5 AS Button DIM btn4 AS Button DIM btn3 AS Button DIM btn2 AS Button DIM btn1 AS Button DIM btn0 AS Button DIM btnVirgule AS Button DIM btnAddition AS Button DIM btnSoustraction AS Button DIM btnMultiplication AS Button DIM btnDivision AS Button DIM btnCancel AS Button DIM btnEgal AS Button DIM btnEffacer AS Button
ME.Icon = Picture["chukablue2.png"] '<---------------| Me est l'objet qui contient les autres ME.Padding = 5 ME.Arrangement = Arrange.Vertical ME.Text = "Calculatrice +++"
IF IsNull(ME.Parent) THEN ME.h = Desktop.H / 4 ME.w = Desktop.W / 4 ENDIF
Frame1 = NEW Frame(ME) Frame1.Arrangement = Arrange.none Frame1.Padding = 5 Frame1.Expand = TRUE Frame1.MoveScaled(1, 1, 48, 48) Frame1.Font = Font["Bold,11"] Frame1.Text = ("Calculatrice") Frame1.Alignment = Align.Left
$tbAffichage = NEW TextBox(Frame1) $tbAffichage.MoveScaled(2, 5, 44, 5) $tbAffichage.Font = Font["Bold,12"] $tbAffichage.Foreground = Color.Black $tbAffichage.Alignment = Align.Right
btn7 = NEW Button(Frame1) AS "Chiffres" btn7.Name = "btn7" btn7.MoveScaled(2, 12, 10, 6) btn7.Font = Font["Bold,14"] btn7.Foreground = Color.Black btn7.Text = ("7") btn7.Expand = TRUE
btn0 = NEW Button(Frame1) AS "Chiffres" btn0.Name = "btn0" btn0.MoveScaled(2, 33, 21, 6) btn0.Font = Font["Bold,14"] btn0.Foreground = Color.Black btn0.Text = ("0") btn0.Expand = TRUE
btn4 = NEW Button(Frame1) AS "Chiffres" btn4.Name = "btn4" btn4.MoveScaled(2, 19, 10, 6) btn4.Font = Font["Bold,14"] btn4.Foreground = Color.Black btn4.Text = ("4") btn4.Expand = TRUE
btn1 = NEW Button(Frame1) AS "Chiffres" btn1.Name = "btn1" btn1.MoveScaled(2, 26, 10, 6) btn1.Font = Font["Bold,14"] btn1.Foreground = Color.Black btn1.Text = ("1") btn1.Expand = TRUE
btnVirgule = NEW Button(Frame1) AS "Chiffres" btnVirgule.Name = "btnVirgule" btnVirgule.MoveScaled(24, 33, 10, 6) btnVirgule.Font = Font["Bold,14"] btnVirgule.Foreground = Color.Black btnVirgule.Text = (",") btnVirgule.Expand = TRUE
btn8 = NEW Button(Frame1) AS "Chiffres" btn8.Name = "btn8" btn8.MoveScaled(13, 12, 10, 6) btn8.Font = Font["Bold,14"] btn8.Foreground = Color.Black btn8.Text = ("8") btn8.Expand = TRUE
btn5 = NEW Button(Frame1) AS "Chiffres" btn5.Name = "btn5" btn5.MoveScaled(13, 19, 10, 6) btn5.Font = Font["Bold,14"] btn5.Foreground = Color.Black btn5.Text = ("5") btn5.Expand = TRUE
btn2 = NEW Button(Frame1) AS "Chiffres" btn2.Name = "btn2" btn2.MoveScaled(13, 26, 10, 6) btn2.Font = Font["Bold,14"] btn2.Foreground = Color.Black btn2.Text = ("2") btn2.Expand = TRUE
btn9 = NEW Button(Frame1) AS "Chiffres" btn9.Name = "btn9" btn9.MoveScaled(24, 12, 10, 6) btn9.Font = Font["Bold,14"] btn9.Foreground = Color.Black btn9.Text = ("9") btn9.Expand = TRUE
btn6 = NEW Button(Frame1) AS "Chiffres" btn6.Name = "btn6" btn6.MoveScaled(24, 19, 10, 6) btn6.Font = Font["Bold,14"] btn6.Foreground = Color.Black btn6.Text = ("6") btn6.Expand = TRUE
btn3 = NEW Button(Frame1) AS "Chiffres" '<----------- | l'objet entre () est celui où se situe le nouvel objet btn3.Name = "btn3" btn3.MoveScaled(24, 26, 10, 6) btn3.Font = Font["Bold,14"] btn3.Foreground = Color.Black btn3.Text = ("3") btn3.Expand = TRUE
btnAddition = NEW Button(Frame1) AS "Signes" btnAddition.Name = "btnAddition" btnAddition.MoveScaled(36, 12, 10, 6) btnAddition.Font = Font["Bold,14"] btnAddition.Foreground = Color.Black btnAddition.Text = ("+") btnAddition.Expand = TRUE
btnSoustraction = NEW Button(Frame1) AS "Signes" btnSoustraction.Name = "btnSoustraction" btnSoustraction.MoveScaled(36, 19, 10, 6) btnSoustraction.Font = Font["Bold,14"] btnSoustraction.Foreground = Color.Black btnSoustraction.Text = ("-") btnSoustraction.Expand = TRUE
btnMultiplication = NEW Button(Frame1) AS "Signes" btnMultiplication.Name = "btnMultiplication" btnMultiplication.MoveScaled(36, 26, 10, 6) btnMultiplication.Font = Font["Bold,14"] btnMultiplication.Foreground = Color.Black btnMultiplication.Text = ("*") btnMultiplication.Expand = TRUE
btnDivision = NEW Button(Frame1) AS "Signes" '<---------- |quand un "Nom" se répète cela constitue btnDivision.Name = "btnDivision"'<------------------------| un Group à suivre pour le gestionnaire d'évènement btnDivision.MoveScaled(36, 33, 10, 6) btnDivision.Font = Font["Bold,14"] btnDivision.Foreground = Color.Black btnDivision.Text = ("/") btnDivision.Expand = TRUE
btnCancel = NEW Button(Frame1) AS "btnCancel" '<-------- | la déclaration d'un "Nom" sert au gestionnaire d'évènement à suivre btnCancel.MoveScaled(24, 41, 10, 6) '<--------------------| les évènements intervenant sur ce "Nom" btnCancel.Font = Font["Bold,14"] btnCancel.Foreground = Color.Black btnCancel.Text = ("C") btnCancel.Expand = TRUE
btnEgal = NEW Button(Frame1) AS "btnEgal" btnEgal.MoveScaled(36, 41, 10, 6) btnEgal.Font = Font["Bold,14"] btnEgal.Foreground = Color.Black btnEgal.Text = ("=") btnEgal.Expand = TRUE
btnEffacer = NEW Button(Frame1) AS "btnEffacer" btnEffacer.MoveScaled(13, 41, 10, 6) btnEffacer.Font = Font["Bold,11"] btnEffacer.Foreground = Color.Black btnEffacer.Picture = Picture["icon:/22/clear"] btnEffacer.Expand = TRUE
END
|