author | Jan Vrany <jan.vrany@labware.com> |
Thu, 25 Aug 2022 11:29:18 +0100 | |
branch | jv |
changeset 2607 | ddf2eb8b3f1d |
parent 1567 | e17701a073f9 |
permissions | -rwxr-xr-x |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
98 | 2 |
|
193 | 3 |
"{ NameSpace: RegressionTests }" |
4 |
||
98 | 5 |
ApplicationModel subclass:#TestDialogs1 |
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
193 | 9 |
category:'tests-Regression' |
98 | 10 |
! |
11 |
||
12 |
!TestDialogs1 class methodsFor:'documentation'! |
|
13 |
||
14 |
documentation |
|
15 |
" |
|
16 |
documentation to be added. |
|
17 |
||
18 |
[author:] |
|
1447 | 19 |
Claus Gittinger (cg@alan) |
98 | 20 |
|
21 |
[see also:] |
|
22 |
||
23 |
[instance variables:] |
|
24 |
||
25 |
[class variables:] |
|
26 |
" |
|
27 |
! |
|
28 |
||
29 |
examples |
|
30 |
" |
|
31 |
Starting the application: |
|
1447 | 32 |
[exBegin] |
98 | 33 |
TestApplication1 open |
34 |
||
1447 | 35 |
[exEnd] |
98 | 36 |
|
37 |
more examples to be added: |
|
1447 | 38 |
[exBegin] |
39 |
... add code fragment for |
|
98 | 40 |
... executable example here ... |
1447 | 41 |
[exEnd] |
98 | 42 |
" |
43 |
! |
|
44 |
||
45 |
history |
|
46 |
"Created: / 14.12.2000 / 19:19:07 / cg" |
|
47 |
! ! |
|
48 |
||
49 |
!TestDialogs1 class methodsFor:'interface specs'! |
|
50 |
||
51 |
dialogSpec1 |
|
52 |
"This resource specification was automatically generated |
|
53 |
by the UIPainter of ST/X." |
|
54 |
||
55 |
"Do not manually edit this!! If it is corrupted, |
|
56 |
the UIPainter may not be able to read the specification." |
|
57 |
||
58 |
" |
|
59 |
UIPainter new openOnClass:TestApplication1 andSelector:#dialogSpec1 |
|
60 |
TestApplication1 new openInterface:#dialogSpec1 |
|
61 |
" |
|
62 |
||
63 |
<resource: #canvas> |
|
64 |
||
1447 | 65 |
^ |
98 | 66 |
#(#FullSpec |
1447 | 67 |
#name: #dialogSpec1 |
68 |
#window: |
|
98 | 69 |
#(#WindowSpec |
1447 | 70 |
#label: #TestApplication1 |
71 |
#name: #TestApplication1 |
|
72 |
#min: #(#Point 10 10) |
|
73 |
#max: #(#Point 1280 1024) |
|
74 |
#bounds: #(#Rectangle 16 46 316 346) |
|
75 |
) |
|
76 |
#component: |
|
98 | 77 |
#(#SpecCollection |
1447 | 78 |
#collection: #( |
79 |
#(#ActionButtonSpec |
|
80 |
#label: 'OK' |
|
81 |
#name: 'Button1' |
|
82 |
#layout: #(#LayoutFrame 7 0 271 0 132 0 293 0) |
|
83 |
#translateLabel: true |
|
84 |
#model: #accept |
|
85 |
) |
|
86 |
#(#ActionButtonSpec |
|
87 |
#label: 'Cancel' |
|
88 |
#name: 'Button2' |
|
89 |
#layout: #(#LayoutFrame 167 0 271 0 292 0 293 0) |
|
90 |
#translateLabel: true |
|
91 |
#model: #cancel |
|
92 |
) |
|
93 |
) |
|
94 |
||
95 |
) |
|
98 | 96 |
) |
97 |
! |
|
98 |
||
99 |
dialogSpec2 |
|
100 |
"This resource specification was automatically generated |
|
101 |
by the UIPainter of ST/X." |
|
102 |
||
103 |
"Do not manually edit this!! If it is corrupted, |
|
104 |
the UIPainter may not be able to read the specification." |
|
105 |
||
106 |
" |
|
107 |
UIPainter new openOnClass:TestApplication1 andSelector:#dialogSpec2 |
|
108 |
TestApplication1 new openInterface:#dialogSpec2 |
|
109 |
" |
|
110 |
||
111 |
<resource: #canvas> |
|
112 |
||
1447 | 113 |
^ |
98 | 114 |
#(#FullSpec |
1447 | 115 |
#name: #dialogSpec2 |
116 |
#window: |
|
98 | 117 |
#(#WindowSpec |
1447 | 118 |
#label: #TestApplication1 |
119 |
#name: #TestApplication1 |
|
120 |
#min: #(#Point 10 10) |
|
121 |
#max: #(#Point 1280 1024) |
|
122 |
#bounds: #(#Rectangle 16 46 316 346) |
|
123 |
) |
|
124 |
#component: |
|
98 | 125 |
#(#SpecCollection |
1447 | 126 |
#collection: #( |
127 |
#(#ActionButtonSpec |
|
128 |
#label: 'OK' |
|
129 |
#name: 'Button1' |
|
130 |
#layout: #(#LayoutFrame 7 0 271 0 132 0 293 0) |
|
131 |
#translateLabel: true |
|
132 |
#model: #accept |
|
133 |
) |
|
134 |
#(#ActionButtonSpec |
|
135 |
#label: 'Cancel' |
|
136 |
#name: 'Button2' |
|
137 |
#layout: #(#LayoutFrame 167 0 271 0 292 0 293 0) |
|
138 |
#translateLabel: true |
|
139 |
#model: #cancel |
|
140 |
) |
|
141 |
#(#InputFieldSpec |
|
142 |
#name: 'EntryField1' |
|
143 |
#layout: #(#LayoutFrame 50 0 127 0 255 0 149 0) |
|
144 |
#acceptOnPointerLeave: false |
|
145 |
) |
|
146 |
) |
|
147 |
||
148 |
) |
|
98 | 149 |
) |
150 |
! |
|
151 |
||
152 |
dialogSpec3 |
|
153 |
"This resource specification was automatically generated |
|
154 |
by the UIPainter of ST/X." |
|
155 |
||
156 |
"Do not manually edit this!! If it is corrupted, |
|
157 |
the UIPainter may not be able to read the specification." |
|
158 |
||
159 |
" |
|
160 |
UIPainter new openOnClass:TestApplication1 andSelector:#dialogSpec3 |
|
161 |
TestApplication1 new openInterface:#dialogSpec3 |
|
162 |
" |
|
163 |
||
164 |
<resource: #canvas> |
|
165 |
||
1447 | 166 |
^ |
98 | 167 |
#(#FullSpec |
1447 | 168 |
#name: #dialogSpec3 |
169 |
#window: |
|
98 | 170 |
#(#WindowSpec |
1447 | 171 |
#label: #TestApplication1 |
172 |
#name: #TestApplication1 |
|
173 |
#min: #(#Point 10 10) |
|
174 |
#max: #(#Point 1280 1024) |
|
175 |
#bounds: #(#Rectangle 16 46 316 346) |
|
176 |
) |
|
177 |
#component: |
|
98 | 178 |
#(#SpecCollection |
1447 | 179 |
#collection: #( |
180 |
#(#ActionButtonSpec |
|
181 |
#label: 'OK' |
|
182 |
#name: 'Button1' |
|
183 |
#layout: #(#LayoutFrame 7 0 271 0 132 0 293 0) |
|
184 |
#translateLabel: true |
|
185 |
#model: #accept |
|
186 |
#isDefault: true |
|
187 |
) |
|
188 |
#(#ActionButtonSpec |
|
189 |
#label: 'Cancel' |
|
190 |
#name: 'Button2' |
|
191 |
#layout: #(#LayoutFrame 167 0 271 0 292 0 293 0) |
|
192 |
#translateLabel: true |
|
193 |
#model: #cancel |
|
194 |
) |
|
195 |
) |
|
196 |
||
197 |
) |
|
98 | 198 |
) |
199 |
! |
|
200 |
||
201 |
dialogSpec4 |
|
202 |
"This resource specification was automatically generated |
|
203 |
by the UIPainter of ST/X." |
|
204 |
||
205 |
"Do not manually edit this!! If it is corrupted, |
|
206 |
the UIPainter may not be able to read the specification." |
|
207 |
||
208 |
" |
|
209 |
UIPainter new openOnClass:TestApplication1 andSelector:#dialogSpec3 |
|
210 |
TestApplication1 new openInterface:#dialogSpec3 |
|
211 |
" |
|
212 |
||
213 |
<resource: #canvas> |
|
214 |
||
1447 | 215 |
^ |
98 | 216 |
#(#FullSpec |
1447 | 217 |
#name: #dialogSpec3 |
218 |
#window: |
|
98 | 219 |
#(#WindowSpec |
1447 | 220 |
#label: #TestApplication1 |
221 |
#name: #TestApplication1 |
|
222 |
#min: #(#Point 10 10) |
|
223 |
#max: #(#Point 1280 1024) |
|
224 |
#bounds: #(#Rectangle 16 46 316 346) |
|
225 |
) |
|
226 |
#component: |
|
98 | 227 |
#(#SpecCollection |
1447 | 228 |
#collection: #( |
229 |
#(#ActionButtonSpec |
|
230 |
#label: 'OK' |
|
231 |
#name: 'Button1' |
|
232 |
#layout: #(#LayoutFrame 7 0 271 0 132 0 293 0) |
|
233 |
#translateLabel: true |
|
234 |
#model: #accept |
|
235 |
#isDefault: true |
|
236 |
) |
|
237 |
#(#ActionButtonSpec |
|
238 |
#label: 'Cancel' |
|
239 |
#name: 'Button2' |
|
240 |
#layout: #(#LayoutFrame 167 0 271 0 292 0 293 0) |
|
241 |
#translateLabel: true |
|
242 |
#model: #cancel |
|
243 |
) |
|
244 |
#(#InputFieldSpec |
|
245 |
#name: 'EntryField1' |
|
246 |
#layout: #(#LayoutFrame 50 0 127 0 255 0 149 0) |
|
247 |
#acceptOnPointerLeave: false |
|
248 |
) |
|
249 |
) |
|
250 |
||
251 |
) |
|
98 | 252 |
) |
253 |
! |
|
254 |
||
255 |
windowSpec |
|
256 |
"This resource specification was automatically generated |
|
257 |
by the UIPainter of ST/X." |
|
258 |
||
259 |
"Do not manually edit this!! If it is corrupted, |
|
260 |
the UIPainter may not be able to read the specification." |
|
261 |
||
262 |
" |
|
263 |
UIPainter new openOnClass:TestApplication1 andSelector:#windowSpec |
|
264 |
TestApplication1 new openInterface:#windowSpec |
|
265 |
TestApplication1 open |
|
266 |
" |
|
267 |
||
268 |
<resource: #canvas> |
|
269 |
||
1447 | 270 |
^ |
98 | 271 |
#(#FullSpec |
1447 | 272 |
#name: #windowSpec |
273 |
#window: |
|
98 | 274 |
#(#WindowSpec |
1447 | 275 |
#label: 'TestApplication1' |
276 |
#name: 'TestApplication1' |
|
277 |
#min: #(#Point 10 10) |
|
278 |
#max: #(#Point 1024 768) |
|
279 |
#bounds: #(#Rectangle 16 46 316 346) |
|
280 |
#menu: #mainMenu |
|
281 |
) |
|
282 |
#component: |
|
98 | 283 |
#(#SpecCollection |
1447 | 284 |
#collection: #( |
285 |
#(#LabelSpec |
|
286 |
#label: 'Label' |
|
287 |
#name: 'Label1' |
|
288 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
289 |
#translateLabel: true |
|
290 |
#labelChannel: #infoMessageHolder |
|
291 |
) |
|
292 |
) |
|
293 |
||
294 |
) |
|
98 | 295 |
) |
296 |
! ! |
|
297 |
||
298 |
!TestDialogs1 class methodsFor:'menu specs'! |
|
299 |
||
300 |
mainMenu |
|
301 |
"This resource specification was automatically generated by the Browser." |
|
302 |
||
303 |
"Do not manually edit this!! If it is corrupted, |
|
304 |
the MenuEditor may not be able to read the specification." |
|
305 |
||
306 |
" |
|
307 |
MenuEditor new openOnClass:TestApplication1 andSelector:#mainMenu |
|
308 |
" |
|
309 |
||
310 |
<resource: #menu> |
|
311 |
||
312 |
^ #(#Menu |
|
1447 | 313 |
#( |
314 |
#(#MenuItem |
|
315 |
#label: 'File' |
|
316 |
#translateLabel: true |
|
317 |
#submenu: |
|
318 |
#(#Menu |
|
319 |
#( |
|
320 |
#(#MenuItem |
|
321 |
#label: 'Exit' |
|
322 |
#translateLabel: true |
|
323 |
#value: #closeRequest |
|
324 |
) |
|
325 |
) nil |
|
326 |
nil |
|
327 |
) |
|
328 |
) |
|
329 |
#(#MenuItem |
|
330 |
#label: 'Tests' |
|
331 |
#translateLabel: true |
|
332 |
#submenu: |
|
333 |
#(#Menu |
|
334 |
#( |
|
335 |
#(#MenuItem |
|
336 |
#label: 'Dialog1' |
|
337 |
#translateLabel: true |
|
338 |
#value: #testDialog1 |
|
339 |
) |
|
340 |
#(#MenuItem |
|
341 |
#label: 'Dialog2' |
|
342 |
#translateLabel: true |
|
343 |
#value: #testDialog2 |
|
344 |
) |
|
345 |
#(#MenuItem |
|
346 |
#label: 'Dialog3' |
|
347 |
#translateLabel: true |
|
348 |
#value: #testDialog3 |
|
349 |
) |
|
350 |
#(#MenuItem |
|
351 |
#label: 'Dialog4' |
|
352 |
#translateLabel: true |
|
353 |
#value: #testDialog4 |
|
354 |
) |
|
355 |
) nil |
|
356 |
nil |
|
357 |
) |
|
358 |
) |
|
98 | 359 |
|
360 |
||
1447 | 361 |
) nil |
362 |
nil |
|
98 | 363 |
) |
364 |
! ! |
|
365 |
||
366 |
!TestDialogs1 methodsFor:'aspects'! |
|
367 |
||
368 |
infoMessageHolder |
|
369 |
"automatically generated by UIPainter ..." |
|
370 |
||
371 |
"*** the code below creates a default model when invoked." |
|
372 |
"*** (which may not be the one you wanted)" |
|
373 |
"*** Please change as required and accept it in the browser." |
|
374 |
"*** (and replace this comment by something more useful ;-)" |
|
375 |
||
376 |
|holder| |
|
377 |
||
378 |
(holder := builder bindingAt:#infoMessageHolder) isNil ifTrue:[ |
|
1447 | 379 |
holder := ValueHolder new. |
380 |
builder aspectAt:#infoMessageHolder put:holder. |
|
98 | 381 |
|
1447 | 382 |
holder value:' |
383 |
Please check that |
|
98 | 384 |
all dialogs (open via the ''Tests''-menuItem) |
385 |
close when their OK-Button is pressed. |
|
386 |
'. |
|
387 |
]. |
|
388 |
^ holder. |
|
389 |
! ! |
|
390 |
||
391 |
!TestDialogs1 methodsFor:'initialization & release'! |
|
392 |
||
393 |
closeDownViews |
|
394 |
"This is a hook method generated by the Browser. |
|
395 |
It will be invoked when your app/dialog-window is really closed. |
|
396 |
See also #closeDownViews, which is invoked before and may suppress the close |
|
397 |
or ask the user for confirmation." |
|
398 |
||
399 |
"/ change the code below as required ... |
|
400 |
"/ This should cleanup any leftover resources |
|
401 |
"/ (for example, temporary files) |
|
402 |
"/ super closeRequest will initiate the closeDown |
|
403 |
||
404 |
"/ add your code here |
|
405 |
||
406 |
"/ do not remove the one below ... |
|
407 |
^ super closeDownViews |
|
408 |
! |
|
409 |
||
410 |
postBuildWith:aBuilder |
|
411 |
"This is a hook method generated by the Browser. |
|
412 |
It will be invoked during the initialization of your app/dialog, |
|
1447 | 413 |
after all of the visual components have been built, |
98 | 414 |
but BEFORE the top window is made visible. |
415 |
Add any app-specific actions here (reading files, setting up values etc.) |
|
416 |
See also #postOpenWith:, which is invoked after opening." |
|
417 |
||
418 |
"/ add any code here ... |
|
419 |
||
420 |
^ super postBuildWith:aBuilder |
|
421 |
! |
|
422 |
||
423 |
postOpenWith:aBuilder |
|
424 |
"This is a hook method generated by the Browser. |
|
425 |
It will be invoked right after the applications window has been opened. |
|
426 |
Add any app-specific actions here (starting background processes etc.). |
|
427 |
See also #postBuildWith:, which is invoked before opening." |
|
428 |
||
429 |
"/ add any code here ... |
|
430 |
||
431 |
^ super postOpenWith:aBuilder |
|
432 |
! ! |
|
433 |
||
434 |
!TestDialogs1 methodsFor:'menu actions'! |
|
435 |
||
436 |
openAboutThisApplication |
|
437 |
"This method was generated by the Browser. |
|
438 |
It will be invoked when the menu-item 'help-about' is selected." |
|
439 |
||
440 |
"/ could open a customized aboutBox here ... |
|
441 |
super openAboutThisApplication |
|
442 |
! |
|
443 |
||
444 |
openDocumentation |
|
445 |
"This method was generated by the Browser. |
|
446 |
It will be invoked when the menu-item 'help-documentation' is selected." |
|
447 |
||
448 |
"/ change below as required ... |
|
449 |
||
450 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ): |
|
451 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'. |
|
452 |
||
453 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName' |
|
454 |
"/ directory, and open a viewer with: |
|
455 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'. |
|
456 |
! |
|
457 |
||
458 |
testDialog1 |
|
459 |
self openDialogInterface:#dialogSpec1 |
|
460 |
! |
|
461 |
||
462 |
testDialog2 |
|
463 |
self openDialogInterface:#dialogSpec2 |
|
464 |
! |
|
465 |
||
466 |
testDialog3 |
|
467 |
self openDialogInterface:#dialogSpec3 |
|
468 |
! |
|
469 |
||
470 |
testDialog4 |
|
471 |
self openDialogInterface:#dialogSpec4 |
|
472 |
! ! |
|
473 |
||
474 |
!TestDialogs1 class methodsFor:'documentation'! |
|
475 |
||
476 |
version |
|
477 |
^ '$Header$' |
|
478 |
! ! |
|
1567
e17701a073f9
Added abstract VMSpawningTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
479 |