--- a/OldLauncher.st Wed Oct 13 02:01:32 1993 +0100
+++ b/OldLauncher.st Wed Oct 13 02:03:08 1993 +0100
@@ -24,7 +24,7 @@
allows startup of smalltalk applications
-%W% %E%
+$Header: /cvs/stx/stx/libtool/OldLauncher.st,v 1.2 1993-10-13 01:02:46 claus Exp $
written spring 91 by claus
'!
@@ -39,32 +39,31 @@
"Launcher start"
! !
-!Launcher methodsFor:'initialization'!
+!Launcher methodsFor:'initialize / release'!
initialize
super initialize.
- resources := ResourcePack fromFile:'Launcher.rs'.
-
myMenu := ClickMenuView
- labels:#('System Browser'
- 'Changes Browser'
- 'File Browser'
- 'Directory Browser'
- 'Workspace'
- 'Transcript'
- 'Project'
- '-'
- 'Utilities'
- 'Goodies'
- 'Games & Demos'
- '-'
- 'info & help'
- '-'
- 'snapshot'
- '-'
- 'exit'
- )
+ labels:(resources array:#(
+ 'System Browser'
+ 'Changes Browser'
+ 'File Browser'
+ 'Directory Browser'
+ 'Workspace'
+ 'Transcript'
+ 'Project'
+ '-'
+ 'Utilities'
+ 'Goodies'
+ 'Games & Demos'
+ '-'
+ 'info & help'
+ '-'
+ 'snapshot'
+ '-'
+ 'exit'
+ ))
selectors:#(startSystemBrowser
startChangesBrowser
startFileBrowser
@@ -87,7 +86,7 @@
in:self.
myMenu subMenuAt:#utilityMenu put:(
- PopUpMenu labels:#(
+ PopUpMenu labels:(resources array:#(
'Window tree'
'Class tree'
'-'
@@ -97,7 +96,7 @@
'-'
'collect Garbage'
'ScreenSaver'
- )
+ ))
selectors:#(
startWindowTreeView
startClassTreeView
@@ -115,7 +114,7 @@
).
myMenu subMenuAt:#gamesMenu put:(
- PopUpMenu labels:#(
+ PopUpMenu labels:(resources array:#(
'Tetris'
'TicTacToe'
'-'
@@ -123,7 +122,7 @@
'Globe'
'-'
'LogicTool'
- )
+ ))
selectors:#(
startTetris
startTicTacToe
@@ -139,7 +138,7 @@
).
myMenu subMenuAt:#goodyMenu put:(
- PopUpMenu labels:#(
+ PopUpMenu labels:(resources array:#(
'Clock'
'Address Book'
'-'
@@ -148,7 +147,7 @@
'NewsTool'
'-'
'DrawTool'
- )
+ ))
selectors:#(
startClock
startAddressBook
@@ -165,12 +164,12 @@
).
myMenu subMenuAt:#helpMenu put:(
- PopUpMenu labels:#(
+ PopUpMenu labels:(resources array:#(
'Overview'
'Getting started'
'-'
'Help Browser'
- )
+ ))
selectors:#(
showOverview
showGettingStarted
@@ -185,7 +184,18 @@
myMenu borderWidth:0.
myMenu origin:(0 @ 0).
myMenu font:(self font).
- self extent:(myMenu extent)
+ self extent:(myMenu extent).
+
+ exitBox := EnterBox2 new.
+ exitBox title:(resources at:'save state before exiting ?\\filename for image:') withCRs.
+ exitBox abortText:(resources at:'abort').
+ exitBox okText:(resources at:'exit').
+ exitBox okText2:(resources at:'save & exit').
+
+ saveBox := EnterBox new.
+ saveBox title:(resources at:'filename for image:') withCRs.
+ saveBox abortText:(resources at:'abort').
+ saveBox okText:(resources at:'save').
!
realize
@@ -204,6 +214,18 @@
self extent:(myMenu extent).
!
+destroy
+ exitBox notNil ifTrue:[
+ exitBox destroy.
+ exitBox := nil
+ ].
+ saveBox notNil ifTrue:[
+ exitBox destroy.
+ saveBox := nil
+ ].
+ super destroy
+!
+
addToCurrentProject
"ignored here"
@@ -355,18 +377,33 @@
]
!
-showOverview
- |v|
+warnIfAbsent:aPath
+ |s|
- v := EditTextView startOn:(Smalltalk systemFileStreamFor:'doc/overview.doc') pathName.
- v readOnly
+ s := Smalltalk systemFileStreamFor:aPath.
+ s isNil ifTrue:[
+ self warn:('document ' , aPath , ' not available').
+ ^ nil
+ ].
+ ^ s pathName
+!
+
+showOverview
+ |f|
+
+ f := self warnIfAbsent:'doc/overview.doc'.
+ f notNil ifTrue:[
+ (EditTextView startOn:f) readOnly
+ ]
!
showGettingStarted
- |v|
+ |f|
- v := DocumentView startOn:
- (Smalltalk systemFileStreamFor:'doc/manuals/gettingStarted.rtf') pathName.
+ f := self warnIfAbsent:'doc/manuals/gettingStarted.rtf'.
+ f notNil ifTrue:[
+ DocumentView startOn:f
+ ]
!
startHelpView