181 Launcher aboutIcon. |
205 Launcher aboutIcon. |
182 Launcher smallAboutIcon. |
206 Launcher smallAboutIcon. |
183 " |
207 " |
184 |
208 |
185 "Modified: 9.9.1996 / 22:42:12 / stefan" |
209 "Modified: 9.9.1996 / 22:42:12 / stefan" |
|
210 "Modified: 8.1.1997 / 15:02:56 / cg" |
186 ! ! |
211 ! ! |
187 |
212 |
188 !Launcher methodsFor:'actions - about & help'! |
213 !Launcher methodsFor:'actions - about & help'! |
189 |
214 |
190 about |
215 about |
|
216 "show an about box" |
|
217 |
191 |box| |
218 |box| |
192 |
219 |
193 box := AboutBox new. |
220 box := AboutBox new. |
194 box autoHideAfter:10 with:[]. |
221 box autoHideAfter:10 with:[]. |
195 box showAtCenter |
222 box showAtCenter |
|
223 |
|
224 "Modified: 8.1.1997 / 14:37:07 / cg" |
196 ! |
225 ! |
197 |
226 |
198 showBookPrintDocument |
227 showBookPrintDocument |
|
228 "open an HTML browser on the 'book'-printing document" |
|
229 |
199 self showDocumentation:'BOOK.html' |
230 self showDocumentation:'BOOK.html' |
200 |
231 |
201 "Modified: 31.8.1995 / 13:11:28 / claus" |
232 "Modified: 31.8.1995 / 13:11:28 / claus" |
202 "Created: 12.9.1996 / 01:53:30 / cg" |
233 "Created: 12.9.1996 / 01:53:30 / cg" |
|
234 "Modified: 8.1.1997 / 14:42:59 / cg" |
203 ! |
235 ! |
204 |
236 |
205 showDocumentation:aRelativeDocFilePath |
237 showDocumentation:aRelativeDocFilePath |
|
238 "open an HTML browser on some document" |
|
239 |
206 " |
240 " |
207 although that one is not yet finished, |
241 although that one is not yet finished, |
208 its better than nothing ... |
242 its better than nothing ... |
209 " |
243 " |
210 HTMLDocumentView notNil ifTrue:[ |
244 HTMLDocumentView notNil ifTrue:[ |
247 doc := resources at:'LICENCEFILE' default:doc. |
283 doc := resources at:'LICENCEFILE' default:doc. |
248 self showDocumentation:('../' , doc) |
284 self showDocumentation:('../' , doc) |
249 |
285 |
250 "Created: 14.9.1996 / 12:35:00 / cg" |
286 "Created: 14.9.1996 / 12:35:00 / cg" |
251 "Modified: 23.9.1996 / 17:03:15 / stefan" |
287 "Modified: 23.9.1996 / 17:03:15 / stefan" |
252 "Modified: 11.11.1996 / 14:17:07 / cg" |
288 "Modified: 8.1.1997 / 14:39:57 / cg" |
253 ! |
289 ! |
254 |
290 |
255 startClassDocumentation |
291 startClassDocumentation |
|
292 "open an HTML browser on the 'classDoc/TOP' document" |
|
293 |
256 self showDocumentation:'classDoc/TOP.html' |
294 self showDocumentation:'classDoc/TOP.html' |
257 |
295 |
258 "Modified: 31.8.1995 / 13:11:28 / claus" |
296 "Modified: 31.8.1995 / 13:11:28 / claus" |
259 "Created: 22.4.1996 / 21:03:56 / cg" |
297 "Created: 22.4.1996 / 21:03:56 / cg" |
|
298 "Modified: 8.1.1997 / 14:42:04 / cg" |
260 ! |
299 ! |
261 |
300 |
262 startDocumentationIndex |
301 startDocumentationIndex |
|
302 "open an HTML browser on the 'index' document" |
|
303 |
263 self showDocumentation:'index.html' |
304 self showDocumentation:'index.html' |
264 |
305 |
265 "Modified: 31.8.1995 / 13:11:28 / claus" |
306 "Modified: 31.8.1995 / 13:11:28 / claus" |
266 "Created: 17.4.1996 / 22:08:55 / cg" |
307 "Created: 17.4.1996 / 22:08:55 / cg" |
|
308 "Modified: 8.1.1997 / 14:41:23 / cg" |
267 ! |
309 ! |
268 |
310 |
269 startDocumentationTool |
311 startDocumentationTool |
|
312 "open an HTML browser on the 'TOP' document" |
|
313 |
270 self showDocumentation:'TOP.html' |
314 self showDocumentation:'TOP.html' |
271 |
315 |
272 "Modified: 31.8.1995 / 13:11:28 / claus" |
316 "Modified: 31.8.1995 / 13:11:28 / claus" |
|
317 "Modified: 8.1.1997 / 14:41:38 / cg" |
273 ! |
318 ! |
274 |
319 |
275 startWhatsNewDocumentation |
320 startWhatsNewDocumentation |
|
321 "open an HTML browser on the 'whatsNew.html' document" |
|
322 |
276 self showDocumentation:'whatsNew.html' |
323 self showDocumentation:'whatsNew.html' |
277 |
324 |
278 "Modified: 31.8.1995 / 13:11:28 / claus" |
325 "Modified: 31.8.1995 / 13:11:28 / claus" |
279 "Created: 18.10.1996 / 14:00:35 / cg" |
326 "Created: 18.10.1996 / 14:00:35 / cg" |
|
327 "Modified: 8.1.1997 / 14:39:32 / cg" |
280 ! |
328 ! |
281 |
329 |
282 toggleActiveHelp:aBoolean |
330 toggleActiveHelp:aBoolean |
|
331 "turn on/off active help" |
|
332 |
283 ActiveHelp notNil ifTrue:[ |
333 ActiveHelp notNil ifTrue:[ |
284 helpIsOn := aBoolean. |
334 helpIsOn := aBoolean. |
285 helpIsOn ifTrue:[ |
335 helpIsOn ifTrue:[ |
286 ActiveHelp start |
336 ActiveHelp start |
287 ] ifFalse:[ |
337 ] ifFalse:[ |
288 ActiveHelp stop |
338 ActiveHelp stop |
289 ] |
339 ] |
290 ]. |
340 ]. |
|
341 |
|
342 "Modified: 8.1.1997 / 14:37:30 / cg" |
291 ! ! |
343 ! ! |
292 |
344 |
293 !Launcher methodsFor:'actions - classes'! |
345 !Launcher methodsFor:'actions - classes'! |
294 |
346 |
295 browseImplementors |
347 browseImplementors |
|
348 "open an implementors- browser after asking for a selector" |
|
349 |
296 |enterBox| |
350 |enterBox| |
297 |
351 |
298 enterBox := EnterBox title:(resources at:'Browse implementors of:') withCRs. |
352 enterBox := EnterBox title:(resources at:'Browse implementors of:') withCRs. |
299 enterBox okText:(resources at:'browse'). |
353 enterBox okText:(resources at:'browse'). |
300 enterBox action:[:selectorName | |
354 enterBox action:[:selectorName | |
301 |cls| |
355 |cls| |
302 |
356 |
303 self withWaitCursorDo:[SystemBrowser browseImplementorsOf:selectorName] |
357 self withWaitCursorDo:[SystemBrowser browseImplementorsOf:selectorName] |
304 ]. |
358 ]. |
305 enterBox showAtPointer |
359 enterBox showAtPointer |
|
360 |
|
361 "Modified: 8.1.1997 / 14:44:09 / cg" |
306 ! |
362 ! |
307 |
363 |
308 browseResources |
364 browseResources |
|
365 "open a resource- browser after asking for a resource string" |
|
366 |
309 |enterBox t| |
367 |enterBox t| |
310 |
368 |
311 enterBox := EnterBox title:(resources at:'Resource symbol (nil for any):') withCRs. |
369 enterBox := EnterBox title:(resources at:'Resource symbol (nil for any):') withCRs. |
312 enterBox okText:(resources at:'browse'). |
370 enterBox okText:(resources at:'browse'). |
313 enterBox action:[:resourceName | |
371 enterBox action:[:resourceName | |
327 ] |
385 ] |
328 ]. |
386 ]. |
329 enterBox showAtPointer |
387 enterBox showAtPointer |
330 |
388 |
331 "Created: 28.5.1996 / 13:15:16 / cg" |
389 "Created: 28.5.1996 / 13:15:16 / cg" |
332 "Modified: 29.5.1996 / 17:30:38 / cg" |
390 "Modified: 8.1.1997 / 14:44:41 / cg" |
333 ! |
391 ! |
334 |
392 |
335 browseSenders |
393 browseSenders |
|
394 "open a senders- browser after asking for a selector" |
|
395 |
336 |enterBox| |
396 |enterBox| |
337 |
397 |
338 enterBox := EnterBox title:(resources at:'Browse senders of:') withCRs. |
398 enterBox := EnterBox title:(resources at:'Browse senders of:') withCRs. |
339 enterBox okText:(resources at:'browse'). |
399 enterBox okText:(resources at:'browse'). |
340 enterBox action:[:selectorName | |
400 enterBox action:[:selectorName | |
341 |cls| |
401 |cls| |
342 |
402 |
343 self withWaitCursorDo:[SystemBrowser browseAllCallsOn:selectorName] |
403 self withWaitCursorDo:[SystemBrowser browseAllCallsOn:selectorName] |
344 ]. |
404 ]. |
345 enterBox showAtPointer |
405 enterBox showAtPointer |
|
406 |
|
407 "Modified: 8.1.1997 / 14:46:46 / cg" |
346 ! |
408 ! |
347 |
409 |
348 startChangesBrowser |
410 startChangesBrowser |
|
411 "open a changebrowser" |
|
412 |
349 self withWaitCursorDo:[ChangesBrowser open] |
413 self withWaitCursorDo:[ChangesBrowser open] |
|
414 |
|
415 "Modified: 8.1.1997 / 14:47:07 / cg" |
350 ! |
416 ! |
351 |
417 |
352 startClassBrowser |
418 startClassBrowser |
|
419 "open a classBrowser; asks for class" |
|
420 |
353 SystemBrowser askThenBrowseClass |
421 SystemBrowser askThenBrowseClass |
|
422 |
|
423 "Modified: 8.1.1997 / 14:48:16 / cg" |
354 ! |
424 ! |
355 |
425 |
356 startClassHierarchyBrowser |
426 startClassHierarchyBrowser |
|
427 "open a classHierarchyBrowser; asks for class" |
|
428 |
357 SystemBrowser askThenBrowseClassHierarchy |
429 SystemBrowser askThenBrowseClassHierarchy |
|
430 |
|
431 "Modified: 8.1.1997 / 14:48:28 / cg" |
358 ! |
432 ! |
359 |
433 |
360 startClassTreeView |
434 startClassTreeView |
|
435 "open a classHierarchyTree view" |
|
436 |
361 self withWaitCursorDo:[ClassTreeGraphView open] |
437 self withWaitCursorDo:[ClassTreeGraphView open] |
|
438 |
|
439 "Modified: 8.1.1997 / 14:48:38 / cg" |
362 ! |
440 ! |
363 |
441 |
364 startFileBrowser |
442 startFileBrowser |
|
443 "open a fileBrowser" |
|
444 |
365 self withWaitCursorDo:[FileBrowser open] |
445 self withWaitCursorDo:[FileBrowser open] |
|
446 |
|
447 "Modified: 8.1.1997 / 14:48:47 / cg" |
366 ! |
448 ! |
367 |
449 |
368 startFullClassBrowser |
450 startFullClassBrowser |
|
451 "open a fullClass systemBrowser; asks for class" |
|
452 |
369 SystemBrowser askThenBrowseFullClassProtocol |
453 SystemBrowser askThenBrowseFullClassProtocol |
|
454 |
|
455 "Modified: 8.1.1997 / 14:48:06 / cg" |
370 ! |
456 ! |
371 |
457 |
372 startJavaBrowser |
458 startJavaBrowser |
|
459 "open a javaBrowser (not included in the standard distribution)" |
|
460 |
373 JavaBrowser notNil ifTrue:[ |
461 JavaBrowser notNil ifTrue:[ |
374 self withWaitCursorDo:[JavaBrowser open] |
462 self withWaitCursorDo:[JavaBrowser open] |
375 ] |
463 ] |
376 |
464 |
377 "Created: 18.4.1996 / 15:55:44 / cg" |
465 "Created: 18.4.1996 / 15:55:44 / cg" |
378 "Modified: 19.4.1996 / 16:39:08 / cg" |
466 "Modified: 8.1.1997 / 14:47:31 / cg" |
379 ! |
467 ! |
380 |
468 |
381 startSystemBrowser |
469 startSystemBrowser |
|
470 "open a systemBrowser" |
|
471 |
382 self withWaitCursorDo:[SystemBrowser open] |
472 self withWaitCursorDo:[SystemBrowser open] |
|
473 |
|
474 "Modified: 8.1.1997 / 14:47:43 / cg" |
383 ! |
475 ! |
384 |
476 |
385 startWorkspace |
477 startWorkspace |
|
478 "open a workspace" |
|
479 |
386 Workspace open |
480 Workspace open |
|
481 |
|
482 "Modified: 8.1.1997 / 14:47:49 / cg" |
387 ! ! |
483 ! ! |
388 |
484 |
389 !Launcher methodsFor:'actions - demos'! |
485 !Launcher methodsFor:'actions - demos'! |
390 |
486 |
391 openDemo:className |
487 openDemo:className |
|
488 "open a demo, given its name. |
|
489 Looks in both the Smalltalk- and the Demos-Namespace |
|
490 for that class." |
|
491 |
392 self openApplication:className nameSpace:Demos |
492 self openApplication:className nameSpace:Demos |
393 |
493 |
394 "Modified: 8.1.1997 / 12:50:05 / cg" |
494 "Modified: 8.1.1997 / 14:51:02 / cg" |
395 ! |
495 ! |
396 |
496 |
397 startTetris |
497 startTetris |
|
498 "opens a tetris game" |
|
499 |
398 self openDemo:'Tetris' |
500 self openDemo:'Tetris' |
399 |
501 |
400 "Modified: 8.1.1997 / 12:51:39 / cg" |
502 "Modified: 8.1.1997 / 14:49:15 / cg" |
401 ! |
503 ! |
402 |
504 |
403 startTicTacToe |
505 startTicTacToe |
|
506 "opens a ticTacToe game against the machine" |
|
507 |
404 self openDemo:'TicTacToeGame' |
508 self openDemo:'TicTacToeGame' |
405 |
509 |
406 "Modified: 8.1.1997 / 12:51:49 / cg" |
510 "Modified: 8.1.1997 / 14:49:37 / cg" |
407 ! |
511 ! |
408 |
512 |
409 startTicTacToe2 |
513 startTicTacToe2 |
|
514 "opens a 2-user ticTacToe game" |
|
515 |
410 self openApplication:'TicTacToeGame' nameSpace:Demos with:#open2UserGame |
516 self openApplication:'TicTacToeGame' nameSpace:Demos with:#open2UserGame |
411 |
517 |
412 "Modified: 8.1.1997 / 12:52:50 / cg" |
518 "Modified: 8.1.1997 / 14:49:29 / cg" |
413 ! ! |
519 ! ! |
414 |
520 |
415 !Launcher methodsFor:'actions - file'! |
521 !Launcher methodsFor:'actions - file'! |
416 |
522 |
417 exit |
523 exit |
|
524 "stop ST/X - after asking for confirmation" |
|
525 |
418 (self confirm:(resources string:'Are you certain you want to exit without saving ?')) |
526 (self confirm:(resources string:'Are you certain you want to exit without saving ?')) |
419 ifTrue:[ |
527 ifTrue:[ |
420 self saveAllViews. |
528 self saveAllViews. |
421 Smalltalk exit |
529 Smalltalk exit |
422 ] |
530 ] |
|
531 |
|
532 "Modified: 8.1.1997 / 14:50:00 / cg" |
423 ! |
533 ! |
424 |
534 |
425 objectModuleDialog |
535 objectModuleDialog |
|
536 "opens a moduleInfo dialog" |
|
537 |
426 |allModules moduleNames |
538 |allModules moduleNames |
427 allObjects methodObjects methodNames |
539 allObjects methodObjects methodNames |
428 cObjects cObjectNames |
540 cObjects cObjectNames |
429 otherObjects otherObjectNames |
541 otherObjects otherObjectNames |
430 box l handles unloadButton |
542 box l handles unloadButton |
802 " |
918 " |
803 Smalltalk exit |
919 Smalltalk exit |
804 ] |
920 ] |
805 ]. |
921 ]. |
806 |
922 |
807 "Modified: 1.6.1996 / 17:02:07 / cg" |
923 "Modified: 8.1.1997 / 14:50:36 / cg" |
808 ! ! |
924 ! ! |
809 |
925 |
810 !Launcher methodsFor:'actions - goodies'! |
926 !Launcher methodsFor:'actions - goodies'! |
811 |
927 |
812 openGoodie:className |
928 openGoodie:className |
|
929 "open a goodie, given its name. |
|
930 Looks in both the Smalltalk- and the Goodies-Namespace |
|
931 for that class." |
|
932 |
813 self openApplication:className nameSpace:Goodies |
933 self openApplication:className nameSpace:Goodies |
814 |
934 |
815 "Modified: 8.1.1997 / 12:50:46 / cg" |
935 "Modified: 8.1.1997 / 14:51:18 / cg" |
816 ! |
936 ! |
817 |
937 |
818 startCalendar |
938 startCalendar |
|
939 "open a calendar goodie" |
|
940 |
819 self openGoodie:'Calendar' |
941 self openGoodie:'Calendar' |
820 |
942 |
821 "Modified: 8.1.1997 / 12:50:59 / cg" |
943 "Modified: 8.1.1997 / 14:51:29 / cg" |
822 ! |
944 ! |
823 |
945 |
824 startClock |
946 startClock |
|
947 "open a clock goodie" |
|
948 |
825 self openGoodie:'RoundClock' |
949 self openGoodie:'RoundClock' |
826 |
950 |
827 "Modified: 8.1.1997 / 12:51:07 / cg" |
951 "Modified: 8.1.1997 / 14:51:34 / cg" |
828 ! |
952 ! |
829 |
953 |
830 startMailTool |
954 startMailTool |
|
955 "open a mailView goodie" |
|
956 |
831 self openGoodie:'MailView' |
957 self openGoodie:'MailView' |
832 |
958 |
833 "Modified: 8.1.1997 / 12:51:19 / cg" |
959 "Modified: 8.1.1997 / 14:51:42 / cg" |
834 ! |
960 ! |
835 |
961 |
836 startNewsTool |
962 startNewsTool |
|
963 "open a newsTool goodie" |
|
964 |
837 self openGoodie:'NewsView' |
965 self openGoodie:'NewsView' |
838 |
966 |
839 "Modified: 8.1.1997 / 12:51:24 / cg" |
967 "Modified: 8.1.1997 / 14:51:48 / cg" |
840 ! ! |
968 ! ! |
841 |
969 |
842 !Launcher methodsFor:'actions - projects'! |
970 !Launcher methodsFor:'actions - projects'! |
843 |
971 |
844 newProject |
972 newProject |
|
973 "creates a new project & opens a projectView for it" |
|
974 |
845 Project notNil ifTrue:[ |
975 Project notNil ifTrue:[ |
846 (ProjectView for:(Project new)) open |
976 (ProjectView for:(Project new)) open |
847 ] |
977 ] |
|
978 |
|
979 "Modified: 8.1.1997 / 14:52:07 / cg" |
848 ! |
980 ! |
849 |
981 |
850 selectProject |
982 selectProject |
|
983 "asks for and switch to another project" |
|
984 |
851 |list box| |
985 |list box| |
852 |
986 |
853 Project notNil ifTrue:[ |
987 Project notNil ifTrue:[ |
854 list := Project allInstances. |
988 list := Project allInstances. |
855 box := ListSelectionBox new. |
989 box := ListSelectionBox new. |
2540 self reopenLauncher. |
2698 self reopenLauncher. |
2541 ] |
2699 ] |
2542 ]. |
2700 ]. |
2543 box destroy |
2701 box destroy |
2544 |
2702 |
2545 "Modified: 5.7.1996 / 13:13:22 / cg" |
2703 "Modified: 8.1.1997 / 14:54:08 / cg" |
2546 ! ! |
2704 ! ! |
2547 |
2705 |
2548 !Launcher methodsFor:'actions - tools'! |
2706 !Launcher methodsFor:'actions - tools'! |
2549 |
2707 |
2550 compressingGarbageCollect |
2708 compressingGarbageCollect |
|
2709 "perform a compressing garbageCollect" |
|
2710 |
2551 ObjectMemory verboseGarbageCollect |
2711 ObjectMemory verboseGarbageCollect |
2552 |
2712 |
2553 "Created: 12.5.1996 / 15:30:15 / cg" |
2713 "Created: 12.5.1996 / 15:30:15 / cg" |
|
2714 "Modified: 8.1.1997 / 14:54:21 / cg" |
2554 ! |
2715 ! |
2555 |
2716 |
2556 findAndDestroyWindow |
2717 findAndDestroyWindow |
|
2718 "find a window (by name) and destroy it" |
|
2719 |
2557 |v| |
2720 |v| |
2558 |
2721 |
2559 v := self findWindow. |
2722 v := self findWindow. |
2560 v notNil ifTrue:[ |
2723 v notNil ifTrue:[ |
2561 v destroy. |
2724 v destroy. |
2562 ]. |
2725 ]. |
2563 |
2726 |
2564 "Created: 28.10.1996 / 14:39:23 / cg" |
2727 "Created: 28.10.1996 / 14:39:23 / cg" |
|
2728 "Modified: 8.1.1997 / 14:54:52 / cg" |
2565 ! |
2729 ! |
2566 |
2730 |
2567 findAndRaiseWindow |
2731 findAndRaiseWindow |
|
2732 "find a window (by name) and raise it" |
|
2733 |
2568 |v| |
2734 |v| |
2569 |
2735 |
2570 v := self findWindow. |
2736 v := self findWindow. |
2571 v notNil ifTrue:[ |
2737 v notNil ifTrue:[ |
2572 v raiseDeiconified. |
2738 v raiseDeiconified. |
2573 ]. |
2739 ]. |
2574 |
2740 |
2575 "Modified: 28.10.1996 / 14:39:04 / cg" |
2741 "Modified: 8.1.1997 / 14:54:59 / cg" |
2576 ! |
|
2577 |
|
2578 findWindow |
|
2579 "a helper for find & destroy and find & raise operations; |
|
2580 let user choose a view and return it; return nil on cancel" |
|
2581 |
|
2582 |knownTopViews nameList box| |
|
2583 |
|
2584 knownTopViews := IdentitySet new. |
|
2585 Screen allScreens do:[:aScreen | |
|
2586 aScreen knownViews do:[:aView | |
|
2587 aView notNil ifTrue:[ |
|
2588 knownTopViews add:aView topView |
|
2589 ] |
|
2590 ] |
|
2591 ]. |
|
2592 |
|
2593 knownTopViews := knownTopViews select:[:aView | aView windowGroup notNil |
|
2594 and:[aView windowGroup isModal not]]. |
|
2595 |
|
2596 knownTopViews := knownTopViews asOrderedCollection. |
|
2597 knownTopViews sort:[:v1 :v2 | v1 label < v2 label]. |
|
2598 nameList := knownTopViews collect:[:v | |
|
2599 |isDead wg p| |
|
2600 |
|
2601 ((wg := v windowGroup) notNil |
|
2602 and:[(p := wg process) notNil |
|
2603 and:[p state ~~ #dead]]) ifTrue:[ |
|
2604 v label |
|
2605 ] ifFalse:[ |
|
2606 v label , ' (dead ?)' |
|
2607 ] |
|
2608 ]. |
|
2609 |
|
2610 box := ListSelectionBox new. |
|
2611 box noEnterField. |
|
2612 box list:nameList. |
|
2613 box label:(resources string:'view selection'). |
|
2614 box title:(resources string:'select a view to raise deiconified:') withCRs. |
|
2615 box action:[:selection | |
|
2616 |v| |
|
2617 |
|
2618 v := knownTopViews at:box selectionIndex. |
|
2619 box destroy. |
|
2620 ^ v |
|
2621 ]. |
|
2622 box extent:400@300. |
|
2623 box showAtPointer. |
|
2624 ^ nil |
|
2625 |
|
2626 "Modified: 16.10.1996 / 12:41:39 / cg" |
|
2627 "Created: 28.10.1996 / 14:38:41 / cg" |
|
2628 ! |
2742 ! |
2629 |
2743 |
2630 fullScreenHardcopy |
2744 fullScreenHardcopy |
2631 "after a second (to allow redraw of views under menu ...), |
2745 "after a second (to allow redraw of views under menu ...), |
2632 save the contents of the whole screen." |
2746 save the contents of the whole screen." |
2972 |
3130 |
2973 "Created: 23.12.1995 / 12:38:29 / cg" |
3131 "Created: 23.12.1995 / 12:38:29 / cg" |
2974 "Modified: 5.7.1996 / 13:13:15 / cg" |
3132 "Modified: 5.7.1996 / 13:13:15 / cg" |
2975 ! ! |
3133 ! ! |
2976 |
3134 |
2977 !Launcher methodsFor:'initialize / release'! |
3135 !Launcher methodsFor:'initialize - menus'! |
2978 |
|
2979 addTopViewsToCurrentProject |
|
2980 "ignored here - the launcher is always global (i.e. not project private)." |
|
2981 |
|
2982 ^ self |
|
2983 ! |
|
2984 |
|
2985 buttonPanelSpec |
|
2986 "return a spec for the buttons in the panel; |
|
2987 entries consists of selector and bitmap-filename. |
|
2988 nil selectors are taken as separators (see setupButtonPanel)" |
|
2989 |
|
2990 ^ #( |
|
2991 #(startSystemBrowser 'SBrowser32x32.xbm') |
|
2992 #(startFileBrowser 'FBrowser32x32.xbm') |
|
2993 "/ #(startWorkspace 'Workspace32x32.xbm') |
|
2994 #(nil nil) |
|
2995 #(startChangesBrowser 'CBrowser32x32.xbm') |
|
2996 "/ #(nil nil) |
|
2997 "/ #(nil nil) |
|
2998 "/ #(startDocumentationTool 'book11.ico') |
|
2999 ) |
|
3000 |
|
3001 "Created: 4.12.1995 / 20:16:18 / cg" |
|
3002 "Modified: 19.4.1996 / 16:37:46 / cg" |
|
3003 ! |
|
3004 |
|
3005 closeDownViews |
|
3006 OpenLaunchers remove:self ifAbsent:nil. |
|
3007 super closeDownViews. |
|
3008 |
|
3009 "Created: 5.7.1996 / 13:33:36 / cg" |
|
3010 ! |
|
3011 |
|
3012 closeRequest |
|
3013 (self confirm:(resources string:'really close %1 ?' with:self class name)) ifTrue:[ |
|
3014 super closeRequest |
|
3015 ] |
|
3016 ! |
|
3017 |
3136 |
3018 disableDangerousMenuItemsInRemoteLauncher |
3137 disableDangerousMenuItemsInRemoteLauncher |
3019 "if I am a remote launcher (multidisplay operation), |
3138 "if I am a remote launcher (multidisplay operation), |
3020 disable menus which are dangerous or affect common state. |
3139 disable menus which are dangerous or affect common state. |
3021 These operations have to |
3140 These operations have to |
3029 |
3148 |
3030 "Created: 5.7.1996 / 17:00:50 / cg" |
3149 "Created: 5.7.1996 / 17:00:50 / cg" |
3031 "Modified: 5.7.1996 / 17:01:30 / cg" |
3150 "Modified: 5.7.1996 / 17:01:30 / cg" |
3032 ! |
3151 ! |
3033 |
3152 |
3034 focusSequence |
3153 setupAboutMenu |
3035 ^ (Array with:myMenu) |
3154 "setup the about- pulldown menu" |
3036 , |
3155 |
3037 (buttonPanel subViews select:[:element | element isKindOf:Button]) |
3156 myMenu at:#about |
3038 "/ , (Array with:Transcript) |
3157 putLabels:(resources array:#( |
3039 ! |
3158 'about Smalltalk/X ...' |
3040 |
3159 '-' |
3041 openInterface |
3160 'licence conditions' |
3042 "sent by my superclass to open up my interface" |
3161 )) |
3043 |
3162 selectors:#( |
3044 |top icn w scrn sz| |
3163 #about |
3045 |
3164 nil |
3046 "/ if there is already a transcript on my device, |
3165 #showLicenceConditions |
3047 "/ I am a slave launcher with limited functionality. |
3166 ) |
3048 |
3167 receiver:self. |
3049 Transcript notNil ifTrue:[ |
3168 |
3050 Transcript ~~ Stderr ifTrue:[ |
3169 "Created: 8.1.1997 / 14:03:20 / cg" |
3051 isMainLauncher := (Transcript graphicsDevice == device). |
3170 "Modified: 8.1.1997 / 14:04:19 / cg" |
3052 ] ifFalse:[ |
3171 ! |
3053 isMainLauncher := true |
3172 |
3054 ] |
3173 setupClassesMenu |
3055 ] ifFalse:[ |
3174 "setup the classes- pulldown menu" |
3056 isMainLauncher := true |
3175 |
3057 ]. |
3176 myMenu at:#classes |
3058 |
3177 putLabels:(resources array:#( |
3059 top := StandardSystemView onDevice:device. |
3178 'system browser' |
3060 top label:'Smalltalk/X'; iconLabel:'ST/X Launcher'. |
3179 'class browser ...' |
3061 top extent:(400@300 ). |
3180 'full class browser ...' |
3062 |
3181 'class hierarchy browser ...' |
3063 icn := self class aboutIcon. |
3182 'class tree' |
3064 icn notNil ifTrue:[ |
3183 '-' |
3065 icn := icn magnifiedTo:(sz := Screen current preferredIconSize). |
3184 'implementors ...' |
3066 ]. |
3185 'senders ...' |
3067 |
3186 'resource ...' |
3068 ((scrn := Screen current) supportsDeepIcons not |
3187 '-' |
3069 and:[scrn supportsIconViews |
3188 'change browser' |
3070 and:[scrn depth > 1]]) ifTrue:[ |
3189 )) |
3071 w := View extent:sz. |
3190 selectors:#( |
3072 w viewBackground:icn. |
3191 #startSystemBrowser |
3073 top iconView:w |
3192 #startClassBrowser |
3074 ] ifFalse:[ |
3193 #startFullClassBrowser |
3075 top icon:icn. |
3194 #startClassHierarchyBrowser |
3076 ]. |
3195 #startClassTreeView |
3077 |
3196 nil |
3078 "/ (scrn := Screen current) supportsDeepIcons ifTrue:[ |
3197 #browseImplementors |
3079 "/ icn := self class aboutIcon. |
3198 #browseSenders |
3080 "/ icn notNil ifTrue:[ |
3199 #browseResources |
3081 "/ icn := icn magnifiedTo:(sz := scrn preferredIconSize). |
3200 nil |
3082 "/ icn := Depth8Image fromImage:icn. |
3201 #startChangesBrowser |
3083 "/ top icon:icn |
3202 ) |
3084 "/ ]. |
3203 receiver:self. |
3085 |
3204 |
3086 "/ ] ifFalse:[ |
3205 JavaBrowser notNil ifTrue:[ |
3087 "/ scrn supportsIconViews ifTrue:[ |
3206 (myMenu subMenuAt:#classes) |
3088 "/ icn := self class aboutIcon. |
3207 addLabels:(resources array:#('-' 'java browser')) |
3089 "/ icn notNil ifTrue:[ |
3208 selectors:#(nil startJavaBrowser) |
3090 "/ icn := icn magnifiedTo:(sz := scrn preferredIconSize). |
3209 after:#startClassTreeView |
3091 "/ w := View extent:sz. |
3210 ]. |
3092 "/ w viewBackground:icn. |
3211 |
3093 "/ top iconView:w |
3212 "Created: 8.1.1997 / 14:05:44 / cg" |
3094 "/ ]. |
|
3095 "/ ] |
|
3096 "/ ]. |
|
3097 |
|
3098 self setupViewsIn:top. |
|
3099 |
|
3100 top application:self. |
|
3101 |
|
3102 " |
|
3103 open with higher prio to allow interaction even while things |
|
3104 are running ... |
|
3105 " |
|
3106 top openWithPriority:(Processor userSchedulingPriority + 1). |
|
3107 |
|
3108 OpenLaunchers isNil ifTrue:[ |
|
3109 OpenLaunchers := OrderedCollection new. |
|
3110 ]. |
|
3111 OpenLaunchers add:self. |
|
3112 |
|
3113 "Modified: 25.7.1996 / 21:12:09 / cg" |
|
3114 ! |
|
3115 |
|
3116 release |
|
3117 infoProcess notNil ifTrue:[ |
|
3118 infoProcess terminate. |
|
3119 infoProcess := nil. |
|
3120 ]. |
|
3121 OpenLaunchers remove:self ifAbsent:nil. |
|
3122 super release |
|
3123 |
|
3124 "Modified: 5.7.1996 / 11:48:56 / cg" |
|
3125 ! |
|
3126 |
|
3127 restarted |
|
3128 "image restart - since WindowGroup recreates the process with |
|
3129 the default priority, we have to raise the prio again. |
|
3130 Mhmh - this looks like a bug to me ... |
|
3131 Also, the cursor (which was stored as a write or waitCursor) must |
|
3132 be reset to normal." |
|
3133 |
|
3134 Processor activeProcess priority:(Processor userSchedulingPriority + 1). |
|
3135 |
|
3136 super restarted |
|
3137 |
|
3138 "Modified: 1.6.1996 / 16:58:25 / cg" |
|
3139 ! |
|
3140 |
|
3141 saveAndTerminateRequest |
|
3142 "some windowManagers can send this, to shutDown an application |
|
3143 but let it save its state before, for later restart. |
|
3144 Although I have not yet encountered such a windowManager, |
|
3145 we are already prepared for this ;-)" |
|
3146 |
|
3147 self snapshot. |
|
3148 super saveAndTerminateRequest |
|
3149 |
|
3150 "Created: 5.7.1996 / 13:07:45 / cg" |
|
3151 "Modified: 5.7.1996 / 13:08:55 / cg" |
|
3152 ! |
|
3153 |
|
3154 setupButtonPanelIn:aTopView |
|
3155 "create the buttonPanel" |
|
3156 |
|
3157 |spc mh buttonSize| |
|
3158 |
|
3159 spc := View viewSpacing // 2. |
|
3160 buttonPanel := HorizontalPanelView in:aTopView. |
|
3161 buttonPanel level:-1; borderWidth:0. |
|
3162 buttonPanel horizontalLayout:#leftSpace. |
|
3163 |
|
3164 buttonSize := self class buttonImageSize. |
|
3165 |
|
3166 "/ |
|
3167 "/ the buttonSpec is a collection of: |
|
3168 "/ #( selector iconFileName ) |
|
3169 "/ or: |
|
3170 "/ #( selector (className iconQuerySelector) ) |
|
3171 "/ or" |
|
3172 "/ #( nil ) |
|
3173 "/ |
|
3174 self buttonPanelSpec do:[:entry | |
|
3175 |sel b sep img iconSpec| |
|
3176 |
|
3177 sel := entry at:1. |
|
3178 sel isNil ifTrue:[ |
|
3179 sep := View in:buttonPanel. |
|
3180 sep extent:32@1; borderWidth:0. |
|
3181 ] ifFalse:[ |
|
3182 b := Button in:buttonPanel. |
|
3183 iconSpec := entry at:2. |
|
3184 iconSpec isArray ifTrue:[ |
|
3185 img := (Smalltalk classNamed:(iconSpec at:1)) perform:(iconSpec at:2). |
|
3186 ] ifFalse:[ |
|
3187 img := Image fromFile:iconSpec. |
|
3188 ]. |
|
3189 (img notNil and:[buttonSize notNil]) ifTrue:[ |
|
3190 img extent ~= buttonSize ifTrue:[ |
|
3191 img := img magnifiedTo:buttonSize |
|
3192 ] |
|
3193 ]. |
|
3194 b form:img. |
|
3195 b model:self; changeMessage:sel |
|
3196 ] |
|
3197 ]. |
|
3198 |
|
3199 mh := myMenu height. |
|
3200 buttonPanel origin:0.0 @ (mh + spc) |
|
3201 corner:(1.0 @ (mh + spc + buttonPanel preferredExtent y)). |
|
3202 |
|
3203 buttonPanel leftInset:spc; rightInset:spc. |
|
3204 |
|
3205 "Modified: 29.5.1996 / 19:23:04 / cg" |
|
3206 ! |
3213 ! |
3207 |
3214 |
3208 setupDemoMenu |
3215 setupDemoMenu |
3209 "setup the demo pulldown menu" |
3216 "setup the demo- pulldown menu" |
3210 |
3217 |
3211 |m| |
3218 |m| |
3212 |
3219 |
3213 myMenu at:#demos |
3220 myMenu at:#demos |
3214 putLabels:(resources array:#( |
3221 putLabels:(resources array:#( |
3605 (ActiveHelp notNil |
3462 (ActiveHelp notNil |
3606 and:[ActiveHelp isActive]) ifTrue:[ |
3463 and:[ActiveHelp isActive]) ifTrue:[ |
3607 (myMenu menuAt:#help) checkToggleAt:#toggleActiveHelp: put:true |
3464 (myMenu menuAt:#help) checkToggleAt:#toggleActiveHelp: put:true |
3608 ]. |
3465 ]. |
3609 |
3466 |
|
3467 "Created: 8.1.1997 / 14:08:09 / cg" |
|
3468 ! |
|
3469 |
|
3470 setupMainMenu |
|
3471 "setup the pulldown menus main items. |
|
3472 Extracted into a separate method, to allow subclasses to |
|
3473 add their own entries" |
|
3474 |
|
3475 |l s icon| |
|
3476 |
|
3477 myMenu labels:(resources array:#( |
|
3478 about |
|
3479 file |
|
3480 classes |
|
3481 tools |
|
3482 projects |
|
3483 settings |
|
3484 demos |
|
3485 help)). |
|
3486 " |
|
3487 if there is a bitmap, change 'about' to the ST/X icon |
|
3488 " |
|
3489 icon := self class smallAboutIcon. |
|
3490 icon notNil ifTrue:[ |
|
3491 myMenu labels at:1 put:icon. |
|
3492 myMenu height:(myMenu height max:(icon height + (View viewSpacing * 2))) |
|
3493 ]. |
|
3494 |
|
3495 myMenu selectors:#( |
|
3496 #about |
|
3497 #file |
|
3498 #classes |
|
3499 #tools |
|
3500 #projects |
|
3501 #settings |
|
3502 #demos |
|
3503 #help). |
|
3504 |
|
3505 "Created: 8.1.1997 / 13:58:50 / cg" |
|
3506 ! |
|
3507 |
|
3508 setupMenu |
|
3509 "setup the pulldown menu" |
|
3510 |
|
3511 |mainItems| |
|
3512 |
|
3513 self setupMainMenu. |
|
3514 |
|
3515 mainItems := myMenu selectors. |
|
3516 |
|
3517 (mainItems includes:#about) ifTrue:[ |
|
3518 "/ if not redefined without an about-menu ... |
|
3519 self setupAboutMenu |
|
3520 ]. |
|
3521 (mainItems includes:#file) ifTrue:[ |
|
3522 "/ if not redefined without a file-menu ... |
|
3523 self setupFileMenu |
|
3524 ]. |
|
3525 (mainItems includes:#classes) ifTrue:[ |
|
3526 "/ if not redefined without a classes-menu ... |
|
3527 self setupClassesMenu |
|
3528 ]. |
|
3529 (mainItems includes:#projects) ifTrue:[ |
|
3530 "/ if not redefined without a projects-menu ... |
|
3531 self setupProjectsMenu |
|
3532 ]. |
|
3533 (mainItems includes:#settings) ifTrue:[ |
|
3534 "/ if not redefined without a settings-menu ... |
|
3535 self setupSettingsMenu |
|
3536 ]. |
|
3537 (mainItems includes:#tools) ifTrue:[ |
|
3538 "/ if not redefined without a tools-menu ... |
|
3539 self setupToolsMenu |
|
3540 ]. |
|
3541 (mainItems includes:#demos) ifTrue:[ |
|
3542 "/ if not redefined without a demos-menu ... |
|
3543 self setupDemoMenu |
|
3544 ]. |
|
3545 (mainItems includes:#help) ifTrue:[ |
|
3546 "/ if not redefined without a help-menu ... |
|
3547 self setupHelpMenu |
|
3548 ]. |
|
3549 |
3610 self disableDangerousMenuItemsInRemoteLauncher |
3550 self disableDangerousMenuItemsInRemoteLauncher |
3611 |
3551 |
3612 "Modified: 9.11.1996 / 01:49:40 / cg" |
3552 "Modified: 8.1.1997 / 14:09:47 / cg" |
3613 ! |
3553 ! |
3614 |
3554 |
3615 setupOtherViewsIn:aTopView |
3555 setupProjectsMenu |
3616 "a hook - allows redefinition in your personal subclass. |
3556 "setup the projects- pulldown menu" |
3617 For example, add a clock:" |
3557 |
3618 |
3558 myMenu at:#projects |
3619 " |
3559 putLabels:(resources array:#( |
3620 |sz clock space halfSpace| |
3560 'new project' |
3621 |
3561 '-' |
3622 sz := buttonPanel innerHeight - (buttonPanel level abs*2). |
3562 'select project ...' |
3623 space := View viewSpacing. |
3563 )) |
3624 halfSpace := space // 2. |
3564 selectors:#( |
3625 |
3565 #newProject |
3626 buttonPanel rightInset:sz+(space * 2). |
3566 nil |
3627 |
3567 #selectProject |
3628 clock := ClockView in:buttonPanel topView. |
3568 ) |
3629 clock borderWidth:1. |
3569 receiver:self. |
3630 clock showSeconds:false. |
3570 |
3631 clock extent:(sz @ sz). |
3571 "Created: 8.1.1997 / 14:06:18 / cg" |
3632 clock origin:(1.0 @ (buttonPanel origin y + halfSpace)). |
3572 ! |
3633 clock leftInset:sz negated - 2 - halfSpace. |
3573 |
3634 clock rightInset:halfSpace. |
3574 setupSettingsMenu |
3635 clock level:1. |
3575 "setup the settings- pulldown menu" |
3636 " |
3576 |
|
3577 myMenu at:#settings |
|
3578 putLabels:(resources array:#( |
|
3579 'language ...' |
|
3580 'show keyboard mappings ...' |
|
3581 'view style ...' |
|
3582 'fonts ...' |
|
3583 'printer ...' |
|
3584 'messages ...' |
|
3585 'compilation ...' |
|
3586 'object memory ...' |
|
3587 'screen ...' |
|
3588 'misc ...' |
|
3589 '=' |
|
3590 'save settings ...' |
|
3591 'restore settings ...' |
|
3592 )) |
|
3593 selectors:#( |
|
3594 #languageSetting |
|
3595 #keyboardSetting |
|
3596 #viewStyleSetting |
|
3597 #fontSettings |
|
3598 #printerSettings |
|
3599 #messageSettings |
|
3600 #compilerSettings |
|
3601 #memorySettings |
|
3602 #displaySettings |
|
3603 #miscSettings |
|
3604 nil |
|
3605 #saveSettings |
|
3606 #restoreSettings |
|
3607 ) |
|
3608 receiver:self. |
|
3609 |
|
3610 "Created: 8.1.1997 / 14:07:00 / cg" |
3637 ! |
3611 ! |
3638 |
3612 |
3639 setupToolsMenu |
3613 setupToolsMenu |
3640 "setup the tools pulldown menu" |
3614 "setup the tools- pulldown menu" |
3641 |
3615 |
3642 |m| |
3616 |m| |
3643 |
3617 |
3644 myMenu at:#tools |
3618 myMenu at:#tools |
3645 putLabels:(resources array:#( |
3619 putLabels:(resources array:#( |
3738 #screenHardcopy |
3712 #screenHardcopy |
3739 #viewHardcopy |
3713 #viewHardcopy |
3740 ) |
3714 ) |
3741 receiver:self). |
3715 receiver:self). |
3742 |
3716 |
3743 "Modified: 28.10.1996 / 14:40:03 / cg" |
3717 "Modified: 8.1.1997 / 14:04:25 / cg" |
|
3718 ! ! |
|
3719 |
|
3720 !Launcher methodsFor:'initialize / release'! |
|
3721 |
|
3722 addTopViewsToCurrentProject |
|
3723 "ignored here - the launcher is always global (i.e. not project private)." |
|
3724 |
|
3725 ^ self |
|
3726 ! |
|
3727 |
|
3728 buttonPanelSpec |
|
3729 "return a spec for the buttons in the panel; |
|
3730 entries consists of selector and bitmap-filename. |
|
3731 nil selectors are taken as separators (see setupButtonPanel)" |
|
3732 |
|
3733 ^ #( |
|
3734 #(startSystemBrowser 'SBrowser32x32.xbm') |
|
3735 #(startFileBrowser 'FBrowser32x32.xbm') |
|
3736 "/ #(startWorkspace 'Workspace32x32.xbm') |
|
3737 #(nil nil) |
|
3738 #(startChangesBrowser 'CBrowser32x32.xbm') |
|
3739 "/ #(nil nil) |
|
3740 "/ #(nil nil) |
|
3741 "/ #(startDocumentationTool 'book11.ico') |
|
3742 ) |
|
3743 |
|
3744 "Created: 4.12.1995 / 20:16:18 / cg" |
|
3745 "Modified: 19.4.1996 / 16:37:46 / cg" |
|
3746 ! |
|
3747 |
|
3748 closeDownViews |
|
3749 OpenLaunchers remove:self ifAbsent:nil. |
|
3750 super closeDownViews. |
|
3751 |
|
3752 "Created: 5.7.1996 / 13:33:36 / cg" |
|
3753 ! |
|
3754 |
|
3755 closeRequest |
|
3756 (self confirm:(resources string:'really close %1 ?' with:self class name)) ifTrue:[ |
|
3757 super closeRequest |
|
3758 ] |
|
3759 ! |
|
3760 |
|
3761 focusSequence |
|
3762 ^ (Array with:myMenu) |
|
3763 , |
|
3764 (buttonPanel subViews select:[:element | element isKindOf:Button]) |
|
3765 "/ , (Array with:Transcript) |
|
3766 ! |
|
3767 |
|
3768 openInterface |
|
3769 "sent by my superclass to open up my interface" |
|
3770 |
|
3771 |top icn w scrn sz| |
|
3772 |
|
3773 "/ if there is already a transcript on my device, |
|
3774 "/ I am a slave launcher with limited functionality. |
|
3775 |
|
3776 Transcript notNil ifTrue:[ |
|
3777 Transcript ~~ Stderr ifTrue:[ |
|
3778 isMainLauncher := (Transcript graphicsDevice == device). |
|
3779 ] ifFalse:[ |
|
3780 isMainLauncher := true |
|
3781 ] |
|
3782 ] ifFalse:[ |
|
3783 isMainLauncher := true |
|
3784 ]. |
|
3785 |
|
3786 top := StandardSystemView onDevice:device. |
|
3787 top label:'Smalltalk/X'; iconLabel:'ST/X Launcher'. |
|
3788 top extent:(400@300 ). |
|
3789 |
|
3790 icn := self class aboutIcon. |
|
3791 icn notNil ifTrue:[ |
|
3792 icn := icn magnifiedTo:(sz := Screen current preferredIconSize). |
|
3793 ]. |
|
3794 |
|
3795 ((scrn := Screen current) supportsDeepIcons not |
|
3796 and:[scrn supportsIconViews |
|
3797 and:[scrn depth > 1]]) ifTrue:[ |
|
3798 w := View extent:sz. |
|
3799 w viewBackground:icn. |
|
3800 top iconView:w |
|
3801 ] ifFalse:[ |
|
3802 top icon:icn. |
|
3803 ]. |
|
3804 |
|
3805 "/ (scrn := Screen current) supportsDeepIcons ifTrue:[ |
|
3806 "/ icn := self class aboutIcon. |
|
3807 "/ icn notNil ifTrue:[ |
|
3808 "/ icn := icn magnifiedTo:(sz := scrn preferredIconSize). |
|
3809 "/ icn := Depth8Image fromImage:icn. |
|
3810 "/ top icon:icn |
|
3811 "/ ]. |
|
3812 |
|
3813 "/ ] ifFalse:[ |
|
3814 "/ scrn supportsIconViews ifTrue:[ |
|
3815 "/ icn := self class aboutIcon. |
|
3816 "/ icn notNil ifTrue:[ |
|
3817 "/ icn := icn magnifiedTo:(sz := scrn preferredIconSize). |
|
3818 "/ w := View extent:sz. |
|
3819 "/ w viewBackground:icn. |
|
3820 "/ top iconView:w |
|
3821 "/ ]. |
|
3822 "/ ] |
|
3823 "/ ]. |
|
3824 |
|
3825 self setupViewsIn:top. |
|
3826 |
|
3827 top application:self. |
|
3828 |
|
3829 " |
|
3830 open with higher prio to allow interaction even while things |
|
3831 are running ... |
|
3832 " |
|
3833 top openWithPriority:(Processor userSchedulingPriority + 1). |
|
3834 |
|
3835 OpenLaunchers isNil ifTrue:[ |
|
3836 OpenLaunchers := OrderedCollection new. |
|
3837 ]. |
|
3838 OpenLaunchers add:self. |
|
3839 |
|
3840 "Modified: 25.7.1996 / 21:12:09 / cg" |
|
3841 ! |
|
3842 |
|
3843 release |
|
3844 infoProcess notNil ifTrue:[ |
|
3845 infoProcess terminate. |
|
3846 infoProcess := nil. |
|
3847 ]. |
|
3848 OpenLaunchers remove:self ifAbsent:nil. |
|
3849 super release |
|
3850 |
|
3851 "Modified: 5.7.1996 / 11:48:56 / cg" |
|
3852 ! |
|
3853 |
|
3854 restarted |
|
3855 "image restart - since WindowGroup recreates the process with |
|
3856 the default priority, we have to raise the prio again. |
|
3857 Mhmh - this looks like a bug to me ... |
|
3858 Also, the cursor (which was stored as a write or waitCursor) must |
|
3859 be reset to normal." |
|
3860 |
|
3861 Processor activeProcess priority:(Processor userSchedulingPriority + 1). |
|
3862 |
|
3863 super restarted |
|
3864 |
|
3865 "Modified: 1.6.1996 / 16:58:25 / cg" |
|
3866 ! |
|
3867 |
|
3868 saveAndTerminateRequest |
|
3869 "some windowManagers can send this, to shutDown an application |
|
3870 but let it save its state before, for later restart. |
|
3871 Although I have not yet encountered such a windowManager, |
|
3872 we are already prepared for this ;-)" |
|
3873 |
|
3874 self snapshot. |
|
3875 super saveAndTerminateRequest |
|
3876 |
|
3877 "Created: 5.7.1996 / 13:07:45 / cg" |
|
3878 "Modified: 5.7.1996 / 13:08:55 / cg" |
|
3879 ! |
|
3880 |
|
3881 setupButtonPanelIn:aTopView |
|
3882 "create the buttonPanel" |
|
3883 |
|
3884 |spc mh buttonSize| |
|
3885 |
|
3886 spc := View viewSpacing // 2. |
|
3887 buttonPanel := HorizontalPanelView in:aTopView. |
|
3888 buttonPanel level:-1; borderWidth:0. |
|
3889 buttonPanel horizontalLayout:#leftSpace. |
|
3890 |
|
3891 buttonSize := self class buttonImageSize. |
|
3892 |
|
3893 "/ |
|
3894 "/ the buttonSpec is a collection of: |
|
3895 "/ #( selector iconFileName ) |
|
3896 "/ or: |
|
3897 "/ #( selector (className iconQuerySelector) ) |
|
3898 "/ or" |
|
3899 "/ #( nil ) |
|
3900 "/ |
|
3901 self buttonPanelSpec do:[:entry | |
|
3902 |sel b sep img iconSpec| |
|
3903 |
|
3904 sel := entry at:1. |
|
3905 sel isNil ifTrue:[ |
|
3906 sep := View in:buttonPanel. |
|
3907 sep extent:32@1; borderWidth:0. |
|
3908 ] ifFalse:[ |
|
3909 b := Button in:buttonPanel. |
|
3910 iconSpec := entry at:2. |
|
3911 iconSpec isArray ifTrue:[ |
|
3912 img := (Smalltalk classNamed:(iconSpec at:1)) perform:(iconSpec at:2). |
|
3913 ] ifFalse:[ |
|
3914 img := Image fromFile:iconSpec. |
|
3915 ]. |
|
3916 (img notNil and:[buttonSize notNil]) ifTrue:[ |
|
3917 img extent ~= buttonSize ifTrue:[ |
|
3918 img := img magnifiedTo:buttonSize |
|
3919 ] |
|
3920 ]. |
|
3921 b form:img. |
|
3922 b model:self; changeMessage:sel |
|
3923 ] |
|
3924 ]. |
|
3925 |
|
3926 mh := myMenu height. |
|
3927 buttonPanel origin:0.0 @ (mh + spc) |
|
3928 corner:(1.0 @ (mh + spc + buttonPanel preferredExtent y)). |
|
3929 |
|
3930 buttonPanel leftInset:spc; rightInset:spc. |
|
3931 |
|
3932 "Modified: 29.5.1996 / 19:23:04 / cg" |
|
3933 ! |
|
3934 |
|
3935 setupInfoViewIn:topView |
|
3936 "create the infoView" |
|
3937 |
|
3938 |spc halfSpc| |
|
3939 |
|
3940 spc := View viewSpacing. |
|
3941 infoView := Label label:'' in:topView. |
|
3942 infoView adjust:#left; borderWidth:0. |
|
3943 infoView level:-1. |
|
3944 transcript superView bottomInset:(infoView height + spc). |
|
3945 |
|
3946 infoView is3D ifTrue:[ |
|
3947 halfSpc := spc // 2. |
|
3948 ] ifFalse:[ |
|
3949 halfSpc := 0 |
|
3950 ]. |
|
3951 infoView topInset:(infoView height negated - spc + transcript borderWidth); |
|
3952 bottomInset:halfSpc; |
|
3953 leftInset:halfSpc; |
|
3954 rightInset:halfSpc. |
|
3955 infoView origin:0.0 @ 1.0 corner:1.0 @ 1.0. |
|
3956 infoView model:self; aspect:#info; labelMessage:#info. |
|
3957 |
|
3958 Project notNil ifTrue:[ |
|
3959 Project addDependent:self. |
|
3960 ] |
|
3961 |
|
3962 " |
|
3963 Launcher open |
|
3964 " |
|
3965 |
|
3966 "Modified: 9.9.1996 / 22:44:15 / stefan" |
|
3967 "Modified: 8.1.1997 / 14:58:22 / cg" |
|
3968 ! |
|
3969 |
|
3970 setupOtherViewsIn:aTopView |
|
3971 "a hook - allows redefinition in your personal subclass. |
|
3972 For example, add a clock:" |
|
3973 |
|
3974 " |
|
3975 |sz clock space halfSpace| |
|
3976 |
|
3977 sz := buttonPanel innerHeight - (buttonPanel level abs*2). |
|
3978 space := View viewSpacing. |
|
3979 halfSpace := space // 2. |
|
3980 |
|
3981 buttonPanel rightInset:sz+(space * 2). |
|
3982 |
|
3983 clock := ClockView in:buttonPanel topView. |
|
3984 clock borderWidth:1. |
|
3985 clock showSeconds:false. |
|
3986 clock extent:(sz @ sz). |
|
3987 clock origin:(1.0 @ (buttonPanel origin y + halfSpace)). |
|
3988 clock leftInset:sz negated - 2 - halfSpace. |
|
3989 clock rightInset:halfSpace. |
|
3990 clock level:1. |
|
3991 " |
3744 ! |
3992 ! |
3745 |
3993 |
3746 setupTranscriptIn:aView |
3994 setupTranscriptIn:aView |
|
3995 "create the transcript view" |
|
3996 |
3747 |v launcher| |
3997 |v launcher| |
3748 |
3998 |
3749 "/ check if this is an additional launcher on a remote display. |
3999 "/ check if this is an additional launcher on a remote display. |
3750 "/ if so, do not close the real launcher. |
4000 "/ if so, do not close the real launcher. |
3751 |
4001 |
3815 "Modified: 9.9.1996 / 22:44:31 / stefan" |
4065 "Modified: 9.9.1996 / 22:44:31 / stefan" |
3816 ! ! |
4066 ! ! |
3817 |
4067 |
3818 !Launcher methodsFor:'private'! |
4068 !Launcher methodsFor:'private'! |
3819 |
4069 |
|
4070 findWindow |
|
4071 "a helper for find & destroy and find & raise operations; |
|
4072 let user choose a view and return it; return nil on cancel" |
|
4073 |
|
4074 |knownTopViews nameList box| |
|
4075 |
|
4076 knownTopViews := IdentitySet new. |
|
4077 Screen allScreens do:[:aScreen | |
|
4078 aScreen knownViews do:[:aView | |
|
4079 aView notNil ifTrue:[ |
|
4080 knownTopViews add:aView topView |
|
4081 ] |
|
4082 ] |
|
4083 ]. |
|
4084 |
|
4085 knownTopViews := knownTopViews select:[:aView | aView windowGroup notNil |
|
4086 and:[aView windowGroup isModal not]]. |
|
4087 |
|
4088 knownTopViews := knownTopViews asOrderedCollection. |
|
4089 knownTopViews sort:[:v1 :v2 | v1 label < v2 label]. |
|
4090 nameList := knownTopViews collect:[:v | |
|
4091 |isDead wg p| |
|
4092 |
|
4093 ((wg := v windowGroup) notNil |
|
4094 and:[(p := wg process) notNil |
|
4095 and:[p state ~~ #dead]]) ifTrue:[ |
|
4096 v label |
|
4097 ] ifFalse:[ |
|
4098 v label , ' (dead ?)' |
|
4099 ] |
|
4100 ]. |
|
4101 |
|
4102 box := ListSelectionBox new. |
|
4103 box noEnterField. |
|
4104 box list:nameList. |
|
4105 box label:(resources string:'view selection'). |
|
4106 box title:(resources string:'select a view to raise deiconified:') withCRs. |
|
4107 box action:[:selection | |
|
4108 |v| |
|
4109 |
|
4110 v := knownTopViews at:box selectionIndex. |
|
4111 box destroy. |
|
4112 ^ v |
|
4113 ]. |
|
4114 box extent:400@300. |
|
4115 box showAtPointer. |
|
4116 ^ nil |
|
4117 |
|
4118 "Modified: 16.10.1996 / 12:41:39 / cg" |
|
4119 "Created: 28.10.1996 / 14:38:41 / cg" |
|
4120 ! |
|
4121 |
3820 fontBoxForEncoding:encodingMatch |
4122 fontBoxForEncoding:encodingMatch |
|
4123 "open a fontBox, showing fonts which match some encoding |
|
4124 (used when changing to japanese ...)" |
|
4125 |
3821 |box y b |
4126 |box y b |
3822 labelDef buttonDef listDef menuDef textDef |
4127 labelDef buttonDef listDef menuDef textDef |
3823 models labels allOfThem filter| |
4128 models labels allOfThem filter| |
3824 |
4129 |
3825 encodingMatch notNil ifTrue:[ |
4130 encodingMatch notNil ifTrue:[ |