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