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