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 |
|
82
|
24 |
$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.24 1995-03-20 05:43:11 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 |
"
|
82
|
45 |
$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.24 1995-03-20 05:43:11 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 |
))
|
82
|
275 |
selector:#openDemo:
|
|
276 |
args:#(
|
|
277 |
GLPlaneDemoView2
|
|
278 |
GLTetraDemoView
|
|
279 |
GLWireCubeDemoView
|
|
280 |
GLCubeDemoView
|
|
281 |
GLCubeDemoView2
|
|
282 |
GLBrickCubeDemoView
|
|
283 |
GLWireSphereDemoView
|
|
284 |
GLSphereDemoView2
|
|
285 |
GLPlanetDemoView
|
|
286 |
GLTeapotDemo
|
|
287 |
Logo3DView1
|
45
|
288 |
)
|
|
289 |
receiver:self
|
|
290 |
for:self
|
|
291 |
).
|
8
|
292 |
] ifFalse:[
|
45
|
293 |
myMenu subMenuAt:#gamesMenu put:(
|
|
294 |
PopUpMenu labels:(resources array:#(
|
|
295 |
'Tetris'
|
|
296 |
'TicTacToe'
|
|
297 |
'-'
|
53
|
298 |
'PenDemo'
|
|
299 |
'CommanderDemo'
|
|
300 |
'-'
|
45
|
301 |
'Animation'
|
|
302 |
'Globe'
|
|
303 |
'-'
|
|
304 |
'LogicTool'
|
|
305 |
))
|
82
|
306 |
selector:#openDemo:
|
|
307 |
args:#(
|
|
308 |
Tetris
|
|
309 |
TicTacToe
|
45
|
310 |
nil
|
82
|
311 |
PenDemo
|
|
312 |
CommanderDemo
|
53
|
313 |
nil
|
82
|
314 |
Animation
|
|
315 |
GlobeDemo
|
45
|
316 |
nil
|
82
|
317 |
LogicTool
|
45
|
318 |
)
|
|
319 |
receiver:self
|
|
320 |
for:self
|
|
321 |
)
|
8
|
322 |
].
|
|
323 |
|
39
|
324 |
Project notNil ifTrue:[
|
45
|
325 |
myMenu subMenuAt:#projectMenu put:(
|
|
326 |
PopUpMenu labels:(resources array:#(
|
|
327 |
'new project'
|
|
328 |
'-'
|
|
329 |
'select project'
|
|
330 |
))
|
|
331 |
selectors:#(
|
|
332 |
newProject
|
|
333 |
nil
|
|
334 |
selectProject
|
|
335 |
)
|
|
336 |
receiver:self
|
|
337 |
for:self
|
|
338 |
).
|
39
|
339 |
].
|
0
|
340 |
|
|
341 |
myMenu subMenuAt:#goodyMenu put:(
|
45
|
342 |
PopUpMenu labels:(resources array:#(
|
|
343 |
'Clock'
|
|
344 |
'Round Clock'
|
29
|
345 |
"
|
45
|
346 |
'Address Book'
|
29
|
347 |
"
|
45
|
348 |
'-'
|
75
|
349 |
'Calendar'
|
45
|
350 |
'Directory View'
|
|
351 |
'MailTool'
|
|
352 |
'NewsTool'
|
|
353 |
'-'
|
|
354 |
'DrawTool'
|
|
355 |
))
|
|
356 |
selectors:#(
|
|
357 |
startClock
|
|
358 |
startRoundClock
|
29
|
359 |
"
|
45
|
360 |
startAddressBook
|
29
|
361 |
"
|
45
|
362 |
nil
|
53
|
363 |
startCalendar
|
45
|
364 |
startDirectoryView
|
|
365 |
startMailTool
|
|
366 |
startNewsTool
|
|
367 |
nil
|
|
368 |
startDrawTool
|
|
369 |
)
|
|
370 |
receiver:self
|
|
371 |
for:self
|
0
|
372 |
|
|
373 |
).
|
|
374 |
|
|
375 |
myMenu subMenuAt:#helpMenu put:(
|
45
|
376 |
PopUpMenu labels:(resources array:#(
|
|
377 |
'About'
|
|
378 |
'-'
|
|
379 |
'Overview'
|
|
380 |
'Getting started'
|
|
381 |
'Customizing'
|
|
382 |
'Tools'
|
|
383 |
'programming'
|
|
384 |
'other topics'
|
|
385 |
'-'
|
|
386 |
'Help Browser'
|
|
387 |
))
|
|
388 |
selectors:#(
|
|
389 |
showAbout
|
|
390 |
nil
|
|
391 |
showOverview
|
|
392 |
showGettingStarted
|
|
393 |
showCustomizing
|
|
394 |
tools
|
|
395 |
programming
|
|
396 |
otherTopics
|
|
397 |
nil
|
82
|
398 |
startOnlineHelpView
|
45
|
399 |
)
|
|
400 |
receiver:self
|
|
401 |
for:self
|
0
|
402 |
|
|
403 |
).
|
|
404 |
|
11
|
405 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#tools put:(
|
45
|
406 |
PopUpMenu labels:(resources array:#(
|
|
407 |
'System Browser'
|
|
408 |
'File Browser'
|
|
409 |
'Changes Browser'
|
|
410 |
'Debugger'
|
|
411 |
'Inspector'
|
|
412 |
))
|
82
|
413 |
selector:#showOnlineHelp:
|
|
414 |
args:#('tools/sbrowser/TOP'
|
|
415 |
'tools/fbrowser/TOP'
|
|
416 |
'tools/cbrowser/TOP'
|
|
417 |
'tools/debugger/TOP'
|
|
418 |
'tools/inspector/misc/TOP')
|
45
|
419 |
receiver:self
|
|
420 |
for:self
|
11
|
421 |
|
|
422 |
).
|
|
423 |
|
25
|
424 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#otherTopics put:(
|
45
|
425 |
PopUpMenu labels:(resources array:#(
|
|
426 |
'ST/X history'
|
|
427 |
'Garbage collection'
|
|
428 |
'Language & primitives'
|
|
429 |
'Error messages'
|
|
430 |
'-'
|
|
431 |
'stc manual page'
|
|
432 |
'smalltalk manual page'
|
|
433 |
))
|
82
|
434 |
selector:#showOnlineHelp:
|
|
435 |
args:#('misc/history'
|
|
436 |
'programming/GC'
|
|
437 |
'programming/language'
|
|
438 |
'programming/errormsg'
|
45
|
439 |
nil
|
82
|
440 |
'misc/stc'
|
|
441 |
'misc/smalltalk')
|
45
|
442 |
receiver:self
|
|
443 |
for:self
|
25
|
444 |
|
|
445 |
).
|
|
446 |
|
29
|
447 |
(myMenu subMenuAt:#helpMenu) subMenuAt:#programming put:(
|
45
|
448 |
PopUpMenu labels:(resources array:#(
|
|
449 |
'useful selectors'
|
|
450 |
'views - quick intro'
|
|
451 |
'breakpoints & tracing'
|
|
452 |
'processes'
|
|
453 |
'timers & delays'
|
|
454 |
'exceptions & signals'
|
|
455 |
'GL 3D graphics'
|
|
456 |
))
|
82
|
457 |
selector:#showOnlineHelp:
|
|
458 |
args:#('programming/selectors'
|
|
459 |
'misc/quick_view_intro'
|
|
460 |
'programming/debugging'
|
|
461 |
'programming/processes'
|
|
462 |
'programming/timing'
|
|
463 |
'programming/exceptions'
|
|
464 |
'misc/GL')
|
45
|
465 |
receiver:self
|
|
466 |
for:self
|
3
|
467 |
|
29
|
468 |
).
|
0
|
469 |
!
|
|
470 |
|
|
471 |
realize
|
29
|
472 |
|myExtent|
|
|
473 |
|
|
474 |
myExtent := (myMenu extent + (0 @ (logoLabel height))).
|
|
475 |
self extent:myExtent.
|
|
476 |
self minExtent:myExtent.
|
|
477 |
self maxExtent:myExtent.
|
39
|
478 |
super realize.
|
|
479 |
|
|
480 |
"
|
|
481 |
catch errors - dont want a debugger here ...
|
57
|
482 |
(this must be done here, since #initialize runs under another process)
|
39
|
483 |
"
|
|
484 |
Processor activeProcess emergencySignalHandler:[:ex |
|
45
|
485 |
|box|
|
39
|
486 |
|
57
|
487 |
"/ old:
|
|
488 |
"/ box := YesNoBox title:('Error while launching ...\' , ex errorString , '\\debug ?') withCRs.
|
|
489 |
"/ "
|
|
490 |
"/ icon should be whatever WarnBoxes use as icon
|
|
491 |
"/ "
|
|
492 |
"/ box formLabel form:(WarningBox new formLabel label).
|
|
493 |
"/ box yesAction:[Debugger
|
|
494 |
"/ enter:ex suspendedContext
|
|
495 |
"/ withMessage:ex errorString].
|
|
496 |
|
|
497 |
"/ new:
|
|
498 |
box := OptionBox
|
|
499 |
title:('Error while launching ...\' , ex errorString , '\\') withCRs
|
|
500 |
numberOfOptions:3.
|
|
501 |
box label:'Warning'.
|
45
|
502 |
"
|
|
503 |
icon should be whatever WarnBoxes use as icon
|
|
504 |
"
|
57
|
505 |
box form:(WarningBox new formLabel label).
|
|
506 |
box buttonTitles:(resources array:#('abort' 'continue' 'debug')).
|
|
507 |
box actions:(Array with:[AbortSignal raise]
|
|
508 |
with:[ex resume]
|
|
509 |
with:[Debugger
|
|
510 |
enter:ex suspendedContext
|
|
511 |
withMessage:ex errorString.
|
|
512 |
ex resume.]
|
|
513 |
).
|
|
514 |
|
45
|
515 |
box showAtPointer.
|
57
|
516 |
AbortSignal raise.
|
39
|
517 |
].
|
0
|
518 |
!
|
|
519 |
|
|
520 |
reinitialize
|
|
521 |
"sent after snapin - first reinit menuview,
|
|
522 |
then adjust my size"
|
|
523 |
|
|
524 |
super reinitialize.
|
57
|
525 |
"/ myMenu reinitialize.
|
|
526 |
"/ self extent:(myMenu extent).
|
0
|
527 |
!
|
|
528 |
|
3
|
529 |
destroy
|
45
|
530 |
"re-confirm when closing Launcher - we do this,
|
|
531 |
since if you close the last launcher, you might loose the possibility to
|
43
|
532 |
communicate with the system ..."
|
|
533 |
|
52
|
534 |
(self confirm:(resources string:'close ' , self class name , ' ?')) ifTrue:[
|
45
|
535 |
super destroy
|
21
|
536 |
]
|
3
|
537 |
!
|
|
538 |
|
0
|
539 |
addToCurrentProject
|
39
|
540 |
"ignored here - the launcher is always global."
|
0
|
541 |
|
|
542 |
^ self
|
|
543 |
! !
|
|
544 |
|
29
|
545 |
!Launcher methodsFor:'accessing'!
|
|
546 |
|
|
547 |
menu
|
|
548 |
^ myMenu
|
|
549 |
! !
|
|
550 |
|
8
|
551 |
!Launcher methodsFor:'private'!
|
|
552 |
|
|
553 |
showDocumentFile:name
|
|
554 |
|s f isRTF|
|
|
555 |
|
|
556 |
isRTF := true.
|
|
557 |
s := Smalltalk systemFileStreamFor:name , '.rtf'.
|
|
558 |
s isNil ifTrue:[
|
45
|
559 |
isRTF := false.
|
|
560 |
s := Smalltalk systemFileStreamFor:name , '.doc'.
|
|
561 |
s isNil ifTrue:[
|
|
562 |
self warn:('document ' , name , ' (.rtf/.doc) not available.\\check your installation.' withCRs).
|
|
563 |
^ nil
|
|
564 |
].
|
8
|
565 |
].
|
|
566 |
f := s pathName.
|
|
567 |
|
|
568 |
isRTF ifTrue:[
|
45
|
569 |
DocumentView openOn:f.
|
|
570 |
^ self
|
8
|
571 |
].
|
|
572 |
|
29
|
573 |
(Workspace openOn:f) readOnly
|
17
|
574 |
!
|
|
575 |
|
|
576 |
saveScreenImage:anImage
|
|
577 |
"save an image into a file
|
|
578 |
- ask user for filename using a fileSelectionBox."
|
|
579 |
|
73
|
580 |
|fileName|
|
17
|
581 |
|
77
|
582 |
fileName := Dialog
|
73
|
583 |
requestFileName:'save image in:'
|
|
584 |
default:''
|
|
585 |
ok:'save'
|
|
586 |
abort:'abort'
|
|
587 |
pattern:'*.tiff'.
|
|
588 |
|
|
589 |
fileName notNil ifTrue:[
|
|
590 |
anImage saveOn:fileName
|
|
591 |
].
|
25
|
592 |
!
|
|
593 |
|
|
594 |
closeDownViews
|
|
595 |
"tell each topview that we are going to terminate and give it chance
|
|
596 |
to save its contents."
|
|
597 |
|
27
|
598 |
ObjectMemory changed:#aboutToExit
|
8
|
599 |
! !
|
|
600 |
|
56
|
601 |
!Launcher methodsFor:'event handling'!
|
0
|
602 |
|
|
603 |
saveAndTerminate
|
52
|
604 |
"
|
|
605 |
some windowManagers can send this, to shutDown an application
|
|
606 |
but let it save its state before, for restart. We are already
|
|
607 |
prepared for this ;-)"
|
|
608 |
|
0
|
609 |
ObjectMemory snapShotOn:name
|
|
610 |
! !
|
|
611 |
|
37
|
612 |
!Launcher methodsFor:'menu actions'!
|
17
|
613 |
|
8
|
614 |
startSystemBrowser
|
29
|
615 |
SystemBrowser open
|
0
|
616 |
!
|
|
617 |
|
8
|
618 |
startHierarchyBrowser
|
43
|
619 |
|enterBox|
|
|
620 |
|
57
|
621 |
enterBox := EnterBox title:(resources at:'name of class:') withCRs.
|
43
|
622 |
" enterBox abortText:(resources at:'abort')." "this is the default anyway"
|
8
|
623 |
enterBox okText:(resources at:'browse').
|
|
624 |
|
29
|
625 |
enterBox action:[:className |
|
45
|
626 |
|class|
|
8
|
627 |
|
45
|
628 |
class := Smalltalk at:className asSymbol ifAbsent:[nil].
|
|
629 |
class isBehavior ifFalse:[
|
|
630 |
self warn:'no such class'
|
|
631 |
] ifTrue:[
|
|
632 |
SystemBrowser browseClassHierarchy:class
|
|
633 |
]
|
8
|
634 |
].
|
|
635 |
enterBox showAtPointer
|
|
636 |
!
|
|
637 |
|
|
638 |
startImplementorsBrowser
|
43
|
639 |
|enterBox|
|
|
640 |
|
57
|
641 |
enterBox := EnterBox title:(resources at:'selector:') withCRs.
|
43
|
642 |
" enterBox abortText:(resources at:'abort')." "this is the default anyway"
|
8
|
643 |
enterBox okText:(resources at:'browse').
|
|
644 |
|
|
645 |
enterBox action:[:selectorName |
|
45
|
646 |
SystemBrowser browseImplementorsOf:selectorName
|
8
|
647 |
].
|
|
648 |
enterBox showAtPointer
|
|
649 |
!
|
|
650 |
|
|
651 |
startSendersBrowser
|
43
|
652 |
|enterBox|
|
|
653 |
|
57
|
654 |
enterBox := EnterBox title:(resources at:'selector:') withCRs.
|
43
|
655 |
" enterBox abortText:(resources at:'abort')." "this is the default anyway"
|
8
|
656 |
enterBox okText:(resources at:'browse').
|
|
657 |
|
|
658 |
enterBox action:[:selectorName |
|
45
|
659 |
SystemBrowser browseAllCallsOn:selectorName
|
8
|
660 |
].
|
|
661 |
enterBox showAtPointer
|
0
|
662 |
!
|
|
663 |
|
|
664 |
startChangesBrowser
|
29
|
665 |
ChangesBrowser open
|
0
|
666 |
!
|
|
667 |
|
|
668 |
startFileBrowser
|
29
|
669 |
FileBrowser open
|
0
|
670 |
!
|
|
671 |
|
|
672 |
startDirectoryBrowser
|
29
|
673 |
DirectoryBrowser open
|
0
|
674 |
!
|
|
675 |
|
|
676 |
startDirectoryView
|
29
|
677 |
DirectoryView open
|
0
|
678 |
!
|
|
679 |
|
|
680 |
startWorkspace
|
29
|
681 |
Workspace open
|
0
|
682 |
!
|
|
683 |
|
37
|
684 |
saveImage
|
43
|
685 |
|saveBox|
|
|
686 |
|
57
|
687 |
saveBox := EnterBox title:(resources at:'filename for image:') withCRs.
|
43
|
688 |
saveBox okText:(resources at:'save').
|
37
|
689 |
saveBox action:[:fileName |
|
45
|
690 |
(ObjectMemory snapShotOn:fileName) ifFalse:[
|
|
691 |
"
|
|
692 |
snapshot failed for some reason (disk full, no permission etc.)
|
|
693 |
Do NOT exit in this case.
|
|
694 |
"
|
57
|
695 |
self warn:(resources string:'failed to save snapshot image (disk full or not writable)').
|
45
|
696 |
]
|
37
|
697 |
].
|
|
698 |
|
|
699 |
saveBox initialText:(ObjectMemory nameForSnapshot).
|
57
|
700 |
saveBox label:'save image'.
|
37
|
701 |
saveBox showAtPointer
|
|
702 |
!
|
|
703 |
|
|
704 |
exitSmalltalk
|
43
|
705 |
|exitBox|
|
|
706 |
|
57
|
707 |
exitBox := EnterBox2 title:(resources at:'save state before exiting ?\\filename for image:') withCRs.
|
43
|
708 |
exitBox okText:(resources at:'exit').
|
|
709 |
exitBox okText2:(resources at:'save & exit').
|
57
|
710 |
exitBox label:'exit Smalltalk'.
|
37
|
711 |
|
|
712 |
exitBox action:[:dummyName |
|
45
|
713 |
self closeDownViews.
|
|
714 |
Smalltalk exit
|
37
|
715 |
].
|
|
716 |
|
|
717 |
exitBox action2:[:fileName |
|
45
|
718 |
(ObjectMemory snapShotOn:fileName) ifFalse:[
|
|
719 |
"
|
|
720 |
snapshot failed for some reason (disk full, no permission etc.)
|
|
721 |
Do NOT exit in this case.
|
|
722 |
"
|
57
|
723 |
self warn:(resources string:'failed to save snapshot image (disk full or not writable)').
|
45
|
724 |
] ifTrue:[
|
|
725 |
"
|
|
726 |
closeDownViews tells all views to shutdown neatly
|
|
727 |
(i.e. offer a chance to save the contents to a file).
|
37
|
728 |
|
45
|
729 |
This is NOT required - all data should be in the snapshot ...
|
|
730 |
... however, if remote disks/mountable filesystems are involved,
|
|
731 |
which may not be present the next time, it may make sense to
|
|
732 |
uncomment it and query for saving - time will show which is better.
|
|
733 |
"
|
37
|
734 |
"
|
45
|
735 |
self closeDownViews.
|
37
|
736 |
"
|
45
|
737 |
Smalltalk exit
|
|
738 |
]
|
37
|
739 |
].
|
|
740 |
|
|
741 |
exitBox initialText:(ObjectMemory nameForSnapshot).
|
|
742 |
exitBox showAtPointer
|
|
743 |
! !
|
|
744 |
|
|
745 |
!Launcher methodsFor:'utility menu actions'!
|
|
746 |
|
|
747 |
viewHardcopy
|
45
|
748 |
"after a second (to allow redraw of views under menu ...),
|
|
749 |
let user specify a view and save its contents."
|
37
|
750 |
|
45
|
751 |
Processor addTimedBlock:[
|
|
752 |
|v|
|
|
753 |
|
|
754 |
v := Display viewFromUser.
|
|
755 |
v notNil ifTrue:[
|
|
756 |
self saveScreenImage:(Image fromView:(v topView))
|
|
757 |
]
|
37
|
758 |
] afterSeconds:1
|
|
759 |
!
|
|
760 |
|
|
761 |
fullScreenHardcopy
|
45
|
762 |
"after a second (to allow redraw of views under menu ...),
|
|
763 |
save the contents of the whole screen."
|
|
764 |
|
37
|
765 |
Processor addTimedBlock:[
|
45
|
766 |
self saveScreenImage:(Image fromScreen)
|
37
|
767 |
] afterSeconds:1
|
|
768 |
!
|
|
769 |
|
|
770 |
screenHardcopy
|
45
|
771 |
"after a second (to allow redraw of views under menu ...),
|
|
772 |
let user specify a rectangular area on the screen
|
|
773 |
and save its contents."
|
|
774 |
|
37
|
775 |
|area|
|
|
776 |
|
|
777 |
Processor addTimedBlock:[
|
45
|
778 |
area := Rectangle fromUser.
|
|
779 |
(area width > 0 and:[area height > 0]) ifTrue:[
|
|
780 |
self saveScreenImage:(Image fromScreen:area)
|
|
781 |
]
|
37
|
782 |
] afterSeconds:1
|
29
|
783 |
!
|
|
784 |
|
|
785 |
viewKiller
|
|
786 |
|v|
|
|
787 |
|
|
788 |
(Delay forSeconds:1) wait.
|
|
789 |
v := Display viewFromUser.
|
|
790 |
v isNil ifTrue:[
|
45
|
791 |
self warn:'sorry, this is not a smalltalk view'
|
29
|
792 |
] ifFalse:[
|
45
|
793 |
v topView destroy
|
29
|
794 |
]
|
|
795 |
!
|
|
796 |
|
|
797 |
viewInspector
|
|
798 |
|v|
|
|
799 |
|
|
800 |
(Delay forSeconds:1) wait.
|
|
801 |
v := Display viewFromUser.
|
|
802 |
v isNil ifTrue:[
|
45
|
803 |
self warn:'sorry, this is not a smalltalk view'
|
29
|
804 |
] ifFalse:[
|
45
|
805 |
v topView inspect
|
29
|
806 |
]
|
0
|
807 |
!
|
|
808 |
|
37
|
809 |
startWindowTreeView
|
|
810 |
WindowTreeView open
|
|
811 |
!
|
|
812 |
|
0
|
813 |
startClassTreeView
|
29
|
814 |
ClassTreeGraphView open
|
0
|
815 |
!
|
|
816 |
|
|
817 |
startEventMonitor
|
29
|
818 |
EventMonitor open
|
0
|
819 |
!
|
|
820 |
|
8
|
821 |
startProcessMonitor
|
29
|
822 |
ProcessMonitor open
|
0
|
823 |
!
|
|
824 |
|
|
825 |
startMemoryMonitor
|
29
|
826 |
MemoryMonitor open
|
8
|
827 |
!
|
|
828 |
|
|
829 |
startMemoryUsage
|
29
|
830 |
MemoryUsageView open
|
0
|
831 |
!
|
|
832 |
|
|
833 |
startTranscript
|
45
|
834 |
(Transcript isKindOf:TextCollector) ifTrue:[
|
|
835 |
"there is only one transcript"
|
|
836 |
Transcript topView isCollapsed ifTrue:[
|
|
837 |
"it is iconified"
|
|
838 |
Transcript topView unrealize.
|
|
839 |
Transcript topView realize.
|
|
840 |
].
|
|
841 |
Transcript topView raise
|
0
|
842 |
] ifFalse:[
|
45
|
843 |
Transcript := TextCollector newTranscript
|
0
|
844 |
]
|
|
845 |
!
|
|
846 |
|
8
|
847 |
startScreenSaver1
|
29
|
848 |
ScreenSaver open
|
8
|
849 |
!
|
|
850 |
|
|
851 |
startScreenSaver2
|
29
|
852 |
LightInTheDark open
|
8
|
853 |
!
|
|
854 |
|
|
855 |
startScreenSaver3
|
29
|
856 |
LightInTheDark2 open
|
8
|
857 |
!
|
|
858 |
|
37
|
859 |
garbageCollect
|
|
860 |
ObjectMemory markAndSweep
|
|
861 |
!
|
|
862 |
|
|
863 |
compressingGarbageCollect
|
52
|
864 |
ObjectMemory verboseGarbageCollect
|
37
|
865 |
! !
|
|
866 |
|
|
867 |
!Launcher methodsFor:'project menu actions'!
|
|
868 |
|
39
|
869 |
projectMenu
|
|
870 |
"this is sent, if ST/X has been built without Projects/ChangeSets."
|
|
871 |
|
57
|
872 |
self warn:'The system has been built without support for projects'.
|
39
|
873 |
!
|
|
874 |
|
0
|
875 |
newProject
|
8
|
876 |
(ProjectView for:(Project new)) open
|
|
877 |
!
|
|
878 |
|
|
879 |
selectProject
|
|
880 |
|list box|
|
|
881 |
|
|
882 |
list := Project allInstances.
|
|
883 |
box := ListSelectionBox new.
|
|
884 |
box list:(list collect:[:p | p name]).
|
|
885 |
box title:(resources string:'select a project').
|
|
886 |
box action:[:selection |
|
45
|
887 |
|project|
|
8
|
888 |
|
45
|
889 |
project := list detect:[:p | p name = selection] ifNone:[nil].
|
|
890 |
project isNil ifTrue:[
|
|
891 |
Transcript showCr:'no such project'
|
|
892 |
] ifFalse:[
|
|
893 |
project showViews.
|
|
894 |
Project current:project
|
|
895 |
]
|
8
|
896 |
].
|
|
897 |
box showAtPointer
|
37
|
898 |
! !
|
|
899 |
|
|
900 |
!Launcher methodsFor:'goody menu actions'!
|
0
|
901 |
|
|
902 |
startXterm
|
|
903 |
OperatingSystem executeCommand:'xterm &'
|
|
904 |
!
|
|
905 |
|
|
906 |
startAddressBook
|
29
|
907 |
AddressBook open
|
0
|
908 |
!
|
|
909 |
|
|
910 |
startNewsTool
|
29
|
911 |
NewsView open
|
0
|
912 |
!
|
|
913 |
|
|
914 |
startMailTool
|
29
|
915 |
MailView open
|
0
|
916 |
!
|
|
917 |
|
|
918 |
startClock
|
29
|
919 |
Clock open
|
0
|
920 |
!
|
|
921 |
|
53
|
922 |
startCalendar
|
|
923 |
Calendar open
|
|
924 |
!
|
|
925 |
|
0
|
926 |
startRoundClock
|
29
|
927 |
RoundClock2 open
|
37
|
928 |
! !
|
|
929 |
|
|
930 |
!Launcher methodsFor:'demo menu actions'!
|
0
|
931 |
|
82
|
932 |
openDemo:className
|
|
933 |
(Smalltalk at:className) open
|
37
|
934 |
! !
|
0
|
935 |
|
37
|
936 |
!Launcher methodsFor:'doc menu actions'!
|
0
|
937 |
|
3
|
938 |
warnIfAbsent:aPath
|
|
939 |
|s|
|
0
|
940 |
|
3
|
941 |
s := Smalltalk systemFileStreamFor:aPath.
|
|
942 |
s isNil ifTrue:[
|
45
|
943 |
self warn:('document ' , aPath , ' not available').
|
|
944 |
^ nil
|
3
|
945 |
].
|
|
946 |
^ s pathName
|
|
947 |
!
|
|
948 |
|
29
|
949 |
showAbout
|
57
|
950 |
|box dark green lbl|
|
29
|
951 |
|
|
952 |
device hasColors ifTrue:[
|
45
|
953 |
green := (Color red:0 green:80 blue:20) darkened.
|
29
|
954 |
] ifFalse:[
|
45
|
955 |
green := White.
|
29
|
956 |
].
|
|
957 |
device hasGreyscales ifTrue:[
|
45
|
958 |
dark := Color grey:10.
|
29
|
959 |
] ifFalse:[
|
45
|
960 |
dark := Black.
|
29
|
961 |
].
|
|
962 |
|
|
963 |
box := InfoBox new.
|
45
|
964 |
box viewBackground:dark; allSubViewsDo:[:s | s viewBackground:dark].
|
57
|
965 |
box form:(Form fromFile:'SmalltalkX.xbm' resolution:100).
|
|
966 |
(lbl := box formLabel) viewBackground:dark.
|
|
967 |
lbl foregroundColor:green backgroundColor:dark.
|
|
968 |
(lbl := box textLabel) viewBackground:dark.
|
|
969 |
lbl foregroundColor:White backgroundColor:dark.
|
29
|
970 |
box title:
|
|
971 |
'Smalltalk/X
|
|
972 |
|
|
973 |
Version ......... ' , Smalltalk versionString , ' (' , Smalltalk versionDate printString , ')
|
|
974 |
Configuration ... ' , Smalltalk configuration , '
|
|
975 |
Running on ...... ' , OperatingSystem getHostName , '
|
|
976 |
|
|
977 |
' , Smalltalk copyrightString.
|
|
978 |
|
|
979 |
box okText:'close'.
|
|
980 |
box autoHideAfter:10 with:[].
|
|
981 |
box showAt:device center - (box extent // 2).
|
|
982 |
!
|
|
983 |
|
3
|
984 |
showOverview
|
82
|
985 |
self showDocumentFile:'misc/overview'
|
8
|
986 |
!
|
3
|
987 |
|
8
|
988 |
showCustomizing
|
82
|
989 |
self showOnlineHelp:'custom/TOP'
|
0
|
990 |
!
|
|
991 |
|
|
992 |
showGettingStarted
|
82
|
993 |
self showOnlineHelp:'getstart/TOP'
|
25
|
994 |
!
|
|
995 |
|
82
|
996 |
showOnlineHelp:baseName
|
|
997 |
self warn:'HTML online help support is is not included in this package.
|
|
998 |
Use any HTML viewer on the files found in doc/online.
|
37
|
999 |
|
82
|
1000 |
Starting view on ascii version of the text ....
|
|
1001 |
'.
|
|
1002 |
self showDocumentFile:'doc/online/english/' , baseName , '.txt'
|
0
|
1003 |
! !
|