0
|
1 |
"
|
5
|
2 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
StandardSystemView subclass:#Launcher
|
29
|
14 |
instanceVariableNames:'myMenu logoLabel exitBox saveBox enterBox'
|
0
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Interface-Smalltalk'
|
|
18 |
!
|
|
19 |
|
|
20 |
Launcher comment:'
|
5
|
21 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
22 |
All Rights Reserved
|
|
23 |
|
39
|
24 |
$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.14 1994-08-23 23:48:50 claus Exp $
|
29
|
25 |
'!
|
|
26 |
|
|
27 |
!Launcher class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
|
32 |
All Rights Reserved
|
0
|
33 |
|
29
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
version
|
|
44 |
"
|
39
|
45 |
$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.14 1994-08-23 23:48:50 claus Exp $
|
29
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
Launcher allows startup of smalltalk applications
|
|
52 |
"
|
|
53 |
! !
|
0
|
54 |
|
|
55 |
!Launcher class methodsFor:'instance creation'!
|
|
56 |
|
|
57 |
new
|
|
58 |
^ super
|
|
59 |
extent:(100 @ 100)
|
8
|
60 |
label:'smallTalk'
|
|
61 |
icon:(Form fromFile:'SmalltalkX.xbm' resolution:100)
|
0
|
62 |
|
|
63 |
"Launcher start"
|
|
64 |
! !
|
|
65 |
|
3
|
66 |
!Launcher methodsFor:'initialize / release'!
|
0
|
67 |
|
|
68 |
initialize
|
|
69 |
super initialize.
|
|
70 |
|
29
|
71 |
self initializeMenu.
|
|
72 |
self initializeLogo.
|
|
73 |
|
|
74 |
"/ myMenu borderWidth:0.
|
|
75 |
myMenu origin:(0.0 @ logoLabel height).
|
|
76 |
"/ myMenu font:(self font).
|
|
77 |
"/ self extent:(myMenu extent).
|
|
78 |
|
|
79 |
exitBox := EnterBox2 new.
|
|
80 |
exitBox title:(resources at:'save state before exiting ?\\filename for image:') withCRs.
|
|
81 |
exitBox abortText:(resources at:'abort').
|
|
82 |
exitBox okText:(resources at:'exit').
|
|
83 |
exitBox okText2:(resources at:'save & exit').
|
|
84 |
|
|
85 |
saveBox := EnterBox new.
|
|
86 |
saveBox title:(resources at:'filename for image:') withCRs.
|
|
87 |
saveBox abortText:(resources at:'abort').
|
|
88 |
saveBox okText:(resources at:'save').
|
|
89 |
|
|
90 |
enterBox := EnterBox new.
|
|
91 |
enterBox abortText:(resources at:'abort').
|
|
92 |
enterBox okText:(resources at:'browse').
|
|
93 |
!
|
|
94 |
|
|
95 |
initializeLogo
|
|
96 |
logoLabel := Label in:self.
|
|
97 |
logoLabel form:(Image fromFile:'bitmaps/SmalltalkX.xbm').
|
|
98 |
logoLabel origin:0.0 @ 0.0.
|
|
99 |
logoLabel borderWidth:0.
|
|
100 |
!
|
|
101 |
|
|
102 |
initializeMenu
|
0
|
103 |
myMenu := ClickMenuView
|
3
|
104 |
labels:(resources array:#(
|
17
|
105 |
'Browsers'
|
3
|
106 |
'Workspace'
|
8
|
107 |
'File Browser'
|
17
|
108 |
'Projects'
|
3
|
109 |
'-'
|
17
|
110 |
'Utilities'
|
|
111 |
'Goodies'
|
|
112 |
'Games & Demos'
|
3
|
113 |
'-'
|
17
|
114 |
'info & help'
|
3
|
115 |
'-'
|
|
116 |
'snapshot'
|
|
117 |
'-'
|
|
118 |
'exit'
|
|
119 |
))
|
8
|
120 |
selectors:#(browserMenu
|
|
121 |
startWorkspace
|
0
|
122 |
startFileBrowser
|
8
|
123 |
projectMenu
|
0
|
124 |
nil
|
|
125 |
utilityMenu
|
|
126 |
goodyMenu
|
|
127 |
gamesMenu
|
|
128 |
nil
|
|
129 |
helpMenu
|
|
130 |
nil
|
|
131 |
saveImage
|
|
132 |
nil
|
|
133 |
exitSmalltalk
|
|
134 |
)
|
|
135 |
receiver:self
|
|
136 |
in:self.
|
|
137 |
|
8
|
138 |
myMenu subMenuAt:#browserMenu put:(
|
3
|
139 |
PopUpMenu labels:(resources array:#(
|
8
|
140 |
'System Browser'
|
|
141 |
'Class Hierarchy Browser'
|
|
142 |
'Implementors'
|
|
143 |
'Senders'
|
0
|
144 |
'-'
|
8
|
145 |
'Changes Browser'
|
0
|
146 |
'-'
|
8
|
147 |
'Directory Browser'
|
3
|
148 |
))
|
0
|
149 |
selectors:#(
|
8
|
150 |
startSystemBrowser
|
|
151 |
startHierarchyBrowser
|
|
152 |
startImplementorsBrowser
|
|
153 |
startSendersBrowser
|
0
|
154 |
nil
|
8
|
155 |
startChangesBrowser
|
0
|
156 |
nil
|
8
|
157 |
startDirectoryBrowser
|
0
|
158 |
)
|
|
159 |
receiver:self
|
|
160 |
for:self
|
|
161 |
|
|
162 |
).
|
|
163 |
|
8
|
164 |
myMenu subMenuAt:#utilityMenu put:(
|
3
|
165 |
PopUpMenu labels:(resources array:#(
|
8
|
166 |
'Transcript'
|
|
167 |
'-'
|
|
168 |
'Window tree'
|
29
|
169 |
'View inspect'
|
|
170 |
'View destroy'
|
8
|
171 |
'Class tree'
|
|
172 |
'-'
|
|
173 |
'Event monitor'
|
|
174 |
'Process monitor'
|
|
175 |
'Memory monitor'
|
|
176 |
'Memory usage'
|
0
|
177 |
'-'
|
8
|
178 |
'collect Garbage'
|
|
179 |
'collect Garbage & compress'
|
17
|
180 |
'-'
|
|
181 |
'full screen hardcopy'
|
|
182 |
'screen area hardcopy'
|
|
183 |
'view hardcopy'
|
|
184 |
'-'
|
|
185 |
'ScreenSaver'
|
8
|
186 |
))
|
|
187 |
selectors:#(
|
|
188 |
startTranscript
|
|
189 |
nil
|
|
190 |
startWindowTreeView
|
29
|
191 |
viewInspector
|
|
192 |
viewKiller
|
8
|
193 |
startClassTreeView
|
|
194 |
nil
|
|
195 |
startEventMonitor
|
|
196 |
startProcessMonitor
|
|
197 |
startMemoryMonitor
|
|
198 |
startMemoryUsage
|
|
199 |
nil
|
|
200 |
garbageCollect
|
|
201 |
compressingGarbageCollect
|
17
|
202 |
nil
|
|
203 |
fullScreenHardcopy
|
|
204 |
screenHardcopy
|
|
205 |
viewHardcopy
|
|
206 |
nil
|
8
|
207 |
screenSaverMenu
|
|
208 |
)
|
|
209 |
receiver:self
|
|
210 |
for:self
|
|
211 |
).
|
|
212 |
|
|
213 |
(myMenu subMenuAt:#utilityMenu) subMenuAt:#screenSaverMenu put:(
|
|
214 |
PopUpMenu labels:(resources array:#(
|
|
215 |
'simple'
|
|
216 |
'spotlight'
|
|
217 |
'moving spotlight'
|
3
|
218 |
))
|
0
|
219 |
selectors:#(
|
8
|
220 |
startScreenSaver1
|
|
221 |
startScreenSaver2
|
|
222 |
startScreenSaver3
|
|
223 |
)
|
|
224 |
receiver:self
|
|
225 |
for:self
|
|
226 |
).
|
|
227 |
|
12
|
228 |
(Display isKindOf:GLXWorkstation) ifTrue:[
|
8
|
229 |
myMenu subMenuAt:#gamesMenu put:(
|
|
230 |
PopUpMenu labels:(resources array:#(
|
|
231 |
'Tetris'
|
|
232 |
'TicTacToe'
|
|
233 |
'-'
|
|
234 |
'Animation'
|
|
235 |
'Globe'
|
|
236 |
'-'
|
37
|
237 |
'GL 3D demos'
|
8
|
238 |
'-'
|
|
239 |
'LogicTool'
|
|
240 |
))
|
|
241 |
selectors:#(
|
|
242 |
startTetris
|
|
243 |
startTicTacToe
|
|
244 |
nil
|
|
245 |
startAnimation
|
|
246 |
startGlobeDemo
|
|
247 |
nil
|
37
|
248 |
glDemos
|
|
249 |
nil
|
|
250 |
startLogicTool
|
|
251 |
)
|
|
252 |
receiver:self
|
|
253 |
for:self
|
|
254 |
).
|
|
255 |
(myMenu subMenuAt:#gamesMenu) subMenuAt:#glDemos put:(
|
|
256 |
PopUpMenu labels:(resources array:#(
|
|
257 |
'plane'
|
|
258 |
'tetra'
|
|
259 |
'cube (wireframe)'
|
|
260 |
'cube (solid)'
|
|
261 |
'cube (light)'
|
|
262 |
'sphere (wireframe)'
|
|
263 |
'sphere (light)'
|
|
264 |
'planet'
|
|
265 |
'teapot'
|
|
266 |
'logo'
|
|
267 |
))
|
|
268 |
selectors:#(
|
8
|
269 |
startGLPlaneDemo
|
37
|
270 |
startGLTetraDemo
|
29
|
271 |
startGLWireCubeDemo
|
12
|
272 |
startGLCubeDemo
|
29
|
273 |
startGLCubeDemo2
|
37
|
274 |
startGLWireSphereDemo
|
8
|
275 |
startGLSphereDemo
|
37
|
276 |
startGLPlanetDemo
|
8
|
277 |
startGLTeapotDemo
|
17
|
278 |
startGLLogoDemo1
|
8
|
279 |
)
|
|
280 |
receiver:self
|
|
281 |
for:self
|
|
282 |
).
|
|
283 |
] ifFalse:[
|
|
284 |
myMenu subMenuAt:#gamesMenu put:(
|
|
285 |
PopUpMenu labels:(resources array:#(
|
|
286 |
'Tetris'
|
|
287 |
'TicTacToe'
|
|
288 |
'-'
|
|
289 |
'Animation'
|
|
290 |
'Globe'
|
|
291 |
'-'
|
|
292 |
'LogicTool'
|
|
293 |
))
|
|
294 |
selectors:#(
|
|
295 |
startTetris
|
|
296 |
startTicTacToe
|
|
297 |
nil
|
|
298 |
startAnimation
|
|
299 |
startGlobeDemo
|
|
300 |
nil
|
|
301 |
startLogicTool
|
|
302 |
)
|
|
303 |
receiver:self
|
|
304 |
for:self
|
|
305 |
)
|
|
306 |
].
|
|
307 |
|
39
|
308 |
Project notNil ifTrue:[
|
|
309 |
myMenu subMenuAt:#projectMenu put:(
|
|
310 |
PopUpMenu labels:(resources array:#(
|
|
311 |
'new project'
|
|
312 |
'-'
|
|
313 |
'select project'
|
|
314 |
))
|
|
315 |
selectors:#(
|
|
316 |
newProject
|
|
317 |
nil
|
|
318 |
selectProject
|
|
319 |
)
|
|
320 |
receiver:self
|
|
321 |
for:self
|
|
322 |
).
|
|
323 |
].
|
0
|
324 |
|
|
325 |
myMenu subMenuAt:#goodyMenu put:(
|
3
|
326 |
PopUpMenu labels:(resources array:#(
|
0
|
327 |
'Clock'
|
29
|
328 |
'Round Clock'
|
|
329 |
"
|
0
|
330 |
'Address Book'
|
29
|
331 |
"
|
0
|
332 |
'-'
|
|
333 |
'Directory View'
|
|
334 |
'MailTool'
|
|
335 |
'NewsTool'
|
|
336 |
'-'
|
|
337 |
'DrawTool'
|
3
|
338 |
))
|
0
|
339 |
selectors:#(
|
|
340 |
startClock
|
29
|
341 |
startRoundClock
|
|
342 |
"
|
0
|
343 |
startAddressBook
|
29
|
344 |
"
|
0
|
345 |
nil
|
|
346 |
startDirectoryView
|
|
347 |
startMailTool
|
|
348 |
startNewsTool
|
|
349 |
nil
|
|
350 |
startDrawTool
|
|
351 |
)
|
|
352 |
receiver:self
|
|
353 |
for:self
|
|
354 |
|
|
355 |
).
|
|
356 |
|
|
357 |
myMenu subMenuAt:#helpMenu put:(
|
3
|
358 |
PopUpMenu labels:(resources array:#(
|
29
|
359 |
'About'
|
|
360 |
'-'
|
0
|
361 |
'Overview'
|
|
362 |
'Getting started'
|
8
|
363 |
'Customizing'
|
17
|
364 |
'Tools'
|
29
|
365 |
'programming'
|
25
|
366 |
'other topics'
|
0
|
367 |
'-'
|
29
|
368 |
"
|
0
|
369 |
'Help Browser'
|
29
|
370 |
"
|
|
371 |
'Manual Browser'
|
3
|
372 |
))
|
0
|
373 |
selectors:#(
|
29
|
374 |
showAbout
|
|
375 |
nil
|
0
|
376 |
showOverview
|
|
377 |
showGettingStarted
|
8
|
378 |
showCustomizing
|
11
|
379 |
tools
|
29
|
380 |
programming
|
25
|
381 |
otherTopics
|
0
|
382 |
nil
|
29
|
383 |
"
|
0
|
384 |
startHelpView
|
29
|
385 |
"
|
|
386 |
startManualBrowser
|
0
|
387 |
)
|
|
388 |
receiver:self
|
|
389 |
for:self
|
|
390 |
|
|
391 |
).
|
|
392 |
|
11
|
393 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#tools put:(
|
|
394 |
PopUpMenu labels:(resources array:#(
|
|
395 |
'System Browser'
|
17
|
396 |
'File Browser'
|
|
397 |
'Changes Browser'
|
|
398 |
'Debugger'
|
29
|
399 |
'Inspector'
|
11
|
400 |
))
|
|
401 |
selectors:#(
|
|
402 |
showSystemBrowserDocumentation
|
17
|
403 |
showFileBrowserDocumentation
|
|
404 |
showChangesBrowserDocumentation
|
|
405 |
showDebuggerDocumentation
|
29
|
406 |
showInspectorDocumentation
|
11
|
407 |
)
|
|
408 |
receiver:self
|
|
409 |
for:self
|
|
410 |
|
|
411 |
).
|
|
412 |
|
25
|
413 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#otherTopics put:(
|
|
414 |
PopUpMenu labels:(resources array:#(
|
29
|
415 |
'ST/X history'
|
25
|
416 |
'Garbage collection'
|
|
417 |
'Language & primitives'
|
29
|
418 |
'Error messages'
|
25
|
419 |
'-'
|
|
420 |
'stc manual page'
|
|
421 |
'smalltalk manual page'
|
|
422 |
))
|
|
423 |
selectors:#(
|
29
|
424 |
showHistoryDocumentation
|
25
|
425 |
showGCDocumentation
|
|
426 |
showLanguageDocumentation
|
29
|
427 |
showErrorMessageDocumentation
|
|
428 |
nil
|
25
|
429 |
showSTCManualPage
|
|
430 |
showSmalltalkManualPage
|
|
431 |
)
|
|
432 |
receiver:self
|
|
433 |
for:self
|
|
434 |
|
|
435 |
).
|
|
436 |
|
29
|
437 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#programming put:(
|
|
438 |
PopUpMenu labels:(resources array:#(
|
|
439 |
'useful selectors'
|
|
440 |
'views - quick intro'
|
|
441 |
'breakpoints & tracing'
|
|
442 |
'processes'
|
|
443 |
'timers & delays'
|
37
|
444 |
'exceptions & signals'
|
|
445 |
'GL 3D graphics'
|
29
|
446 |
))
|
|
447 |
selectors:#(
|
|
448 |
showUsefulSelectors
|
|
449 |
showQuickViewIntro
|
|
450 |
showDebuggingInfo
|
|
451 |
showProcessInfo
|
|
452 |
showTimerInfo
|
37
|
453 |
showExceptionInfo
|
|
454 |
showGLDocumentation
|
29
|
455 |
)
|
|
456 |
receiver:self
|
|
457 |
for:self
|
3
|
458 |
|
29
|
459 |
).
|
0
|
460 |
!
|
|
461 |
|
|
462 |
realize
|
29
|
463 |
|myExtent|
|
|
464 |
|
|
465 |
myExtent := (myMenu extent + (0 @ (logoLabel height))).
|
|
466 |
self extent:myExtent.
|
|
467 |
self minExtent:myExtent.
|
|
468 |
self maxExtent:myExtent.
|
39
|
469 |
super realize.
|
|
470 |
|
|
471 |
"
|
|
472 |
catch errors - dont want a debugger here ...
|
|
473 |
"
|
|
474 |
Processor activeProcess emergencySignalHandler:[:ex |
|
|
475 |
|box|
|
|
476 |
|
|
477 |
box := YesNoBox title:('Error while launching ...\' , ex errorString , '\\debug ?') withCRs.
|
|
478 |
"
|
|
479 |
icon should be whatever WarnBoxes use as icon
|
|
480 |
"
|
|
481 |
box formLabel form:(WarningBox new formLabel label).
|
|
482 |
box yesAction:[Debugger
|
|
483 |
enter:ex suspendedContext
|
|
484 |
withMessage:ex errorString].
|
|
485 |
box showAtPointer.
|
|
486 |
Object abortSignal raise.
|
|
487 |
].
|
0
|
488 |
!
|
|
489 |
|
|
490 |
reinitialize
|
|
491 |
"sent after snapin - first reinit menuview,
|
|
492 |
then adjust my size"
|
|
493 |
|
|
494 |
super reinitialize.
|
|
495 |
myMenu reinitialize.
|
|
496 |
self extent:(myMenu extent).
|
|
497 |
!
|
|
498 |
|
3
|
499 |
destroy
|
|
500 |
exitBox notNil ifTrue:[
|
|
501 |
exitBox destroy.
|
|
502 |
exitBox := nil
|
|
503 |
].
|
|
504 |
saveBox notNil ifTrue:[
|
8
|
505 |
saveBox destroy.
|
3
|
506 |
saveBox := nil
|
|
507 |
].
|
8
|
508 |
enterBox notNil ifTrue:[
|
|
509 |
enterBox destroy.
|
|
510 |
enterBox := nil
|
|
511 |
].
|
21
|
512 |
(self confirm:(resources string:'close Launcher ?')) ifTrue:[
|
|
513 |
super destroy
|
|
514 |
]
|
3
|
515 |
!
|
|
516 |
|
0
|
517 |
addToCurrentProject
|
39
|
518 |
"ignored here - the launcher is always global."
|
0
|
519 |
|
|
520 |
^ self
|
|
521 |
! !
|
|
522 |
|
29
|
523 |
!Launcher methodsFor:'accessing'!
|
|
524 |
|
|
525 |
menu
|
|
526 |
^ myMenu
|
|
527 |
! !
|
|
528 |
|
8
|
529 |
!Launcher methodsFor:'private'!
|
|
530 |
|
|
531 |
showDocumentFile:name
|
|
532 |
|s f isRTF|
|
|
533 |
|
|
534 |
isRTF := true.
|
|
535 |
s := Smalltalk systemFileStreamFor:name , '.rtf'.
|
|
536 |
s isNil ifTrue:[
|
|
537 |
isRTF := false.
|
|
538 |
s := Smalltalk systemFileStreamFor:name , '.doc'.
|
|
539 |
s isNil ifTrue:[
|
29
|
540 |
self warn:('document ' , name , ' (.rtf/.doc) not available.\\check your installation.' withCRs).
|
8
|
541 |
^ nil
|
|
542 |
].
|
|
543 |
].
|
|
544 |
f := s pathName.
|
|
545 |
|
|
546 |
isRTF ifTrue:[
|
29
|
547 |
DocumentView openOn:f.
|
8
|
548 |
^ self
|
|
549 |
].
|
|
550 |
|
29
|
551 |
(Workspace openOn:f) readOnly
|
17
|
552 |
!
|
|
553 |
|
|
554 |
saveScreenImage:anImage
|
|
555 |
"save an image into a file
|
|
556 |
- ask user for filename using a fileSelectionBox."
|
|
557 |
|
|
558 |
|box|
|
|
559 |
|
|
560 |
box := FileSelectionBox
|
|
561 |
title:'save image in:'
|
|
562 |
okText:'save'
|
|
563 |
abortText:'cancel'
|
|
564 |
action:[:fileName | anImage saveOn:fileName].
|
|
565 |
box pattern:'*.tiff'.
|
|
566 |
box showAtPointer
|
25
|
567 |
!
|
|
568 |
|
|
569 |
closeDownViews
|
|
570 |
"tell each topview that we are going to terminate and give it chance
|
|
571 |
to save its contents."
|
|
572 |
|
27
|
573 |
ObjectMemory changed:#aboutToExit
|
8
|
574 |
! !
|
|
575 |
|
0
|
576 |
!Launcher methodsFor:'events'!
|
|
577 |
|
|
578 |
saveAndTerminate
|
|
579 |
ObjectMemory snapShotOn:name
|
|
580 |
! !
|
|
581 |
|
37
|
582 |
!Launcher methodsFor:'menu actions'!
|
17
|
583 |
|
8
|
584 |
startSystemBrowser
|
29
|
585 |
SystemBrowser open
|
0
|
586 |
!
|
|
587 |
|
8
|
588 |
startHierarchyBrowser
|
|
589 |
enterBox title:(resources at:'name of class:') withCRs.
|
|
590 |
enterBox okText:(resources at:'browse').
|
|
591 |
|
29
|
592 |
enterBox action:[:className |
|
8
|
593 |
|class|
|
|
594 |
|
29
|
595 |
class := Smalltalk at:className asSymbol ifAbsent:[nil].
|
8
|
596 |
class isBehavior ifFalse:[
|
|
597 |
self warn:(resources at:'no such class')
|
|
598 |
] ifTrue:[
|
|
599 |
SystemBrowser browseClassHierarchy:class
|
|
600 |
]
|
|
601 |
].
|
|
602 |
enterBox showAtPointer
|
|
603 |
!
|
|
604 |
|
|
605 |
startImplementorsBrowser
|
|
606 |
enterBox title:(resources at:'selector:') withCRs.
|
|
607 |
enterBox okText:(resources at:'browse').
|
|
608 |
|
|
609 |
enterBox action:[:selectorName |
|
|
610 |
SystemBrowser browseImplementorsOf:selectorName
|
|
611 |
].
|
|
612 |
enterBox showAtPointer
|
|
613 |
!
|
|
614 |
|
|
615 |
startSendersBrowser
|
|
616 |
enterBox title:(resources at:'selector:') withCRs.
|
|
617 |
enterBox okText:(resources at:'browse').
|
|
618 |
|
|
619 |
enterBox action:[:selectorName |
|
|
620 |
SystemBrowser browseAllCallsOn:selectorName
|
|
621 |
].
|
|
622 |
enterBox showAtPointer
|
0
|
623 |
!
|
|
624 |
|
|
625 |
startChangesBrowser
|
29
|
626 |
ChangesBrowser open
|
0
|
627 |
!
|
|
628 |
|
|
629 |
startFileBrowser
|
29
|
630 |
FileBrowser open
|
0
|
631 |
!
|
|
632 |
|
|
633 |
startDirectoryBrowser
|
29
|
634 |
DirectoryBrowser open
|
0
|
635 |
!
|
|
636 |
|
|
637 |
startDirectoryView
|
29
|
638 |
DirectoryView open
|
0
|
639 |
!
|
|
640 |
|
|
641 |
startWorkspace
|
29
|
642 |
Workspace open
|
0
|
643 |
!
|
|
644 |
|
37
|
645 |
saveImage
|
|
646 |
saveBox isNil ifTrue:[
|
|
647 |
saveBox := EnterBox new.
|
|
648 |
saveBox title:(resources at:'filename for image:') withCRs.
|
|
649 |
" saveBox abortText:(resources at:'abort')." "this is the default anyway ..."
|
|
650 |
saveBox okText:(resources at:'save')
|
|
651 |
].
|
|
652 |
|
|
653 |
"this is a kludge - put into above if-block once
|
|
654 |
stack contexts survive a snapout/snapin
|
|
655 |
(I think, it could be done now ...)
|
|
656 |
"
|
|
657 |
saveBox action:[:fileName |
|
|
658 |
ObjectMemory snapShotOn:fileName.
|
|
659 |
].
|
|
660 |
|
|
661 |
saveBox initialText:(ObjectMemory nameForSnapshot).
|
|
662 |
saveBox showAtPointer
|
|
663 |
!
|
|
664 |
|
|
665 |
exitSmalltalk
|
|
666 |
exitBox isNil ifTrue:[
|
|
667 |
exitBox := EnterBox2 new.
|
|
668 |
exitBox title:(resources at:'save state before exiting ?\\filename for image:') withCRs.
|
|
669 |
" exitBox abortText:(resources at:'abort')." "this is the default anyway ..."
|
|
670 |
exitBox okText:(resources at:'exit').
|
|
671 |
exitBox okText2:(resources at:'save & exit').
|
|
672 |
].
|
|
673 |
|
|
674 |
exitBox action:[:dummyName |
|
|
675 |
self closeDownViews.
|
|
676 |
Smalltalk exit
|
|
677 |
].
|
|
678 |
|
|
679 |
exitBox action2:[:fileName |
|
|
680 |
ObjectMemory snapShotOn:fileName.
|
|
681 |
|
|
682 |
"this is NOT required - all data should be in the snapshot ...
|
|
683 |
... however, if remote disks/mounatble filesystems are involved,
|
|
684 |
which may not be present the next time, it may make sense to
|
|
685 |
uncomment it and query for saving - time will show which is better.
|
|
686 |
"
|
|
687 |
"
|
|
688 |
self closeDownViews.
|
|
689 |
"
|
|
690 |
Smalltalk exit
|
|
691 |
].
|
|
692 |
|
|
693 |
exitBox initialText:(ObjectMemory nameForSnapshot).
|
|
694 |
exitBox showAtPointer
|
|
695 |
! !
|
|
696 |
|
|
697 |
!Launcher methodsFor:'utility menu actions'!
|
|
698 |
|
|
699 |
viewHardcopy
|
|
700 |
Processor addTimedBlock:[
|
|
701 |
|v|
|
|
702 |
|
|
703 |
v := Display viewFromUser.
|
|
704 |
v notNil ifTrue:[
|
|
705 |
self saveScreenImage:(Image fromView:(v topView))
|
|
706 |
]
|
|
707 |
] afterSeconds:1
|
|
708 |
!
|
|
709 |
|
|
710 |
fullScreenHardcopy
|
|
711 |
Processor addTimedBlock:[
|
|
712 |
self saveScreenImage:(Image fromScreen)
|
|
713 |
] afterSeconds:1
|
|
714 |
!
|
|
715 |
|
|
716 |
screenHardcopy
|
|
717 |
|area|
|
|
718 |
|
|
719 |
Processor addTimedBlock:[
|
|
720 |
area := Rectangle fromUser.
|
|
721 |
(area width > 0 and:[area height > 0]) ifTrue:[
|
|
722 |
self saveScreenImage:(Image fromScreen:area)
|
|
723 |
]
|
|
724 |
] afterSeconds:1
|
29
|
725 |
!
|
|
726 |
|
|
727 |
viewKiller
|
|
728 |
|v|
|
|
729 |
|
|
730 |
(Delay forSeconds:1) wait.
|
|
731 |
v := Display viewFromUser.
|
|
732 |
v isNil ifTrue:[
|
|
733 |
self warn:'sorry, this is not a smalltalk view'
|
|
734 |
] ifFalse:[
|
|
735 |
v topView destroy
|
|
736 |
]
|
|
737 |
!
|
|
738 |
|
|
739 |
viewInspector
|
|
740 |
|v|
|
|
741 |
|
|
742 |
(Delay forSeconds:1) wait.
|
|
743 |
v := Display viewFromUser.
|
|
744 |
v isNil ifTrue:[
|
|
745 |
self warn:'sorry, this is not a smalltalk view'
|
|
746 |
] ifFalse:[
|
|
747 |
v topView inspect
|
|
748 |
]
|
0
|
749 |
!
|
|
750 |
|
37
|
751 |
startWindowTreeView
|
|
752 |
WindowTreeView open
|
|
753 |
!
|
|
754 |
|
0
|
755 |
startClassTreeView
|
29
|
756 |
ClassTreeGraphView open
|
0
|
757 |
!
|
|
758 |
|
|
759 |
startEventMonitor
|
29
|
760 |
EventMonitor open
|
0
|
761 |
!
|
|
762 |
|
8
|
763 |
startProcessMonitor
|
29
|
764 |
ProcessMonitor open
|
0
|
765 |
!
|
|
766 |
|
|
767 |
startMemoryMonitor
|
29
|
768 |
MemoryMonitor open
|
8
|
769 |
!
|
|
770 |
|
|
771 |
startMemoryUsage
|
29
|
772 |
MemoryUsageView open
|
0
|
773 |
!
|
|
774 |
|
|
775 |
startTranscript
|
|
776 |
((Smalltalk at:#Transcript) isKindOf:TextCollector) ifTrue:[
|
29
|
777 |
"there is only one transcript"
|
|
778 |
Transcript topView isCollapsed ifTrue:[
|
|
779 |
"it is iconified"
|
|
780 |
Transcript topView unrealize.
|
|
781 |
Transcript topView realize.
|
|
782 |
].
|
|
783 |
Transcript topView raise
|
0
|
784 |
] ifFalse:[
|
|
785 |
Smalltalk at:#Transcript put:(TextCollector newTranscript)
|
|
786 |
]
|
|
787 |
!
|
|
788 |
|
8
|
789 |
startScreenSaver1
|
29
|
790 |
ScreenSaver open
|
8
|
791 |
!
|
|
792 |
|
|
793 |
startScreenSaver2
|
29
|
794 |
LightInTheDark open
|
8
|
795 |
!
|
|
796 |
|
|
797 |
startScreenSaver3
|
29
|
798 |
LightInTheDark2 open
|
8
|
799 |
!
|
|
800 |
|
37
|
801 |
garbageCollect
|
|
802 |
ObjectMemory markAndSweep
|
|
803 |
!
|
|
804 |
|
|
805 |
compressingGarbageCollect
|
|
806 |
|nBytesBefore nReclaimed|
|
|
807 |
|
|
808 |
nBytesBefore := ObjectMemory oldSpaceUsed.
|
|
809 |
ObjectMemory garbageCollect.
|
|
810 |
nReclaimed := nBytesBefore - ObjectMemory oldSpaceUsed.
|
|
811 |
nReclaimed > 0 ifTrue:[
|
|
812 |
Transcript show:'reclaimed '.
|
|
813 |
nReclaimed > 1024 ifTrue:[
|
|
814 |
nReclaimed > (1024 * 1024) ifTrue:[
|
|
815 |
Transcript show:(nReclaimed // (1024 * 1024)) printString.
|
|
816 |
Transcript showCr:' Mb.'
|
|
817 |
] ifFalse:[
|
|
818 |
Transcript show:(nReclaimed // 1024) printString.
|
|
819 |
Transcript showCr:' Kb.'
|
|
820 |
]
|
|
821 |
] ifFalse:[
|
|
822 |
Transcript show:nReclaimed printString.
|
|
823 |
Transcript showCr:' bytes.'
|
|
824 |
]
|
|
825 |
]
|
|
826 |
! !
|
|
827 |
|
|
828 |
!Launcher methodsFor:'project menu actions'!
|
|
829 |
|
39
|
830 |
projectMenu
|
|
831 |
"this is sent, if ST/X has been built without Projects/ChangeSets."
|
|
832 |
|
|
833 |
self warn:'The system has been built without support for Project'.
|
|
834 |
!
|
|
835 |
|
0
|
836 |
newProject
|
8
|
837 |
(ProjectView for:(Project new)) open
|
|
838 |
!
|
|
839 |
|
|
840 |
selectProject
|
|
841 |
|list box|
|
|
842 |
|
|
843 |
list := Project allInstances.
|
|
844 |
box := ListSelectionBox new.
|
|
845 |
box list:(list collect:[:p | p name]).
|
|
846 |
box title:(resources string:'select a project').
|
|
847 |
box action:[:selection |
|
|
848 |
|project|
|
|
849 |
|
|
850 |
project := list detect:[:p | p name = selection] ifNone:[nil].
|
|
851 |
project isNil ifTrue:[
|
|
852 |
Transcript showCr:'no such project'
|
|
853 |
] ifFalse:[
|
|
854 |
project showViews.
|
|
855 |
Project current:project
|
|
856 |
]
|
|
857 |
].
|
|
858 |
box showAtPointer
|
37
|
859 |
! !
|
|
860 |
|
|
861 |
!Launcher methodsFor:'goody menu actions'!
|
0
|
862 |
|
|
863 |
startXterm
|
|
864 |
OperatingSystem executeCommand:'xterm &'
|
|
865 |
!
|
|
866 |
|
|
867 |
startAddressBook
|
29
|
868 |
AddressBook open
|
0
|
869 |
!
|
|
870 |
|
|
871 |
startNewsTool
|
29
|
872 |
NewsView open
|
0
|
873 |
!
|
|
874 |
|
|
875 |
startMailTool
|
29
|
876 |
MailView open
|
0
|
877 |
!
|
|
878 |
|
|
879 |
startClock
|
29
|
880 |
Clock open
|
0
|
881 |
!
|
|
882 |
|
|
883 |
startRoundClock
|
29
|
884 |
RoundClock2 open
|
37
|
885 |
! !
|
|
886 |
|
|
887 |
!Launcher methodsFor:'demo menu actions'!
|
0
|
888 |
|
|
889 |
startAnimation
|
29
|
890 |
Animation open
|
0
|
891 |
!
|
|
892 |
|
|
893 |
startGlobeDemo
|
29
|
894 |
GlobeDemo open
|
0
|
895 |
!
|
|
896 |
|
|
897 |
startRoundGlobeDemo
|
29
|
898 |
RoundGlobeDemo open
|
0
|
899 |
!
|
|
900 |
|
8
|
901 |
startGLSphereDemo
|
29
|
902 |
GLSphereDemoView2 open
|
8
|
903 |
!
|
|
904 |
|
|
905 |
startGLTeapotDemo
|
29
|
906 |
GLTeapotDemo open
|
8
|
907 |
!
|
|
908 |
|
|
909 |
startGLPlaneDemo
|
29
|
910 |
GLPlaneDemoView2 open
|
|
911 |
!
|
|
912 |
|
|
913 |
startGLWireCubeDemo
|
|
914 |
GLWireCubeDemoView open
|
8
|
915 |
!
|
|
916 |
|
37
|
917 |
startGLWireSphereDemo
|
|
918 |
GLWireSphereDemoView open
|
|
919 |
!
|
|
920 |
|
|
921 |
startGLPlanetDemo
|
|
922 |
GLPlanetDemoView open
|
|
923 |
!
|
|
924 |
|
12
|
925 |
startGLCubeDemo
|
29
|
926 |
GLCubeDemoView open
|
|
927 |
!
|
|
928 |
|
|
929 |
startGLCubeDemo2
|
|
930 |
GLCubeDemoView2 open
|
12
|
931 |
!
|
|
932 |
|
|
933 |
startGLTetraDemo
|
29
|
934 |
GLTetraDemoView open
|
12
|
935 |
!
|
|
936 |
|
17
|
937 |
startGLLogoDemo1
|
29
|
938 |
Logo3DView1 open
|
17
|
939 |
!
|
|
940 |
|
0
|
941 |
startTetris
|
29
|
942 |
Tetris open
|
0
|
943 |
!
|
|
944 |
|
|
945 |
startTicTacToe
|
29
|
946 |
TicTacToe open
|
0
|
947 |
!
|
|
948 |
|
|
949 |
startDrawTool
|
29
|
950 |
DrawTool open
|
0
|
951 |
!
|
|
952 |
|
|
953 |
startLogicTool
|
29
|
954 |
LogicTool open
|
37
|
955 |
! !
|
0
|
956 |
|
37
|
957 |
!Launcher methodsFor:'doc menu actions'!
|
0
|
958 |
|
3
|
959 |
warnIfAbsent:aPath
|
|
960 |
|s|
|
0
|
961 |
|
3
|
962 |
s := Smalltalk systemFileStreamFor:aPath.
|
|
963 |
s isNil ifTrue:[
|
|
964 |
self warn:('document ' , aPath , ' not available').
|
|
965 |
^ nil
|
|
966 |
].
|
|
967 |
^ s pathName
|
|
968 |
!
|
|
969 |
|
29
|
970 |
showAbout
|
|
971 |
|box dark green|
|
|
972 |
|
|
973 |
device hasColors ifTrue:[
|
|
974 |
green := (Color red:0 green:80 blue:20) darkened.
|
|
975 |
] ifFalse:[
|
|
976 |
green := White.
|
|
977 |
].
|
|
978 |
device hasGreyscales ifTrue:[
|
|
979 |
dark := Color grey:10.
|
|
980 |
] ifFalse:[
|
|
981 |
dark := Black.
|
|
982 |
].
|
|
983 |
|
|
984 |
box := InfoBox new.
|
|
985 |
box viewBackground:dark.
|
|
986 |
box form:(Form
|
|
987 |
fromFile:'SmalltalkX.xbm'
|
|
988 |
resolution:100).
|
|
989 |
box formLabel viewBackground:dark.
|
|
990 |
box formLabel foregroundColor:green backgroundColor:dark.
|
|
991 |
box textLabel viewBackground:dark.
|
|
992 |
box textLabel foregroundColor:White backgroundColor:dark.
|
|
993 |
box title:
|
|
994 |
'Smalltalk/X
|
|
995 |
|
|
996 |
Version ......... ' , Smalltalk versionString , ' (' , Smalltalk versionDate printString , ')
|
|
997 |
Configuration ... ' , Smalltalk configuration , '
|
|
998 |
Running on ...... ' , OperatingSystem getHostName , '
|
|
999 |
|
|
1000 |
' , Smalltalk copyrightString.
|
|
1001 |
|
|
1002 |
box okText:'close'.
|
|
1003 |
box autoHideAfter:10 with:[].
|
|
1004 |
box showAt:device center - (box extent // 2).
|
|
1005 |
!
|
|
1006 |
|
3
|
1007 |
showOverview
|
8
|
1008 |
self showDocumentFile:'doc/overview'
|
|
1009 |
!
|
3
|
1010 |
|
8
|
1011 |
showCustomizing
|
|
1012 |
self showDocumentFile:'doc/manuals/customizing'
|
0
|
1013 |
!
|
|
1014 |
|
|
1015 |
showGettingStarted
|
8
|
1016 |
self showDocumentFile:'doc/manuals/gettingStarted'
|
0
|
1017 |
!
|
|
1018 |
|
11
|
1019 |
showSystemBrowserDocumentation
|
17
|
1020 |
self showDocumentFile:'doc/misc/sbrowser'
|
|
1021 |
!
|
|
1022 |
|
|
1023 |
showFileBrowserDocumentation
|
|
1024 |
self showDocumentFile:'doc/misc/fbrowser'
|
|
1025 |
!
|
|
1026 |
|
|
1027 |
showChangesBrowserDocumentation
|
|
1028 |
self showDocumentFile:'doc/misc/cbrowser'
|
|
1029 |
!
|
|
1030 |
|
|
1031 |
showDebuggerDocumentation
|
|
1032 |
self showDocumentFile:'doc/misc/debugger'
|
11
|
1033 |
!
|
|
1034 |
|
29
|
1035 |
showInspectorDocumentation
|
|
1036 |
self showDocumentFile:'doc/misc/inspector'
|
|
1037 |
!
|
|
1038 |
|
|
1039 |
showHistoryDocumentation
|
|
1040 |
self showDocumentFile:'doc/misc/history'
|
|
1041 |
!
|
|
1042 |
|
25
|
1043 |
showGCDocumentation
|
|
1044 |
self showDocumentFile:'doc/misc/GC'
|
|
1045 |
!
|
|
1046 |
|
37
|
1047 |
showGLDocumentation
|
|
1048 |
self showDocumentFile:'doc/misc/GL'
|
|
1049 |
!
|
|
1050 |
|
25
|
1051 |
showLanguageDocumentation
|
|
1052 |
self showDocumentFile:'doc/misc/language'
|
|
1053 |
!
|
|
1054 |
|
29
|
1055 |
showErrorMessageDocumentation
|
|
1056 |
self showDocumentFile:'doc/misc/errormsg'
|
|
1057 |
!
|
|
1058 |
|
25
|
1059 |
showSTCManualPage
|
|
1060 |
self showDocumentFile:'doc/misc/stc'
|
|
1061 |
!
|
|
1062 |
|
|
1063 |
showSmalltalkManualPage
|
|
1064 |
self showDocumentFile:'doc/misc/smalltalk'
|
|
1065 |
!
|
|
1066 |
|
29
|
1067 |
showUsefulSelectors
|
|
1068 |
self showDocumentFile:'doc/misc/beginner'
|
|
1069 |
!
|
|
1070 |
|
|
1071 |
showQuickViewIntro
|
|
1072 |
self showDocumentFile:'doc/misc/quick_view_intro'
|
|
1073 |
!
|
|
1074 |
|
|
1075 |
showDebuggingInfo
|
|
1076 |
self showDocumentFile:'doc/misc/debugging'
|
|
1077 |
!
|
|
1078 |
|
|
1079 |
showProcessInfo
|
|
1080 |
self showDocumentFile:'doc/misc/processes'
|
|
1081 |
!
|
|
1082 |
|
37
|
1083 |
showExceptionInfo
|
|
1084 |
self showDocumentFile:'doc/misc/exceptions'
|
|
1085 |
!
|
|
1086 |
|
29
|
1087 |
showTimerInfo
|
|
1088 |
self showDocumentFile:'doc/misc/timing'
|
|
1089 |
!
|
|
1090 |
|
0
|
1091 |
startHelpView
|
|
1092 |
self warn:'The HelpSystem is still under construction.
|
|
1093 |
|
|
1094 |
You will see a pre-pre release.'.
|
|
1095 |
HelpView start
|
|
1096 |
!
|
|
1097 |
|
29
|
1098 |
startManualBrowser
|
|
1099 |
ManualBrowser isLoaded ifFalse:[
|
|
1100 |
ManualBrowser autoload.
|
|
1101 |
"
|
|
1102 |
did it load ?
|
|
1103 |
"
|
|
1104 |
ManualBrowser isLoaded ifFalse:[
|
|
1105 |
self warn:'The ManualBrowser is a Tomcat add-on; not included in this package.'.
|
|
1106 |
^self
|
|
1107 |
]
|
|
1108 |
].
|
|
1109 |
self warn:'The HelpSystem is still under construction.
|
|
1110 |
|
|
1111 |
You will see a pre release.'.
|
|
1112 |
ManualBrowser new
|
0
|
1113 |
! !
|