Launcher.st
changeset 921 0189f3d732e2
parent 920 2b66e8759af5
child 922 c72dae45cf15
equal deleted inserted replaced
920:2b66e8759af5 921:0189f3d732e2
    71 
    71 
    72     adding an entry to a menu:
    72     adding an entry to a menu:
    73 
    73 
    74         see the #setupMenu method; either add another top-menu, or
    74         see the #setupMenu method; either add another top-menu, or
    75         add entries to an existing menu.
    75         add entries to an existing menu.
       
    76         All menu setup has been extracted into separate init-methods,
       
    77         so there is often only a need to redefine one of those
       
    78         (for example, to add your own demos, only redefine setupDemoMenu).
       
    79         To add a new master-item with its own pullDown, redefine setupMainMenu
       
    80         to include another selector and add the correspoonding menu there.
    76 "
    81 "
    77 !
    82 !
    78 
    83 
    79 documentation
    84 documentation
    80 "
    85 "
    83 
    88 
    84     Also, this app makes first use of the new compatibility framework;
    89     Also, this app makes first use of the new compatibility framework;
    85     you will notice, that this is a subclass of ApplicationModel.
    90     you will notice, that this is a subclass of ApplicationModel.
    86     New applications will no longer be built as subclasses of standardSystemView.
    91     New applications will no longer be built as subclasses of standardSystemView.
    87 
    92 
       
    93     See #customization for information regarding your own private
       
    94     launcher functions.
       
    95 
    88     [author:]
    96     [author:]
    89         Claus Gittinger
    97         Claus Gittinger
       
    98 
       
    99     [see also:]
       
   100         Examples_misc::MyLauncher
       
   101 
       
   102     [start with:]
       
   103         Launcher open
    90 "
   104 "
    91 ! !
   105 ! !
    92 
   106 
    93 !Launcher class methodsFor:'accessing'!
   107 !Launcher class methodsFor:'accessing'!
    94 
   108 
   112 ! !
   126 ! !
   113 
   127 
   114 !Launcher class methodsFor:'defaults'!
   128 !Launcher class methodsFor:'defaults'!
   115 
   129 
   116 aboutIcon
   130 aboutIcon
       
   131     "return the icon shown in the about menu-item and used
       
   132      as ST/X about icon"
       
   133 
   117     |image|
   134     |image|
   118 
   135 
   119     CachedAboutIcon notNil ifTrue:[^ CachedAboutIcon].
   136     CachedAboutIcon notNil ifTrue:[^ CachedAboutIcon].
   120 
   137 
   121     image := Image fromFile:'SmalltalkX.xbm'.
   138     image := Image fromFile:'SmalltalkX.xbm'.
   142     "
   159     "
   143      CachedAboutIcon := nil.
   160      CachedAboutIcon := nil.
   144      Launcher aboutIcon
   161      Launcher aboutIcon
   145     "
   162     "
   146 
   163 
   147     "Modified: 28.5.1996 / 20:55:15 / cg"
       
   148     "Modified: 9.9.1996 / 22:41:23 / stefan"
   164     "Modified: 9.9.1996 / 22:41:23 / stefan"
       
   165     "Modified: 8.1.1997 / 15:01:30 / cg"
   149 !
   166 !
   150 
   167 
   151 buttonImageSize
   168 buttonImageSize
   152     "images in buttonPanel are sized to this.
   169     "images in buttonPanel are sized to this.
   153      Can be redefined in subclasses to return nil (no scaling)
   170      Can be redefined in subclasses to return nil (no scaling)
   157 
   174 
   158     "Modified: 19.4.1996 / 16:36:17 / cg"
   175     "Modified: 19.4.1996 / 16:36:17 / cg"
   159 !
   176 !
   160 
   177 
   161 notifyingEmergencyHandler
   178 notifyingEmergencyHandler
       
   179     "return a block (used as an emergency handler
       
   180      for exceptions), which does errorNotification before going
       
   181      into the debugger."
       
   182 
   162     NotifyingEmergencyHandler isNil ifTrue:[
   183     NotifyingEmergencyHandler isNil ifTrue:[
   163         NotifyingEmergencyHandler := [:ex | nil errorNotify:ex errorString ]
   184         NotifyingEmergencyHandler := [:ex | nil errorNotify:ex errorString ]
   164     ].
   185     ].
   165     ^ NotifyingEmergencyHandler
   186     ^ NotifyingEmergencyHandler
   166 
   187 
   167     "Created: 7.1.1997 / 22:18:19 / cg"
   188     "Created: 7.1.1997 / 22:18:19 / cg"
       
   189     "Modified: 8.1.1997 / 15:02:46 / cg"
   168 !
   190 !
   169 
   191 
   170 smallAboutIcon
   192 smallAboutIcon
       
   193     "return the icon shown in the about menu-item"
       
   194 
   171     |image|
   195     |image|
   172 
   196 
   173     image := self aboutIcon.
   197     image := self aboutIcon.
   174     image notNil ifTrue:[
   198     image notNil ifTrue:[
   175         image := image magnifiedBy:0.4.
   199         image := image magnifiedBy:0.4.
   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:[
   230 other HTML viewer to see the documentation.
   264 other HTML viewer to see the documentation.
   231 
   265 
   232 The documentation is found in the ''doc/online'' directory.'.
   266 The documentation is found in the ''doc/online'' directory.'.
   233 
   267 
   234     "Modified: 31.8.1995 / 13:11:08 / claus"
   268     "Modified: 31.8.1995 / 13:11:08 / claus"
   235     "Modified: 21.5.1996 / 14:15:57 / cg"
   269     "Modified: 8.1.1997 / 14:42:42 / cg"
   236 !
   270 !
   237 
   271 
   238 showLicenceConditions
   272 showLicenceConditions
       
   273     "open an HTML browser on the 'LICENCE' document"
       
   274 
   239     |lang doc|
   275     |lang doc|
   240 
   276 
   241     ((lang := Smalltalk language) = 'de'
   277     ((lang := Smalltalk language) = 'de'
   242     or:[lang = 'german']) ifTrue:[
   278     or:[lang = 'german']) ifTrue:[
   243         doc := 'german/LICENCE.STX.html'
   279         doc := 'german/LICENCE.STX.html'
   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
   731     box open.
   843     box open.
   732 
   844 
   733     box destroy.
   845     box destroy.
   734 
   846 
   735     "Modified: 17.9.1995 / 16:47:50 / claus"
   847     "Modified: 17.9.1995 / 16:47:50 / claus"
   736     "Modified: 1.11.1996 / 16:36:14 / cg"
   848     "Modified: 8.1.1997 / 14:50:15 / cg"
   737 !
   849 !
   738 
   850 
   739 snapshot
   851 snapshot
       
   852     "saves a snapshot image, after asking for a fileName"
       
   853 
   740     |fileName|
   854     |fileName|
   741 
   855 
   742     fileName := DialogBox
   856     fileName := DialogBox
   743                     request:(resources at:'filename for image:') withCRs
   857                     request:(resources at:'filename for image:') withCRs
   744               initialAnswer:(ObjectMemory nameForSnapshot) 
   858               initialAnswer:(ObjectMemory nameForSnapshot) 
   758         ] valueNowOrOnUnwindDo:[
   872         ] valueNowOrOnUnwindDo:[
   759             self restoreCursors.
   873             self restoreCursors.
   760         ].
   874         ].
   761     ].
   875     ].
   762 
   876 
   763     "Modified: 1.6.1996 / 17:02:45 / cg"
   877     "Modified: 8.1.1997 / 14:50:29 / cg"
   764 !
   878 !
   765 
   879 
   766 snapshotAndExit
   880 snapshotAndExit
       
   881     "saves a snapshot image and exits, after asking for a fileName"
       
   882 
   767     |fileName ok|
   883     |fileName ok|
   768 
   884 
   769     fileName := DialogBox
   885     fileName := DialogBox
   770                     request:(resources at:'filename for image:') withCRs
   886                     request:(resources at:'filename for image:') withCRs
   771               initialAnswer:(ObjectMemory nameForSnapshot) 
   887               initialAnswer:(ObjectMemory nameForSnapshot) 
   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.
   868         ].
  1002         ].
   869         box showAtPointer.
  1003         box showAtPointer.
   870         box destroy
  1004         box destroy
   871     ]
  1005     ]
   872 
  1006 
   873     "Modified: 5.7.1996 / 13:12:53 / cg"
  1007     "Modified: 8.1.1997 / 14:52:20 / cg"
   874 ! !
  1008 ! !
   875 
  1009 
   876 !Launcher methodsFor:'actions - settings'!
  1010 !Launcher methodsFor:'actions - settings'!
   877 
  1011 
   878 compilerSettings
  1012 compilerSettings
       
  1013     "open a dialog on compiler related settings"
       
  1014 
   879     |box warnings warnSTX warnUnderscore warnOldStyle allowUnderscore immutableArrays
  1015     |box warnings warnSTX warnUnderscore warnOldStyle allowUnderscore immutableArrays
   880      warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox
  1016      warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox
   881      stcCompilation compilationList stcCompilationOptions stcIncludes stcDefines stcOptions
  1017      stcCompilation compilationList stcCompilationOptions stcIncludes stcDefines stcOptions
   882      stcLibraries stcLibraryPath cc ccOptions historyLines catchRedefs keepSourceOptions keepSource  
  1018      stcLibraries stcLibraryPath cc ccOptions historyLines catchRedefs keepSourceOptions keepSource  
   883      constantFoldingOptions constantFolding justInTimeCompilation fullSingleStep
  1019      constantFoldingOptions constantFolding justInTimeCompilation fullSingleStep
  1183     ].
  1319     ].
  1184     box destroy
  1320     box destroy
  1185 
  1321 
  1186     "Modified: 10.9.1995 / 19:19:18 / claus"
  1322     "Modified: 10.9.1995 / 19:19:18 / claus"
  1187     "Modified: 9.9.1996 / 22:42:47 / stefan"
  1323     "Modified: 9.9.1996 / 22:42:47 / stefan"
  1188     "Modified: 5.11.1996 / 18:00:06 / cg"
  1324     "Modified: 8.1.1997 / 14:52:36 / cg"
  1189 !
  1325 !
  1190 
  1326 
  1191 displaySettings
  1327 displaySettings
       
  1328     "open a dialog on display related settings"
       
  1329 
  1192     |box 
  1330     |box 
  1193      sizes sizeNames sizeList sizeX sizeY deepIcons
  1331      sizes sizeNames sizeList sizeX sizeY deepIcons
  1194      isColorMonitor useFixPalette idx ditherStyles ditherSyms ditherList
  1332      isColorMonitor useFixPalette idx ditherStyles ditherSyms ditherList
  1195      y component screen visual|
  1333      y component screen visual|
  1196 
  1334 
  1348         ].
  1486         ].
  1349     ].
  1487     ].
  1350     box destroy
  1488     box destroy
  1351 
  1489 
  1352     "Modified: 9.9.1996 / 22:43:04 / stefan"
  1490     "Modified: 9.9.1996 / 22:43:04 / stefan"
  1353     "Modified: 30.9.1996 / 23:25:22 / cg"
  1491     "Modified: 8.1.1997 / 14:52:42 / cg"
  1354 !
  1492 !
  1355 
  1493 
  1356 fontSettings
  1494 fontSettings
       
  1495     "open a dialog on font related settings"
       
  1496 
  1357     (self fontBoxForEncoding:nil) ifTrue:[
  1497     (self fontBoxForEncoding:nil) ifTrue:[
  1358         self reopenLauncher.
  1498         self reopenLauncher.
  1359     ]
  1499     ]
  1360 
  1500 
  1361     "Created: 26.2.1996 / 22:52:51 / cg"
  1501     "Created: 26.2.1996 / 22:52:51 / cg"
  1362     "Modified: 27.2.1996 / 02:05:05 / cg"
  1502     "Modified: 8.1.1997 / 14:52:49 / cg"
  1363 !
  1503 !
  1364 
  1504 
  1365 keyboardSetting 
  1505 keyboardSetting 
       
  1506     "open a dialog on keyboard related settings"
       
  1507 
  1366     |mappings listOfRawKeys listOfFunctions
  1508     |mappings listOfRawKeys listOfFunctions
  1367      box l
  1509      box l
  1368      list1 list2 listView1 listView2 
  1510      list1 list2 listView1 listView2 
  1369      frame selectionForwarder macroForwarder macroTextView y|
  1511      frame selectionForwarder macroForwarder macroTextView y|
  1370 
  1512 
  1489     box accepted ifTrue:[
  1631     box accepted ifTrue:[
  1490         "no action yet ..."
  1632         "no action yet ..."
  1491     ].
  1633     ].
  1492     box destroy
  1634     box destroy
  1493 
  1635 
  1494     "Modified: 31.5.1996 / 22:55:51 / cg"
       
  1495     "Modified: 9.9.1996 / 22:43:17 / stefan"
  1636     "Modified: 9.9.1996 / 22:43:17 / stefan"
       
  1637     "Modified: 8.1.1997 / 14:52:55 / cg"
  1496 !
  1638 !
  1497 
  1639 
  1498 languageSetting 
  1640 languageSetting 
       
  1641     "open a dialog on language related settings"
       
  1642 
  1499     |listOfLanguages translatedLanguages switch box|
  1643     |listOfLanguages translatedLanguages switch box|
  1500 
  1644 
  1501     "
  1645     "
  1502      get list of supported languages from the launchers resources ...
  1646      get list of supported languages from the launchers resources ...
  1503     "
  1647     "
  1574         addHelpButtonFor:'Launcher/languageSetting.html'.
  1718         addHelpButtonFor:'Launcher/languageSetting.html'.
  1575     box open.
  1719     box open.
  1576     box destroy
  1720     box destroy
  1577 
  1721 
  1578     "Modified: 9.9.1996 / 22:43:27 / stefan"
  1722     "Modified: 9.9.1996 / 22:43:27 / stefan"
  1579     "Modified: 18.10.1996 / 15:09:16 / cg"
  1723     "Modified: 8.1.1997 / 14:53:01 / cg"
  1580 !
  1724 !
  1581 
  1725 
  1582 memorySettings
  1726 memorySettings
       
  1727     "open a dialog on objectMemory related settings"
       
  1728 
  1583     |box igcLimit igcFreeLimit igcFreeAmount newSpaceSize
  1729     |box igcLimit igcFreeLimit igcFreeAmount newSpaceSize
  1584      compressLimit
  1730      compressLimit
  1585      oldIncr component fields codeLimit codeTrigger|
  1731      oldIncr component fields codeLimit codeTrigger|
  1586 
  1732 
  1587     "/
  1733     "/
  1755         ObjectMemory dynamicCodeLimit:codeLimit value.
  1901         ObjectMemory dynamicCodeLimit:codeLimit value.
  1756         ObjectMemory dynamicCodeGCTrigger:codeTrigger value.
  1902         ObjectMemory dynamicCodeGCTrigger:codeTrigger value.
  1757     ].
  1903     ].
  1758     box destroy
  1904     box destroy
  1759 
  1905 
  1760     "Modified: 17.10.1996 / 20:21:16 / cg"
  1906     "Modified: 8.1.1997 / 14:53:07 / cg"
  1761 !
  1907 !
  1762 
  1908 
  1763 messageSettings
  1909 messageSettings
       
  1910     "open a dialog on infoMessage related settings"
       
  1911 
  1764     |box vmInfo vmErrors displayErrors classInfos|
  1912     |box vmInfo vmErrors displayErrors classInfos|
  1765 
  1913 
  1766     vmInfo := ObjectMemory infoPrinting asValue.
  1914     vmInfo := ObjectMemory infoPrinting asValue.
  1767     vmErrors := ObjectMemory debugPrinting asValue.
  1915     vmErrors := ObjectMemory debugPrinting asValue.
  1768     classInfos := Object infoPrinting asValue.
  1916     classInfos := Object infoPrinting asValue.
  1788         Object infoPrinting:classInfos value.
  1936         Object infoPrinting:classInfos value.
  1789         DeviceWorkstation errorPrinting:displayErrors value.
  1937         DeviceWorkstation errorPrinting:displayErrors value.
  1790     ].
  1938     ].
  1791     box destroy
  1939     box destroy
  1792 
  1940 
  1793     "Modified: 29.5.1996 / 14:16:19 / cg"
  1941     "Modified: 8.1.1997 / 14:53:14 / cg"
  1794 !
  1942 !
  1795 
  1943 
  1796 miscSettings
  1944 miscSettings
       
  1945     "open a dialog on misc other settings"
       
  1946 
  1797     |box check logDoits shadows updChanges changeFileName returnFocus
  1947     |box check logDoits shadows updChanges changeFileName returnFocus
  1798      loadBinaries compileLazy hostNameInLabel useManager hasManager 
  1948      loadBinaries compileLazy hostNameInLabel useManager hasManager 
  1799      repository repositoryHolder localSourceFirst 
  1949      repository repositoryHolder localSourceFirst 
  1800      showAccelerators sourceCacheDir cacheEntry
  1950      showAccelerators sourceCacheDir cacheEntry
  1801      component localCheck oldIndent nm fn manager
  1951      component localCheck oldIndent nm fn manager
  1978         ]
  2128         ]
  1979     ].
  2129     ].
  1980     box destroy
  2130     box destroy
  1981 
  2131 
  1982     "Modified: 9.9.1996 / 22:43:36 / stefan"
  2132     "Modified: 9.9.1996 / 22:43:36 / stefan"
  1983     "Modified: 7.1.1997 / 22:22:19 / cg"
  2133     "Modified: 8.1.1997 / 14:53:22 / cg"
  1984 !
  2134 !
  1985 
  2135 
  1986 printerSettings
  2136 printerSettings
       
  2137     "open a dialog on printer related settings"
       
  2138 
  1987     |box 
  2139     |box 
  1988      possiblePrinters possibleTypes printerType printCommand 
  2140      possiblePrinters possibleTypes printerType printCommand 
  1989      pageFormat landscape updater
  2141      pageFormat landscape updater
  1990      formatLabel formatComponent landscapeLabel landscapeComponent
  2142      formatLabel formatComponent landscapeLabel landscapeComponent
  1991      topMargin leftMargin rightMargin bottomMargin unitList unit
  2143      topMargin leftMargin rightMargin bottomMargin unitList unit
  2249             Printer supportsColor:supportsColor value.
  2401             Printer supportsColor:supportsColor value.
  2250         ].
  2402         ].
  2251     ].
  2403     ].
  2252     box destroy
  2404     box destroy
  2253 
  2405 
  2254     "Modified: 5.9.1996 / 21:45:19 / cg"
       
  2255     "Modified: 9.9.1996 / 22:43:51 / stefan"
  2406     "Modified: 9.9.1996 / 22:43:51 / stefan"
       
  2407     "Modified: 8.1.1997 / 14:53:31 / cg"
  2256 !
  2408 !
  2257 
  2409 
  2258 restoreSettings
  2410 restoreSettings
       
  2411     "restore settings from a settings-file."
       
  2412 
  2259     "a temporary kludge - we need a central systemSettings object for this,
  2413     "a temporary kludge - we need a central systemSettings object for this,
  2260      which can be saved/restored with a single store/read."
  2414      which can be saved/restored with a single store/read."
  2261 
  2415 
  2262     |fileName|
  2416     |fileName|
  2263 
  2417 
  2278         Smalltalk fileIn:fileName.
  2432         Smalltalk fileIn:fileName.
  2279 
  2433 
  2280         self reopenLauncher.
  2434         self reopenLauncher.
  2281     ].
  2435     ].
  2282 
  2436 
  2283     "Modified: 9.11.1996 / 01:53:21 / cg"
  2437     "Modified: 8.1.1997 / 14:53:52 / cg"
  2284 !
  2438 !
  2285 
  2439 
  2286 saveSettings
  2440 saveSettings
       
  2441     "save settings to a settings-file."
       
  2442 
  2287     "a temporary kludge - we need a central systemSettings object for this,
  2443     "a temporary kludge - we need a central systemSettings object for this,
  2288      which can be saved/restored with a single store/read."
  2444      which can be saved/restored with a single store/read."
  2289 
  2445 
  2290     |s screen fileName|
  2446     |s screen fileName|
  2291 
  2447 
  2457 
  2613 
  2458     "
  2614     "
  2459      Transcript topView application saveSettings
  2615      Transcript topView application saveSettings
  2460     "
  2616     "
  2461 
  2617 
  2462     "Modified: 7.1.1997 / 22:24:51 / cg"
  2618     "Modified: 8.1.1997 / 14:54:00 / cg"
  2463 !
  2619 !
  2464 
  2620 
  2465 viewStyleSetting 
  2621 viewStyleSetting 
       
  2622     "open a dialog on viewStyle related settings"
       
  2623 
  2466     |listOfStyles resourceDir dir box 
  2624     |listOfStyles resourceDir dir box 
  2467      list listView scrView infoLabel infoForwarder newStyle|
  2625      list listView scrView infoLabel infoForwarder newStyle|
  2468 
  2626 
  2469     "
  2627     "
  2470      search resources directory for a list of .style files ...
  2628      search resources directory for a list of .style files ...
  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."
  2641 
  2755 
  2642     "Modified: 23.9.1996 / 14:36:14 / cg"
  2756     "Modified: 23.9.1996 / 14:36:14 / cg"
  2643 !
  2757 !
  2644 
  2758 
  2645 garbageCollect
  2759 garbageCollect
       
  2760     "perform a non-compressing garbageCollect"
       
  2761 
  2646     ObjectMemory reclaimSymbols
  2762     ObjectMemory reclaimSymbols
  2647 
  2763 
  2648     "Created: 12.5.1996 / 15:28:03 / cg"
  2764     "Created: 12.5.1996 / 15:28:03 / cg"
       
  2765     "Modified: 8.1.1997 / 14:54:29 / cg"
  2649 !
  2766 !
  2650 
  2767 
  2651 globalGarbageCollect
  2768 globalGarbageCollect
       
  2769     "perform a non-compressing garbageCollect"
       
  2770 
  2652     ObjectMemory reclaimSymbols
  2771     ObjectMemory reclaimSymbols
  2653 
  2772 
  2654     "Created: 12.5.1996 / 15:28:13 / cg"
  2773     "Created: 12.5.1996 / 15:28:13 / cg"
       
  2774     "Modified: 8.1.1997 / 14:54:36 / cg"
  2655 !
  2775 !
  2656 
  2776 
  2657 removeAllBreakAndTracePoints
  2777 removeAllBreakAndTracePoints
       
  2778     "remove all break- and trace points"
       
  2779 
  2658     MessageTracer cleanup
  2780     MessageTracer cleanup
       
  2781 
       
  2782     "Modified: 8.1.1997 / 14:55:27 / cg"
  2659 !
  2783 !
  2660 
  2784 
  2661 screenHardcopy
  2785 screenHardcopy
  2662     "after a second (to allow redraw of views under menu ...),
  2786     "after a second (to allow redraw of views under menu ...),
  2663      let user specify a rectangular area on the screen
  2787      let user specify a rectangular area on the screen
  2676 
  2800 
  2677     "Modified: 23.9.1996 / 14:36:28 / cg"
  2801     "Modified: 23.9.1996 / 14:36:28 / cg"
  2678 !
  2802 !
  2679 
  2803 
  2680 startEventMonitor
  2804 startEventMonitor
       
  2805     "open an eventMonitor view"
       
  2806 
  2681     EventMonitor open
  2807     EventMonitor open
       
  2808 
       
  2809     "Modified: 8.1.1997 / 14:55:40 / cg"
  2682 !
  2810 !
  2683 
  2811 
  2684 startFullWindowTreeView
  2812 startFullWindowTreeView
       
  2813     "open a windowTree view (on all views)"
       
  2814 
  2685     WindowTreeView open
  2815     WindowTreeView open
       
  2816 
       
  2817     "Modified: 8.1.1997 / 14:56:04 / cg"
  2686 !
  2818 !
  2687 
  2819 
  2688 startMemoryMonitor
  2820 startMemoryMonitor
       
  2821     "open a memoryMonitor view"
       
  2822 
  2689     MemoryMonitor open
  2823     MemoryMonitor open
       
  2824 
       
  2825     "Modified: 8.1.1997 / 14:56:14 / cg"
  2690 !
  2826 !
  2691 
  2827 
  2692 startMemoryUsageView
  2828 startMemoryUsageView
       
  2829     "open a memoryUsage view"
       
  2830 
  2693     MemoryUsageView open
  2831     MemoryUsageView open
       
  2832 
       
  2833     "Modified: 8.1.1997 / 14:56:21 / cg"
  2694 !
  2834 !
  2695 
  2835 
  2696 startProcessMonitor
  2836 startProcessMonitor
       
  2837     "open a processMonitor view"
       
  2838 
  2697     ProcessMonitor open
  2839     ProcessMonitor open
       
  2840 
       
  2841     "Modified: 8.1.1997 / 14:56:27 / cg"
  2698 !
  2842 !
  2699 
  2843 
  2700 startStopEventTrace
  2844 startStopEventTrace
       
  2845     "start/stop event tracing for a particular view"
       
  2846 
  2701     |v wg|
  2847     |v wg|
  2702 
  2848 
  2703     v := Screen current viewFromUser.
  2849     v := Screen current viewFromUser.
  2704     v notNil ifTrue:[
  2850     v notNil ifTrue:[
  2705         v := v topView.
  2851         v := v topView.
  2711             wg traceEvents:(wg preEventHook isNil)
  2857             wg traceEvents:(wg preEventHook isNil)
  2712         ]
  2858         ]
  2713     ]
  2859     ]
  2714 
  2860 
  2715     "Created: 7.3.1996 / 14:44:22 / cg"
  2861     "Created: 7.3.1996 / 14:44:22 / cg"
  2716     "Modified: 24.4.1996 / 10:27:11 / cg"
  2862     "Modified: 8.1.1997 / 14:56:44 / cg"
  2717 !
  2863 !
  2718 
  2864 
  2719 startWindowTreeView
  2865 startWindowTreeView
       
  2866     "open a windowTree view (on a topView)"
       
  2867 
  2720     |v|
  2868     |v|
  2721 
  2869 
  2722     v := self pickAView.
  2870     v := self pickAView.
  2723     v notNil ifTrue:[
  2871     v notNil ifTrue:[
  2724         WindowTreeView openOn:v topView
  2872         WindowTreeView openOn:v topView
  2725     ]
  2873     ]
       
  2874 
       
  2875     "Modified: 8.1.1997 / 14:55:59 / cg"
  2726 !
  2876 !
  2727 
  2877 
  2728 viewDestroy
  2878 viewDestroy
  2729     "let user pick a view and destroy it.
  2879     "let user pick a view and destroy it.
  2730      Even allow destroying non-smalltalk views
  2880      Even allow destroying non-smalltalk views
  2786 ! !
  2936 ! !
  2787 
  2937 
  2788 !Launcher methodsFor:'change & update'!
  2938 !Launcher methodsFor:'change & update'!
  2789 
  2939 
  2790 update:something with:aParameter from:changedObject
  2940 update:something with:aParameter from:changedObject
       
  2941     "care for project changes & update my infoView"
       
  2942 
  2791     ((something == #currentProject)
  2943     ((something == #currentProject)
  2792     or:[changedObject == Project]) ifTrue:[
  2944     or:[changedObject == Project]) ifTrue:[
  2793         self changed:#info.
  2945         self changed:#info.
  2794         ^ self
  2946         ^ self
  2795     ].
  2947     ].
       
  2948 
       
  2949     "Modified: 8.1.1997 / 14:57:07 / cg"
  2796 ! !
  2950 ! !
  2797 
  2951 
  2798 !Launcher methodsFor:'dynamic menus'!
  2952 !Launcher methodsFor:'dynamic menus'!
  2799 
  2953 
  2800 addMenu:name withItems:items actions:actions
  2954 addMenu:name withItems:items actions:actions
  2891 ! !
  3045 ! !
  2892 
  3046 
  2893 !Launcher methodsFor:'help'!
  3047 !Launcher methodsFor:'help'!
  2894 
  3048 
  2895 helpTextFor:aComponent
  3049 helpTextFor:aComponent
       
  3050     "activeHelp interface: return some help text for a component"
       
  3051 
  2896     |sel s buttons|
  3052     |sel s buttons|
  2897 
  3053 
  2898     aComponent == transcript ifTrue:[
  3054     aComponent == transcript ifTrue:[
  2899         s := 'TRANSCRIPT_HELP'
  3055         s := 'TRANSCRIPT_HELP'
  2900     ].
  3056     ].
  2920     s notNil ifTrue:[
  3076     s notNil ifTrue:[
  2921         ^ resources string:s
  3077         ^ resources string:s
  2922     ].
  3078     ].
  2923     ^ nil
  3079     ^ nil
  2924 
  3080 
  2925     "Modified: 26.2.1996 / 23:08:19 / cg"
  3081     "Modified: 8.1.1997 / 14:57:34 / cg"
  2926 ! !
  3082 ! !
  2927 
  3083 
  2928 !Launcher methodsFor:'infoview update'!
  3084 !Launcher methodsFor:'infoview update'!
  2929 
  3085 
  2930 info
  3086 info
       
  3087     "update the infoView from the current project"
       
  3088 
  2931     |project projectName projectDir packageName defNameSpace msg args|
  3089     |project projectName projectDir packageName defNameSpace msg args|
  2932 
  3090 
  2933     (Project isNil or:[(project := Project current) isNil]) ifTrue:[
  3091     (Project isNil or:[(project := Project current) isNil]) ifTrue:[
  2934         projectName := '* none *'.
  3092         projectName := '* none *'.
  2935         projectDir := '.'.
  3093         projectDir := '.'.
  2959                         with:defNameSpace name.
  3117                         with:defNameSpace name.
  2960     ].
  3118     ].
  2961         
  3119         
  2962     ^ resources string:msg withArgs:args
  3120     ^ resources string:msg withArgs:args
  2963 
  3121 
  2964     "Modified: 2.1.1997 / 20:26:44 / cg"
  3122     "Modified: 8.1.1997 / 14:57:47 / cg"
  2965 !
  3123 !
  2966 
  3124 
  2967 showActivity:someMessage
  3125 showActivity:someMessage
  2968     "some activityNotification to be forwarded to the user;
  3126     "some activityNotification to be forwarded to the user;
  2969      show it in the transcript here."
  3127      show it in the transcript here."
  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:#(
  3361                                         MailView 
  3368                                         MailView 
  3362                                         NewsView
  3369                                         NewsView
  3363                       )
  3370                       )
  3364                 receiver:self).
  3371                 receiver:self).
  3365 
  3372 
  3366     "Modified: 8.1.1997 / 12:30:42 / cg"
  3373     "Modified: 8.1.1997 / 14:04:22 / cg"
  3367 !
  3374 !
  3368 
  3375 
  3369 setupInfoViewIn:topView 
  3376 setupFileMenu
  3370     |spc halfSpc|
  3377     "setup the file- pulldown menu"
  3371 
  3378 
  3372     spc := View viewSpacing.
  3379     |l s|
  3373     infoView := Label label:'' in:topView.
       
  3374     infoView adjust:#left; borderWidth:0.
       
  3375     infoView level:-1.
       
  3376     transcript superView bottomInset:(infoView height + spc).
       
  3377 
       
  3378     infoView is3D ifTrue:[
       
  3379         halfSpc := spc // 2.
       
  3380     ] ifFalse:[
       
  3381         halfSpc := 0
       
  3382     ].
       
  3383     infoView topInset:(infoView height negated - spc + transcript borderWidth);
       
  3384              bottomInset:halfSpc;
       
  3385              leftInset:halfSpc; 
       
  3386              rightInset:halfSpc.
       
  3387     infoView origin:0.0 @ 1.0 corner:1.0 @ 1.0.
       
  3388     infoView model:self; aspect:#info; labelMessage:#info.
       
  3389 
       
  3390     Project notNil ifTrue:[
       
  3391         Project addDependent:self.
       
  3392     ]
       
  3393 
       
  3394     "
       
  3395      Launcher open
       
  3396     "
       
  3397 
       
  3398     "Modified: 9.9.1996 / 22:44:15 / stefan"
       
  3399 !
       
  3400 
       
  3401 setupMenu
       
  3402     "setup the pulldown menu"
       
  3403 
       
  3404     |l s icon|
       
  3405 
       
  3406     myMenu labels:(resources array:#(
       
  3407                                      about
       
  3408                                      file
       
  3409                                      classes
       
  3410                                      tools
       
  3411                                      projects
       
  3412                                      settings
       
  3413                                      demos
       
  3414                                      help)).
       
  3415     "
       
  3416      if there is a bitmap, change 'about' to the ST/X icon
       
  3417     "
       
  3418     icon := self class smallAboutIcon.
       
  3419     icon notNil ifTrue:[
       
  3420         myMenu labels at:1 put:icon.
       
  3421         myMenu height:(myMenu height max:(icon height + (View viewSpacing * 2)))
       
  3422     ].
       
  3423 
       
  3424     myMenu selectors:#(
       
  3425                                      #about
       
  3426                                      #file
       
  3427                                      #classes 
       
  3428                                      #tools 
       
  3429                                      #projects 
       
  3430                                      #settings
       
  3431                                      #demos
       
  3432                                      #help).
       
  3433 
       
  3434     myMenu at:#about 
       
  3435            putLabels:(resources array:#(
       
  3436                                         'about Smalltalk/X ...'
       
  3437                                         '-'
       
  3438                                         'licence conditions'
       
  3439                                        ))
       
  3440            selectors:#(
       
  3441                                         #about 
       
  3442                                         nil
       
  3443                                         #showLicenceConditions 
       
  3444                       )
       
  3445            receiver:self.
       
  3446 
  3380 
  3447     l := #(
  3381     l := #(
  3448                 'file browser'
  3382                 'file browser'
  3449                 '-'
  3383                 '-'
  3450                 'modules ...'
  3384                 'modules ...'
  3466     myMenu at:#file
  3400     myMenu at:#file
  3467            putLabels:(resources array:l)
  3401            putLabels:(resources array:l)
  3468            selectors:s
  3402            selectors:s
  3469            receiver:self.
  3403            receiver:self.
  3470 
  3404 
  3471     myMenu at:#classes 
  3405     "Created: 8.1.1997 / 14:04:15 / cg"
  3472            putLabels:(resources array:#(
  3406 !
  3473                                         'system browser'
  3407 
  3474                                         'class browser ...'
  3408 setupHelpMenu
  3475                                         'full class browser ...'
  3409     "setup the help- pulldown menu"
  3476                                         'class hierarchy browser ...'
  3410 
  3477                                         'class tree'
  3411     |l s|
  3478                                         '-'
       
  3479                                         'implementors ...'
       
  3480                                         'senders ...'
       
  3481                                         'resource ...'
       
  3482                                         '-'
       
  3483                                         'change browser'
       
  3484                                         ))
       
  3485            selectors:#(
       
  3486                                         #startSystemBrowser 
       
  3487                                         #startClassBrowser 
       
  3488                                         #startFullClassBrowser 
       
  3489                                         #startClassHierarchyBrowser 
       
  3490                                         #startClassTreeView 
       
  3491                                         nil
       
  3492                                         #browseImplementors 
       
  3493                                         #browseSenders 
       
  3494                                         #browseResources 
       
  3495                                         nil
       
  3496                                         #startChangesBrowser 
       
  3497                       )
       
  3498            receiver:self.
       
  3499 
       
  3500     JavaBrowser notNil ifTrue:[
       
  3501         (myMenu subMenuAt:#classes)
       
  3502             addLabels:(resources array:#('-' 'java browser'))
       
  3503             selectors:#(nil startJavaBrowser)
       
  3504             after:#startClassTreeView
       
  3505     ].
       
  3506 
       
  3507     myMenu at:#projects 
       
  3508            putLabels:(resources array:#(
       
  3509                                         'new project'
       
  3510                                         '-'
       
  3511                                         'select project ...'
       
  3512                                         ))
       
  3513            selectors:#(
       
  3514                                         #newProject 
       
  3515                                         nil
       
  3516                                         #selectProject 
       
  3517                       )
       
  3518            receiver:self.
       
  3519 
       
  3520     myMenu at:#settings 
       
  3521            putLabels:(resources array:#(
       
  3522                                         'language ...'
       
  3523                                         'show keyboard mappings ...'
       
  3524                                         'view style ...'
       
  3525                                         'fonts ...'
       
  3526                                         'printer ...'
       
  3527                                         'messages ...'
       
  3528                                         'compilation ...'
       
  3529                                         'object memory ...'
       
  3530                                         'screen ...'
       
  3531                                         'misc ...'
       
  3532                                         '='
       
  3533                                         'save settings ...'
       
  3534                                         'restore settings ...'
       
  3535                                         ))
       
  3536            selectors:#(
       
  3537                                         #languageSetting 
       
  3538                                         #keyboardSetting 
       
  3539                                         #viewStyleSetting 
       
  3540                                         #fontSettings 
       
  3541                                         #printerSettings 
       
  3542                                         #messageSettings 
       
  3543                                         #compilerSettings 
       
  3544                                         #memorySettings 
       
  3545                                         #displaySettings 
       
  3546                                         #miscSettings
       
  3547                                         nil
       
  3548                                         #saveSettings 
       
  3549                                         #restoreSettings 
       
  3550                       )
       
  3551            receiver:self.
       
  3552 
       
  3553     self setupToolsMenu.
       
  3554     self setupDemoMenu.
       
  3555 
  3412 
  3556     ActiveHelp notNil ifTrue:[
  3413     ActiveHelp notNil ifTrue:[
  3557         l := #(
  3414         l := #(
  3558                 'what''s new'
  3415                 'what''s new'
  3559                 'index'
  3416                 'index'
  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 
  3782         transcript showCR:'**                                           **'.
  4032         transcript showCR:'**                                           **'.
  3783         transcript showCR:'** Menus affecting common state are disabled **'.
  4033         transcript showCR:'** Menus affecting common state are disabled **'.
  3784         transcript showCR:'***********************************************'.
  4034         transcript showCR:'***********************************************'.
  3785     ]
  4035     ]
  3786 
  4036 
  3787     "Modified: 5.7.1996 / 17:55:15 / cg"
  4037     "Modified: 8.1.1997 / 14:58:32 / cg"
  3788 !
  4038 !
  3789 
  4039 
  3790 setupViewsIn:topView 
  4040 setupViewsIn:topView 
  3791     "create the pulldown menu, buttonPanel and transcript view"
  4041     "create the pulldown menu, buttonPanel and transcript view"
  3792 
  4042 
  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:[
  3925     ].
  4230     ].
  3926     box destroy.
  4231     box destroy.
  3927     ^ box accepted
  4232     ^ box accepted
  3928 
  4233 
  3929     "Created: 27.2.1996 / 01:44:16 / cg"
  4234     "Created: 27.2.1996 / 01:44:16 / cg"
  3930     "Modified: 30.5.1996 / 09:18:57 / cg"
       
  3931     "Modified: 17.6.1996 / 13:38:48 / stefan"
  4235     "Modified: 17.6.1996 / 13:38:48 / stefan"
       
  4236     "Modified: 8.1.1997 / 14:59:11 / cg"
  3932 !
  4237 !
  3933 
  4238 
  3934 openApplication:className nameSpace:aNameSpace
  4239 openApplication:className nameSpace:aNameSpace
       
  4240     "open some application, given the classes name.
       
  4241      Look for it in Smalltalk and the given nameSpace"
       
  4242 
  3935     self openApplication:className nameSpace:aNameSpace with:#open
  4243     self openApplication:className nameSpace:aNameSpace with:#open
  3936 
  4244 
  3937     "Modified: 8.1.1997 / 12:52:24 / cg"
  4245     "Modified: 8.1.1997 / 14:59:42 / cg"
  3938 !
  4246 !
  3939 
  4247 
  3940 openApplication:className nameSpace:aNameSpace with:aSelector
  4248 openApplication:className nameSpace:aNameSpace with:aSelector
       
  4249     "open some application, given the classes name.
       
  4250      Look for it in Smalltalk and the given nameSpace"
       
  4251 
  3941     |cls|
  4252     |cls|
  3942 
  4253 
  3943     cls := Smalltalk at:className asSymbol.
  4254     cls := Smalltalk at:className asSymbol.
  3944     cls isNil ifTrue:[
  4255     cls isNil ifTrue:[
  3945         "/ look if its in the nameSpace
  4256         "/ look if its in the nameSpace
  3957             cls perform:aSelector
  4268             cls perform:aSelector
  3958         ]
  4269         ]
  3959     ]
  4270     ]
  3960 
  4271 
  3961     "Created: 8.1.1997 / 12:52:13 / cg"
  4272     "Created: 8.1.1997 / 12:52:13 / cg"
  3962     "Modified: 8.1.1997 / 12:54:15 / cg"
  4273     "Modified: 8.1.1997 / 14:59:47 / cg"
  3963 !
  4274 !
  3964 
  4275 
  3965 pickAView
  4276 pickAView
       
  4277     "let user pick a view and return it"
       
  4278 
  3966     |v|
  4279     |v|
  3967 
  4280 
  3968     (Delay forSeconds:1) wait.
  4281     (Delay forSeconds:1) wait.
  3969     v := Screen current viewFromUser.
  4282     v := Screen current viewFromUser.
  3970     v isNil ifTrue:[
  4283     v isNil ifTrue:[
  3971         self warn:'sorry, this is not a smalltalk view'.
  4284         self warn:'sorry, this is not a smalltalk view'.
  3972         ^ nil
  4285         ^ nil
  3973     ].
  4286     ].
  3974     ^ v
  4287     ^ v
       
  4288 
       
  4289     "Modified: 8.1.1997 / 14:59:57 / cg"
  3975 !
  4290 !
  3976 
  4291 
  3977 reopenLauncher
  4292 reopenLauncher
  3978     "for now (since style & language settings currently do
  4293     "reopen a new launcher.
       
  4294      for now (since style & language settings currently do
  3979      not affect living views ...)"
  4295      not affect living views ...)"
  3980 
  4296 
  3981     |contents fontPref enc newLauncher|
  4297     |contents fontPref enc newLauncher|
  3982 
  4298 
  3983 "/ moved the stuff below to the language-setting
  4299 "/ moved the stuff below to the language-setting
  3996     contents := transcript endEntry; list.
  4312     contents := transcript endEntry; list.
  3997     newLauncher := self class open.
  4313     newLauncher := self class open.
  3998     newLauncher window waitUntilVisible.
  4314     newLauncher window waitUntilVisible.
  3999     newLauncher transcript list:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor
  4315     newLauncher transcript list:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor
  4000 
  4316 
  4001     "Modified: 18.10.1996 / 15:04:06 / cg"
  4317     "Modified: 8.1.1997 / 15:00:15 / cg"
  4002 !
  4318 !
  4003 
  4319 
  4004 saveAllViews
  4320 saveAllViews
  4005     "tell each topview that we are going to terminate and give it chance
  4321     "tell each topview that we are going to terminate and give it chance
  4006      to save its contents."
  4322      to save its contents."
  4045 ! !
  4361 ! !
  4046 
  4362 
  4047 !Launcher class methodsFor:'documentation'!
  4363 !Launcher class methodsFor:'documentation'!
  4048 
  4364 
  4049 version
  4365 version
  4050     ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.223 1997-01-08 11:55:38 cg Exp $'
  4366     ^ '$Header: /cvs/stx/stx/libtool/Launcher.st,v 1.224 1997-01-08 14:04:08 cg Exp $'
  4051 ! !
  4367 ! !