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