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