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