OldLauncher.st
changeset 8 93b3dc7fa0a5
parent 5 5c9b6ccfff33
child 11 b4f9b38f3639
--- a/OldLauncher.st	Sat Dec 11 02:42:19 1993 +0100
+++ b/OldLauncher.st	Sat Dec 11 02:46:03 1993 +0100
@@ -11,7 +11,7 @@
 "
 
 StandardSystemView subclass:#Launcher
-       instanceVariableNames:'myMenu exitBox saveBox'
+       instanceVariableNames:'myMenu exitBox saveBox enterBox'
        classVariableNames:''
        poolDictionaries:''
        category:'Interface-Smalltalk'
@@ -24,7 +24,7 @@
 
 allows startup of smalltalk applications
 
-$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.3 1993-10-13 02:48:23 claus Exp $
+$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.4 1993-12-11 01:46:03 claus Exp $
 written spring 91 by claus
 '!
 
@@ -33,8 +33,8 @@
 new
     ^ super
         extent:(100 @ 100)
-        label:'Smalltalk'
-        icon:(Form fromFile:'Smalltalk.xbm' resolution:100)
+        label:'smallTalk'
+        icon:(Form fromFile:'SmalltalkX.xbm' resolution:100)
 
     "Launcher start"
 ! !
@@ -46,31 +46,25 @@
 
     myMenu := ClickMenuView 
                 labels:(resources array:#(
-                                'System Browser'
-                                'Changes Browser'
-                                'File Browser'
-                                'Directory Browser'
+                                'Browsers ...'
                                 'Workspace'
-                                'Transcript'
-                                'Project'
+                                'File Browser'
+                                'Projects ...'
                                 '-'
-                                'Utilities'
-                                'Goodies'
-                                'Games & Demos'
+                                'Utilities ...'
+                                'Goodies ...'
+                                'Games & Demos ...'
                                 '-'
-                                'info & help'
+                                'info & help ...'
                                 '-'
                                 'snapshot'
                                 '-'
                                 'exit'
                         ))
-                selectors:#(startSystemBrowser
-                            startChangesBrowser
+                selectors:#(browserMenu
+                            startWorkspace
                             startFileBrowser
-                            startDirectoryBrowser
-                            startWorkspace
-                            startTranscript
-                            newProject
+                            projectMenu
                             nil
                             utilityMenu
                             goodyMenu
@@ -85,52 +79,149 @@
                 receiver:self
                       in:self.
 
-    myMenu subMenuAt:#utilityMenu put:(
+    myMenu subMenuAt:#browserMenu put:(
         PopUpMenu labels:(resources array:#(
-                            'Window tree'
-                            'Class tree'
+                            'System Browser'
+                            'Class Hierarchy Browser'
+                            'Implementors'
+                            'Senders'
                             '-'
-                            'Event monitor'
-                            'Memory monitor'
-                            'Memory usage'
+                            'Changes Browser'
                             '-'
-                            'collect Garbage'
-                            'ScreenSaver'
+                            'Directory Browser'
                            ))
                selectors:#(
-                            startWindowTreeView
-                            startClassTreeView
+                            startSystemBrowser
+                            startHierarchyBrowser
+                            startImplementorsBrowser
+                            startSendersBrowser
                             nil
-                            startEventMonitor
-                            startMemoryMonitor
-                            startMemoryUsage
+                            startChangesBrowser
                             nil
-                            garbageCollect
-                            startScreenSaver
+                            startDirectoryBrowser
                            )
                 receiver:self
                      for:self
 
     ).
 
-    myMenu subMenuAt:#gamesMenu put:(
+    myMenu subMenuAt:#utilityMenu put:(
         PopUpMenu labels:(resources array:#(
-                            'Tetris'
-                            'TicTacToe'
+                            'Transcript'
+                            '-'
+                            'Window tree'
+                            'Class tree'
+                            '-'
+                            'Event monitor'
+                            'Process monitor'
+                            'Memory monitor'
+                            'Memory usage'
                             '-'
-                            'Animation'
-                            'Globe'
-                            '-'
-                            'LogicTool'
+                            'collect Garbage'
+                            'collect Garbage & compress'
+                            'ScreenSaver ...'
+                           ))
+               selectors:#(
+                            startTranscript
+                            nil
+                            startWindowTreeView
+                            startClassTreeView
+                            nil
+                            startEventMonitor
+                            startProcessMonitor
+                            startMemoryMonitor
+                            startMemoryUsage
+                            nil
+                            garbageCollect
+                            compressingGarbageCollect
+                            screenSaverMenu
+                           )
+                receiver:self
+                     for:self
+    ).
+
+    (myMenu subMenuAt:#utilityMenu) subMenuAt:#screenSaverMenu put:(
+        PopUpMenu labels:(resources array:#(
+                            'simple'
+                            'spotlight'
+                            'moving spotlight'
                            ))
                selectors:#(
