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