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