-                            startTetris
-                            startTicTacToe
+                            startScreenSaver1
+                            startScreenSaver2
+                            startScreenSaver3
+                           )
+                receiver:self
+                     for:self
+    ).
+
+    ((Display isKindOf:GLXWorkstation)
+    and:[OperatingSystem getSystemType = 'iris']) ifTrue:[
+        myMenu subMenuAt:#gamesMenu put:(
+            PopUpMenu labels:(resources array:#(
+                                'Tetris'
+                                'TicTacToe'
+                                '-'
+                                'Animation'
+                                'Globe'
+                                '-'
+                                'GL-rotating plane'
+                                'GL-light around sphere'
+                                'GL-teapot'
+                                '-'
+                                'LogicTool'
+                               ))
+                   selectors:#(
+                                startTetris
+                                startTicTacToe
+                                nil
+                                startAnimation
+                                startGlobeDemo
+                                nil
+                                startGLPlaneDemo
+                                startGLSphereDemo
+                                startGLTeapotDemo
+                                nil
+                                startLogicTool
+                              )
+                    receiver:self
+                         for:self
+        ).
+    ] ifFalse:[
+        myMenu subMenuAt:#gamesMenu put:(
+            PopUpMenu labels:(resources array:#(
+                                'Tetris'
+                                'TicTacToe'
+                                '-'
+                                'Animation'
+                                'Globe'
+                                '-'
+                                'LogicTool'
+                               ))
+                   selectors:#(
+                                startTetris
+                                startTicTacToe
+                                nil
+                                startAnimation
+                                startGlobeDemo
+                                nil
+                                startLogicTool
+                              )
+                    receiver:self
+                         for:self
+        )
+    ].
+
+    myMenu subMenuAt:#projectMenu put:(
+        PopUpMenu labels:(resources array:#(
+                            'new project'
+                            '-'
+                            'select project'
+                           ))
+               selectors:#(
+                            newProject
                             nil
-                            startAnimation
-                            startGlobeDemo
-                            nil
-                            startLogicTool
+                            selectProject
                           )
                 receiver:self
                      for:self
@@ -167,12 +258,14 @@
         PopUpMenu labels:(resources array:#(
                             'Overview'
                             'Getting started'
+                            'Customizing'
                             '-'
                             'Help Browser'
                            ))
                selectors:#(
                             showOverview
                             showGettingStarted
+                            showCustomizing
                             nil
                             startHelpView
                           )
@@ -196,6 +289,10 @@
     saveBox title:(resources at:'filename for image:') withCRs.
     saveBox abortText:(resources at:'abort').
     saveBox okText:(resources at:'save').
+
+    enterBox := EnterBox new.
+    enterBox abortText:(resources at:'abort').
+    enterBox okText:(resources at:'browse').
 !
 
 realize
@@ -220,9 +317,13 @@
         exitBox := nil
     ].
     saveBox notNil ifTrue:[
-        exitBox destroy.
+        saveBox destroy.
         saveBox := nil
     ].
+    enterBox notNil ifTrue:[
+        enterBox destroy.
+        enterBox := nil
+    ].
     super destroy
 !
 
@@ -232,6 +333,31 @@
     ^ self
 ! !
 
+!Launcher methodsFor:'private'!
+
+showDocumentFile:name
+    |s f isRTF|
+
+    isRTF := true.
+    s := Smalltalk systemFileStreamFor:name , '.rtf'.
+    s isNil ifTrue:[
+        isRTF := false.
+        s := Smalltalk systemFileStreamFor:name , '.doc'.
+        s isNil ifTrue:[
+            self warn:('document ' , name , ' (.rtf/.doc) not available.').
+            ^ nil
+        ].
+    ].
+    f := s pathName.
+
+    isRTF ifTrue:[
+        DocumentView startOn:f.
+        ^ self
+    ].
+
+    (EditTextView startOn:f) readOnly
+! !
+
 !Launcher methodsFor:'events'!
 
 saveAndTerminate
@@ -240,12 +366,45 @@
 
 !Launcher methodsFor:'user interaction'!
 
-startScreenSaver
-    ScreenSaver start
+startSystemBrowser
+    SystemBrowser start
 !
 
-startSystemBrowser
-    SystemBrowser start
+startHierarchyBrowser
+    enterBox title:(resources at:'name of class:') withCRs.
+    enterBox okText:(resources at:'browse').
+
+    enterBox action:[:name |
+        |class|
+
+        class := Smalltalk at:name asSymbol ifAbsent:[nil].
+        class isBehavior ifFalse:[
+            self warn:(resources at:'no such class')
+        ] ifTrue:[
+            SystemBrowser browseClassHierarchy:class
+        ]
+    ].
+    enterBox showAtPointer
+!
+
+startImplementorsBrowser
+    enterBox title:(resources at:'selector:') withCRs.
+    enterBox okText:(resources at:'browse').
+
+    enterBox action:[:selectorName |
+        SystemBrowser browseImplementorsOf:selectorName  
+    ].
+    enterBox showAtPointer
+!
+
+startSendersBrowser
+    enterBox title:(resources at:'selector:') withCRs.
+    enterBox okText:(resources at:'browse').
+
+    enterBox action:[:selectorName |
+        SystemBrowser browseAllCallsOn:selectorName 
+    ].
+    enterBox showAtPointer
 !
 
 startChangesBrowser
@@ -280,12 +439,16 @@
     EventMonitor start
 !
 
-startMemoryUsage
-    MemoryDebugger start
+startProcessMonitor
+    ProcessMonitor start
 !
 
 startMemoryMonitor
-    Monitor start
+    MemoryMonitor start
+!
+
+startMemoryUsage
+    MemoryUsageView start
 !
 
 startTranscript
@@ -298,8 +461,41 @@
     ]
 !
 
+startScreenSaver1
+    ScreenSaver start
+!
+
+startScreenSaver2
+    LightInTheDark start
+!
+
+startScreenSaver3
+    LightInTheDark2 start
+!
+
 newProject
-    (ProjectView for:(Project new)) realize
+    (ProjectView for:(Project new)) open
+!
+
+selectProject
+    |list box|
+
+    list := Project allInstances.
+    box := ListSelectionBox new.
+    box list:(list collect:[:p | p name]).
+    box title:(resources string:'select a project').
+    box action:[:selection |
+        |project|
+
+        project := list detect:[:p | p name = selection] ifNone:[nil].
+        project isNil ifTrue:[
+            Transcript showCr:'no such project'
+        ] ifFalse:[
+            project showViews.
+            Project current:project
+        ]
+    ].
+    box showAtPointer
 !
 
 startXterm
@@ -338,6 +534,30 @@
     RoundGlobeDemo start
 !
 
+startGLSphereDemo
+    Class updateChanges:false.
+    Smalltalk fileIn:'clients/IRIS-specials/GLSphereDemo1.st'.
+    Smalltalk fileIn:'clients/IRIS-specials/GLSphereDemo2.st'.
+    Class updateChanges:true.
+    GLSphereDemoView2 start
+!
+
+startGLTeapotDemo
+    Class updateChanges:false.
+    Smalltalk fileIn:'clients/IRIS-specials/GLTeapotView.st'.
+    Smalltalk fileIn:'clients/IRIS-specials/GLTeapotDemo.st'.
+    Class updateChanges:true.
+    GLTeapotDemo start
+!
+
+startGLPlaneDemo
+    Class updateChanges:false.
+    Smalltalk fileIn:'source/GLPlaneDemo1.st'.
+    Smalltalk fileIn:'source/GLPlaneDemo2.st'.
+    Class updateChanges:true.
+    GLPlaneDemoView2 start
+!
+
 startTetris
     Tetris start
 !
@@ -355,6 +575,10 @@
 !
 
 garbageCollect
+    ObjectMemory markAndSweep
+!
+
+compressingGarbageCollect
     |nBytesBefore nReclaimed|
 
     nBytesBefore := ObjectMemory oldSpaceUsed.
@@ -389,21 +613,15 @@
 !
 
 showOverview
-    |f|
+    self showDocumentFile:'doc/overview'
+!
 
-    f := self warnIfAbsent:'doc/overview.doc'.
-    f notNil ifTrue:[
-        (EditTextView startOn:f) readOnly
-    ]
+showCustomizing
+    self showDocumentFile:'doc/manuals/customizing'
 !
 
 showGettingStarted
-    |f|
-
-    f := self warnIfAbsent:'doc/manuals/gettingStarted.rtf'.
-    f notNil ifTrue:[
-        DocumentView startOn:f
-    ]
+    self showDocumentFile:'doc/manuals/gettingStarted'
 !
 
 startHelpView