NewLauncher.st
author Claus Gittinger <cg@exept.de>
Fri, 17 Apr 1998 21:00:31 +0200
changeset 1555 756ab2711237
parent 1549 9ee0dae8bdf1
child 1576 534ad27a7b4a
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 1997-1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice. This software may not
 be provided or otherwise made available to, or used by, any
 other person. No title to or ownership of the software is
 hereby transferred.
"



ToolApplicationModel subclass:#NewLauncher
	instanceVariableNames:'transcript isMainLauncher helpIsOn'
	classVariableNames:'OpenLaunchers NotifyingEmergencyHandler'
	poolDictionaries:''
	category:'Interface-Smalltalk'
!

!NewLauncher class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997-1998 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice. This software may not
 be provided or otherwise made available to, or used by, any
 other person. No title to or ownership of the software is
 hereby transferred.
"


!

documentation
"
    The future launcher.

    [start with:]
        NewLauncher open

    [see also:]
        Launcher

    [author:]
        Thomas Zwick, eXept Software AG
"
! !

!NewLauncher class methodsFor:'accessing'!

current
    "return the launcher running on the current screen.
     (for access via addMenu/ removeMenu)"

    OpenLaunchers notNil ifTrue:[
        OpenLaunchers do:[:aLauncher |
            aLauncher window graphicsDevice == Screen current ifTrue:[
                ^ aLauncher
            ]
        ].
    ].
    ^ nil

    "Modified: / 29.1.1998 / 22:08:12 / cg"
!

label

    ^'Launcher'


!

openLaunchers

    ^OpenLaunchers ? (OpenLaunchers := OrderedCollection new)
! !

!NewLauncher class methodsFor:'defaults'!

notifyingEmergencyHandler
    "return a block (used as an emergency handler
     for exceptions), which does errorNotification before going
     into the debugger."

    "Remember the handlerBlock, to be able to determine if the current
     handler is the notifying one."

    ^ NotifyingEmergencyHandler ? (NotifyingEmergencyHandler := Exception notifyingEmergencyHandler)
! !

!NewLauncher class methodsFor:'help specs'!

helpSpec
    "This resource specification was automatically generated
     by the UIHelpTool of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIHelpTool may not be able to read the specification."

    "
     UIHelpTool openOnClass:NewLauncher    
    "

    <resource: #help>

    ^super helpSpec addPairsFrom:#(

#aboutLicenseConditions
'Opens a HTML-Browser on the license conditions of ST/X.'

#classes
'Classes functions.'

#classesClassBrowser
'Opens a dia log for defining and opening a Class Browser on a class.'

#classesClassHierarchyBrowser
'Opens a dialog for defining and opening a Class Hierarchy Browser on a class.'

#classesClassTreeBrowser
'Opens a Class Tree on the classes of ST/X.'

#classesFullClassBrowser
'Opens a dialog for defining and opening a Full Class Browser on a class.'

#classesImplementors
'Opens a dialog for defining a selector and listing all methods implementing that selector.'

#classesRemoveAllTracePoints
'Removes all trace points set in methods.'

#classesResourceMethods
'Opens a dialog for searching resource methods.'

#classesSenders
'Opens a dialog for defining a selector and listing all methods sending that selector.'

#classesShowTracePoints
'Opens a list showing all trace points set in methods.'

#classesSpecial
'Special class functions.'

#classesSpecialReferencesToUndeclared
'Opens a list of methods refering to undeclared variables.'

#classesSystemBrowser
'Opens a System Browser for editing sources of the classes.'

#classesSystemBrowserOnClass
'Opens a System Browser on the selected class.'

#demos
'Demos functions.'

#fileApplicationBuilder
'Opens a Application Builder for building stand alone ST/X-applications.'

#fileFileBrowser
'Opens a File Browser for loading, saving, and editing source files, etc.'

#fileLibraryBuilder
'Opens a Library Builder for building class libraries.'

#fileModules
'Opens a dialog for showing (and unloading) class libraries and other modules.'

#fileSaveImage
'Saves the current image of ST/X.'

#fileSaveImageAs
'Opens a dialog for selecting a file in order to save the current image of ST/X.'

#helpClassDocumentation
'Opens a HTML-Browser with the documentation of the classes in ST/X.'

#helpIndex
'Opens a HTML-Browser with the index of the documentation of ST/X.'

#helpPrintDocumentation
'Opens a HTML-Browser with a manual for a printing of the documentation of ST/X.'

#helpSTXOnlineDocumentation
'Opens a HTML-Browser with the online documentation of ST/X.'

#helpWhatsNew
'Opens a HTML-Browser with the last brand new features of ST/X.'

#settingsCompilation
'Opens a dialog for changing the settings of the compilation of smalltalk sources.'

#settingsFonts
'Opens a dialog for changing of the font styles for the view classes.'

#settingsKeyboardMappings
'Opens a dialog for inspecting the mappings of the keyboard.'

#settingsLanguage
'Opens a dialog for changing the national language.'

#settingsLoadSettings
'Opens a dialog for loading stored values of settings.'

#settingsMessages
'Opens a dialog for changing the settings for reporting infos/errors.'

#settingsMisc
'Opens a dialog for changing other settings.'

#settingsObjectMemory
'Opens a dialog for changing the settings of the object memories.'

#settingsPrinter
'Opens a dialog for changing the settings for the printer.'

#settingsSaveSettings
'Opens a dialog for saving values of the current settings.'

#settingsScreen
'Opens a dialog for changing the settings for the screen.'

#settingsSourceAndDebugger
'Opens a dialog for changing the settings of the source code management.'

#settingsViewStyle
'Opens a dialog for changing the current view style.'

#system
'System functions.'

#systemEventTrace
'Changes the mouse cursor to a cross hair for moving it to a view in order to turn on/off an event trace.'

#systemEventView
'Opens a view for outputting view events on a xterm.'

#systemGarbageCollect
'Destroys all objects having no references to other objects.'

#systemGarbageCollectAndCompress
'Destroys all objects having no references to other objects and compresses the memory.'

#systemInterruptLatency
'Opens a Interrupt Latency Monitor for showing methods which block interrupts for longer than a given time goal.'

#systemMemory
'Opens a Memory Monitor for showing (graphically) the memory segments in ST/X.'

#systemMemoryUsage
'Opens a list showing the memory usages of the classes.'

#systemProcesses
'Opens a Process Monitor for showing (and editing) current running processes in ST/X.'

#systemSemaphores
'Opens a Semaphores Monitor for showing (and editing) current running semaphores in ST/X.'

#tools
'Tools functions.'

#toolsChangesBrowser
'Opens a Changes Browser containing all changes of the smalltalk source code made by the user.'

#toolsGUIPainter
'Opens a GUI Painter for building graphical user interfaces.'

#toolsImageEditor
'Opens a Image Editor for building bitmap images used by buttons, tool bars, etc.'

#toolsMenuEditor
'Opens a Menu Editor for building menu bars, popup menus, and tool bars.'

#toolsMisc
'Tools misc functions.'

#toolsMiscNewLauncher
'Reopens a new launcher.'

#toolsMiscOldLauncher
'Opens an old launcher.'

#toolsMiscProjects
'Projects functions.'

#toolsMiscProjectsNewProject
'Creates a new project for working in a separate environment.'

#toolsMiscProjectsSelectProject
'Select an existing project for working in that environment.'

#toolsProjects
''

#toolsWorkspace
'Opens a Workspace for evaluating smalltalk expressions.'

#windows
'Windows functions.'

#windowsDeiconifyAll
'Opens all icons on the desktop of ST/X to their windows.'

#windowsFindAndDestroy
'Opens a dialog for selecting a window of ST/X by label and for destroying it.'

#windowsFindAndRaise
'Opens dialog for selecting a window of ST/X by label and for raising it.'

#windowsGrapScreen
'Opens a dialog for saving the contents of the screen as a bitmap.'

#windowsGrapScreenArea
'Changes the mouse cursor for selecting an area of the screen and opens a dialog for saving that area as a bitmap.'

#windowsGrapWindow
'Changes the mouse cursor for selecting a window of ST/X and opens a dialog for saving the contents of the window as a bitmap.'

#windowsIconifyAll
'Closes all windows of ST/X to their icons on the desktop.'

#windowsSelectAndDestroy
'Changes the mouse cursor to a cross hair for moving it over a window of ST/X in order to destroy it.'

#windowsSelectAndInspect
'Changes the mouse cursor to a cross hair for moving it over a window of ST/X in order to inspect it.'

#windowsViewTree
'Changes the mouse cursor to a cross hair for moving it over a window of ST/X in order to inspect the view tree of it.'

#windowsViewTreeAllViews
'Opens an inspector showing the view trees of all windows of ST/X.'

)
! !

!NewLauncher class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:NewLauncher andSelector:#windowSpec
     NewLauncher new openInterface:#windowSpec
     NewLauncher open
    "

    <resource: #canvas>

    ^
     
       #(#FullSpec
          #window: 
           #(#WindowSpec
              #name: 'Launcher'
              #layout: #(#LayoutFrame 407 0 353 0 697 0 554 0)
              #label: 'Launcher'
              #min: #(#Point 374 240)
              #max: #(#Point 1152 900)
              #bounds: #(#Rectangle 407 353 698 555)
              #menu: #menu
              #usePreferredExtent: false
              #icon: #stxIcon
          )
          #component: 
           #(#SpecCollection
              #collection: 
               #(
                 #(#MenuPanelSpec
                    #name: 'menuToolbarView'
                    #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 38 0)
                    #menu: #menuToolbar
                    #style: #(#FontDescription #helvetica #medium #roman 10)
                )
                 #(#ArbitraryComponentSpec
                    #name: 'transcriptView'
                    #layout: #(#LayoutFrame 0 0.0 40 0.0 0 1.0 -26 1.0)
                    #hasHorizontalScrollBar: true
                    #hasVerticalScrollBar: true
                    #miniScrollerHorizontal: true
                    #component: #TextCollector
                    #hasBorder: false
                )
                 #(#UISubSpecification
                    #name: 'infoBarSubSpec'
                    #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
                    #majorKey: #ToolApplicationModel
                    #minorKey: #windowSpecForInfoBarWithClock
                )
              )
          )
      )
! !

!NewLauncher class methodsFor:'menu specs'!

menu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menu
     (Menu new fromLiteralArrayEncoding:(NewLauncher menu)) startUp
    "

    <resource: #menu>

    ^
     
       #(#Menu
          
           #(
             #(#MenuItem
                #label: 'About'
                #activeHelpKey: #about
                #labelImage: #(#ResourceRetriever nil #menuIcon)
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'About Smalltalk/X...'
                          #translateLabel: true
                          #value: #openAbout
                          #activeHelpKey: #aboutSTX
                      )
                       #(#MenuItem
                          #label: 'License Conditions'
                          #translateLabel: true
                          #value: #openLicenseConditions
                          #activeHelpKey: #aboutLicenseConditions
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'About This Application...'
                          #translateLabel: true
                          #value: #openAboutThisApplication
                          #activeHelpKey: #aboutThisAppliaction
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'File'
                #translateLabel: true
                #activeHelpKey: #file
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'File Browser'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #fileFileBrowser
                          #argument: 'FileBrowser'
                          #labelImage: #(#ResourceRetriever nil #startFileBrowserIcon 'File Browser')
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Modules...'
                          #translateLabel: true
                          #value: #objectModuleDialog
                          #activeHelpKey: #fileModules
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Library Builder'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #fileLibraryBuilder
                          #argument: 'LibraryBuilder'
                      )
                       #(#MenuItem
                          #label: 'Application Builder'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #fileApplicationBuilder
                          #argument: 'ApplicationBuilder'
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Save Image'
                          #translateLabel: true
                          #value: #saveImage
                          #activeHelpKey: #fileSaveImage
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Save Image As...'
                          #translateLabel: true
                          #value: #saveImageAs
                          #activeHelpKey: #fileSaveImageAs
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Exit...'
                          #translateLabel: true
                          #value: #exit
                          #activeHelpKey: #fileExit
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Classes'
                #translateLabel: true
                #activeHelpKey: #classes
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'System Browser'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #classesSystemBrowser
                          #argument: 'SystemBrowser'
                          #labelImage: #(#ResourceRetriever nil #startSystemBrowserIcon 'System Browser')
                      )
                       #(#MenuItem
                          #label: 'System Browser On Class'
                          #translateLabel: true
                          #activeHelpKey: #classesSystemBrowserOnClass
                          #labelImage: #(#ResourceRetriever nil #startSystemBrowserOnHistoryClassIcon 'System Browser On Class')
                          #submenuChannel: #menuClassHistory
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Class Browser...'
                          #translateLabel: true
                          #value: #startClassBrowser
                          #activeHelpKey: #classesClassBrowser
                      )
                       #(#MenuItem
                          #label: 'Full Class Browser...'
                          #translateLabel: true
                          #value: #startFullClassBrowser
                          #activeHelpKey: #classesFullClassBrowser
                      )
                       #(#MenuItem
                          #label: 'Class Hierarchy Browser...'
                          #translateLabel: true
                          #value: #startClassHierarchyBrowser
                          #activeHelpKey: #classesClassHierarchyBrowser
                      )
                       #(#MenuItem
                          #label: 'Class Tree'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #classesClassTreeBrowser
                          #argument: 'ClassTreeGraphView'
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Implementors...'
                          #translateLabel: true
                          #value: #browseImplementors
                          #activeHelpKey: #classesImplementors
                      )
                       #(#MenuItem
                          #label: 'Senders...'
                          #translateLabel: true
                          #value: #browseSenders
                          #activeHelpKey: #classesSenders
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Special'
                          #translateLabel: true
                          #value: #special
                          #activeHelpKey: #classesSpecial
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'References To Undeclared'
                                    #translateLabel: true
                                    #value: #browseUndeclared
                                    #activeHelpKey: #classesSpecialReferencesToUndeclared
                                )
                                 #(#MenuItem
                                    #label: 'Resource Methods...'
                                    #translateLabel: true
                                    #value: #browseResources
                                    #activeHelpKey: #classesResourceMethods
                                )
                                 #(#MenuItem
                                    #label: 'Show Trace Points'
                                    #translateLabel: true
                                    #value: #browseAllBreakAndTracePoints
                                    #activeHelpKey: #classesShowTracePoints
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'Remove All Trace Points'
                                    #translateLabel: true
                                    #value: #removeAllBreakAndTracePoints
                                    #activeHelpKey: #classesRemoveAllTracePoints
                                )
                              ) nil
                              nil
                          )
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Tools'
                #translateLabel: true
                #activeHelpKey: #tools
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Workspace'
                          #value: #openApplication:
                          #activeHelpKey: #toolsWorkspace
                          #argument: 'Workspace'
                          #labelImage: #(#ResourceRetriever nil #startWorkspaceIcon 'Workspace')
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'GUI Painter'
                          #value: #openApplication:
                          #activeHelpKey: #toolsGUIPainter
                          #argument: 'UIPainter'
                          #labelImage: #(#ResourceRetriever nil #startUIPainterIcon 'GUI Painter')
                      )
                       #(#MenuItem
                          #label: 'Menu Editor'
                          #value: #openApplication:
                          #activeHelpKey: #toolsMenuEditor
                          #argument: 'MenuEditor'
                          #labelImage: #(#ResourceRetriever nil #startMenuEditorIcon 'Menu Editor')
                      )
                       #(#MenuItem
                          #label: 'Image Editor'
                          #value: #openApplication:
                          #activeHelpKey: #toolsImageEditor
                          #argument: 'ImageEditor'
                          #labelImage: #(#ResourceRetriever nil #startImageEditorIcon 'Image Editor')
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Changes Browser'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #toolsChangesBrowser
                          #argument: 'ChangesBrowser'
                          #labelImage: #(#ResourceRetriever nil #startChangesBrowserIcon 'Changes Browser')
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Misc'
                          #translateLabel: true
                          #activeHelpKey: #toolsMisc
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Projects'
                                    #translateLabel: true
                                    #activeHelpKey: #toolsMiscProjects
                                    #submenu: 
                                     #(#Menu
                                        
                                         #(
                                           #(#MenuItem
                                              #label: 'New Project'
                                              #translateLabel: true
                                              #value: #newProject
                                              #activeHelpKey: #toolsMiscProjectsNewProject
                                          )
                                           #(#MenuItem
                                              #label: '-'
                                          )
                                           #(#MenuItem
                                              #label: 'Select Project...'
                                              #translateLabel: true
                                              #value: #selectProject
                                              #activeHelpKey: #toolsMiscProjectsSelectProject
                                          )
                                        ) nil
                                        nil
                                    )
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'New Launcher'
                                    #translateLabel: true
                                    #value: #startNewLauncher
                                    #activeHelpKey: #toolsMiscNewLauncher
                                )
                                 #(#MenuItem
                                    #label: 'Old Launcher'
                                    #translateLabel: true
                                    #value: #startOldLauncher
                                    #activeHelpKey: #toolsMiscOldLauncher
                                )
                              ) nil
                              nil
                          )
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'System'
                #translateLabel: true
                #activeHelpKey: #system
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Memory'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #systemMemory
                          #argument: 'MemoryMonitor'
                      )
                       #(#MenuItem
                          #label: 'Memory Usage'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #systemMemoryUsage
                          #argument: 'MemoryUsageView'
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Processes'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #systemProcesses
                          #argument: 'ProcessMonitor'
                      )
                       #(#MenuItem
                          #label: 'Semaphores'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #systemSemaphores
                          #argument: 'SemaphoreMonitor'
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Interrupt Latency'
                          #translateLabel: true
                          #value: #startLatencyMonitor
                          #activeHelpKey: #systemInterruptLatency
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Event View'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #systemEventView
                          #argument: 'EventMonitor'
                      )
                       #(#MenuItem
                          #label: 'Event Trace'
                          #translateLabel: true
                          #value: #startStopEventTrace
                          #activeHelpKey: #systemEventTrace
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Collect Garbage'
                          #translateLabel: true
                          #value: #garbageCollect
                          #activeHelpKey: #systemGarbageCollect
                          #labelImage: #(#ResourceRetriever nil #garbageCollectIcon 'Collect Garbage')
                      )
                       #(#MenuItem
                          #label: 'Collect Garbage And Compress'
                          #translateLabel: true
                          #value: #compressingGarbageCollect
                          #activeHelpKey: #systemGarbageCollectAndCompress
                          #labelImage: #(#ResourceRetriever nil #garbageCollectIcon 'Collect Garbage And Compress')
                      )
                       #(#MenuItem
                          #label: '-'
                          #isVisible: #javaSupportPresent
                      )
                       #(#MenuItem
                          #label: 'Reinit Java VM'
                          #isVisible: #javaSupportPresent
                          #value: #initJavaVM
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Settings'
                #activeHelpKey: #settings
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'View Style...'
                          #translateLabel: true
                          #value: #viewStyleSetting
                          #activeHelpKey: #settingsViewStyle
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Fonts...'
                          #translateLabel: true
                          #value: #fontSettings
                          #activeHelpKey: #settingsFonts
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Language...'
                          #translateLabel: true
                          #value: #languageSetting
                          #activeHelpKey: #settingsLanguage
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Keyboard Mappings...'
                          #translateLabel: true
                          #value: #keyboardSetting
                          #activeHelpKey: #settingsKeyboardMappings
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Messages...'
                          #translateLabel: true
                          #value: #messageSettings
                          #activeHelpKey: #settingsMessages
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Compilation...'
                          #translateLabel: true
                          #value: #compilerSettings
                          #activeHelpKey: #settingsCompilation
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Object Memory...'
                          #translateLabel: true
                          #value: #memorySettings
                          #activeHelpKey: #settingsObjectMemory
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Source And Debugger...'
                          #translateLabel: true
                          #value: #sourceAndDebuggerSettings
                          #activeHelpKey: #settingsSourceAndDebugger
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Printer...'
                          #translateLabel: true
                          #value: #printerSettings
                          #activeHelpKey: #settingsPrinter
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: 'Screen...'
                          #translateLabel: true
                          #value: #displaySettings
                          #activeHelpKey: #settingsScreen
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Misc...'
                          #translateLabel: true
                          #value: #miscSettings
                          #activeHelpKey: #settingsMisc
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Save Settings...'
                          #translateLabel: true
                          #value: #saveSettings
                          #activeHelpKey: #settingsSaveSettings
                      )
                       #(#MenuItem
                          #label: 'Load Settings...'
                          #translateLabel: true
                          #value: #loadSettings
                          #activeHelpKey: #settingsLoadSettings
                          #enabled: #enableDangerousMenuItemsInRemoteLauncher
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Windows'
                #translateLabel: true
                #activeHelpKey: #windows
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Iconify All'
                          #translateLabel: true
                          #value: #iconifyAllWindows
                          #activeHelpKey: #windowsIconifyAll
                      )
                       #(#MenuItem
                          #label: 'De-iconify All'
                          #translateLabel: true
                          #value: #deIconifyAllWindows
                          #activeHelpKey: #windowsDeiconifyAll
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'View Tree'
                          #translateLabel: true
                          #value: #startWindowTreeView
                          #activeHelpKey: #windowsViewTree
                      )
                       #(#MenuItem
                          #label: 'View Tree (all windows)'
                          #translateLabel: true
                          #value: #openApplication:
                          #activeHelpKey: #windowsViewTreeAllViews
                          #argument: 'WindowTreeView'
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Select And Inspect'
                          #translateLabel: true
                          #value: #viewInspect
                          #activeHelpKey: #windowsSelectAndInspect
                      )
                       #(#MenuItem
                          #label: 'Select And Destroy'
                          #translateLabel: true
                          #value: #viewDestroy
                          #activeHelpKey: #windowsSelectAndDestroy
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Find And Raise...'
                          #translateLabel: true
                          #value: #findAndRaiseWindow
                          #activeHelpKey: #windowsFindAndRaise
                      )
                       #(#MenuItem
                          #label: 'Find And Destroy...'
                          #translateLabel: true
                          #value: #findAndDestroyWindow
                          #activeHelpKey: #windowsFindAndDestroy
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Grab Window...'
                          #translateLabel: true
                          #value: #viewHardcopy
                          #activeHelpKey: #windowsGrapWindow
                      )
                       #(#MenuItem
                          #label: 'Grab Screen...'
                          #translateLabel: true
                          #value: #fullScreenHardcopy
                          #activeHelpKey: #windowsGrapScreen
                      )
                       #(#MenuItem
                          #label: 'Grab Screen Area...'
                          #translateLabel: true
                          #value: #screenHardcopy
                          #activeHelpKey: #windowsGrapScreenArea
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Demos'
                #translateLabel: true
                #activeHelpKey: #demos
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'Goodies'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Clock'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'Clock'
                                )
                                 #(#MenuItem
                                    #label: 'Digital Clock'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'DigitalClockView'
                                )
                                 #(#MenuItem
                                    #label: 'Calendar'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'Calendar'
                                )
                                 #(#MenuItem
                                    #label: 'Calculator'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'CalculatorView'
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'Mail Tool'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'MailView'
                                )
                                 #(#MenuItem
                                    #label: 'News Tool'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'NewsView'
                                )
                                 #(#MenuItem
                                    #label: 'FTP Tool'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'FTPTool'
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: 'Games'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Tetris'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'Games::Tetris'
                                )
                                 #(#MenuItem
                                    #label: 'Tic Tac Toe'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'TicTacToeGame'
                                )
                                 #(#MenuItem
                                    #label: 'Tic Tac Toe (2 players)'
                                    #translateLabel: true
                                    #value: #startTicTacToe2
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: 'Geometric Designs'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Pen Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'PenDemo'
                                )
                                 #(#MenuItem
                                    #label: 'Commander Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'CommanderDemo'
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'Fractal Plants Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'FractalPlantsDemo'
                                )
                                 #(#MenuItem
                                    #label: 'Fractal Patterns Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'FractalPatternsDemo'
                                )
                                 #(#MenuItem
                                    #label: 'More Fractal Patterns Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'ArmchairUniverseDemo'
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: 'Simple Animations'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Walking Man'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'Animation'
                                )
                                 #(#MenuItem
                                    #label: 'Globe Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GlobeDemo'
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: '3D Graphics'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Plane'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLPlaneDemoView2'
                                )
                                 #(#MenuItem
                                    #label: 'Tetra'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLTetraDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Cube (wireframe)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLWireCubeDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Cube (solid)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLCubeDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Sphere (wireframe)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLWireSphereDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Doughnut (wireframe)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLDoughnutDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Planet'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLPlanetDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Teapot'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLTeapotDemo'
                                )
                                 #(#MenuItem
                                    #label: 'Logo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'Logo3DView1'
                                )
                                 #(#MenuItem
                                    #label: 'Rubics Cube'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'RubicsCubeView'
                                )
                                 #(#MenuItem
                                    #label: 'X/Y Graph'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLXYGraph'
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'Cube (light)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLCubeDemoView2'
                                )
                                 #(#MenuItem
                                    #label: 'Cube (light and texture)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLBrickCubeDemoView'
                                )
                                 #(#MenuItem
                                    #label: 'Sphere (light)'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLSphereDemoView2'
                                )
                                 #(#MenuItem
                                    #label: 'Colored Octahedron'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'GLOctaHedronDemoView'
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: 'Graphic Editors'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Draw Tool'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'DrawTool'
                                )
                                 #(#MenuItem
                                    #label: 'Logic Tool'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'LogicTool'
                                )
                                 #(#MenuItem
                                    #label: 'Paint Demo'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'ColorDrawDemo3'
                                )
                              ) nil
                              nil
                          )
                      )
                       #(#MenuItem
                          #label: 'GUI'
                          #translateLabel: true
                          #submenu: 
                           #(#Menu
                              
                               #(
                                 #(#MenuItem
                                    #label: 'Widget Gallery'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'CodingExamples_GUI::GUIDemo'
                                )
                                 #(#MenuItem
                                    #label: '-'
                                )
                                 #(#MenuItem
                                    #label: 'Calculator'
                                    #translateLabel: true
                                    #value: #openDemo:
                                    #argument: 'CodingExamples_GUI::GUIDemoCalculator'
                                )
                              ) nil
                              nil
                          )
                      )
                    ) nil
                    nil
                )
            )
             #(#MenuItem
                #label: 'Help'
                #translateLabel: true
                #startGroup: #right
                #activeHelpKey: #help
                #submenu: 
                 #(#Menu
                    
                     #(
                       #(#MenuItem
                          #label: 'What''s New'
                          #translateLabel: true
                          #value: #startWhatsNewDocumentation
                          #activeHelpKey: #helpWhatsNew
                      )
                       #(#MenuItem
                          #label: 'Index'
                          #translateLabel: true
                          #value: #startDocumentationIndex
                          #activeHelpKey: #helpIndex
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'ST/X Online Documentation'
                          #translateLabel: true
                          #value: #startDocumentationTool
                          #activeHelpKey: #helpSTXOnlineDocumentation
                      )
                       #(#MenuItem
                          #label: 'Class Documentation'
                          #translateLabel: true
                          #value: #startClassDocumentation
                          #activeHelpKey: #helpClassDocumentation
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Print Documentation'
                          #translateLabel: true
                          #value: #showBookPrintDocument
                          #activeHelpKey: #helpPrintDocumentation
                      )
                       #(#MenuItem
                          #label: '-'
                      )
                       #(#MenuItem
                          #label: 'Active Help'
                          #translateLabel: true
                          #value: #toggleActiveHelp:
                          #activeHelpKey: #helpShowHelp
                          #indication: #activeHelp
                      )
                    ) nil
                    nil
                )
            )
          ) nil
          nil
      )
!

menuToolbar
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:NewLauncher andSelector:#menuToolbar
     (Menu new fromLiteralArrayEncoding:(NewLauncher menuToolbar)) startUp
    "

    <resource: #menu>

    ^
     
       #(#Menu
          
           #(
             #(#MenuItem
                #label: 'open workspace'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #toolsWorkspace
                #argument: 'Workspace'
                #labelImage: #(#ResourceRetriever nil #startWorkspaceIcon)
            )
             #(#MenuItem
                #label: 'open file browser'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #fileFileBrowser
                #argument: 'FileBrowser'
                #labelImage: #(#ResourceRetriever nil #startFileBrowserIcon)
            )
             #(#MenuItem
                #label: 'save image'
                #isButton: true
                #value: #saveImageAs
                #activeHelpKey: #fileSaveImageAs
                #labelImage: #(#ResourceRetriever nil #saveImageIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'open system browser'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #classesSystemBrowser
                #argument: 'SystemBrowser'
                #labelImage: #(#ResourceRetriever nil #startSystemBrowserIcon)
            )
             #(#MenuItem
                #label: 'System Browser On Class'
                #isButton: true
                #activeHelpKey: #classesSystemBrowserOnClass
                #labelImage: #(#ResourceRetriever nil #startSystemBrowserOnHistoryClassIcon)
                #submenuChannel: #menuClassHistory
            )
             #(#MenuItem
                #label: 'open changes browser'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #toolsChangesBrowser
                #argument: 'ChangesBrowser'
                #labelImage: #(#ResourceRetriever nil #startChangesBrowserIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'open GUI Builder'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #toolsGUIPainter
                #argument: 'UIPainter'
                #labelImage: #(#ResourceRetriever nil #startUIPainterIcon)
            )
             #(#MenuItem
                #label: 'open menu editor'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #toolsMenuEditor
                #argument: 'MenuEditor'
                #labelImage: #(#ResourceRetriever nil #startMenuEditorIcon)
            )
             #(#MenuItem
                #label: 'open image editor'
                #isButton: true
                #value: #openApplication:
                #activeHelpKey: #toolsImageEditor
                #argument: 'ImageEditor'
                #labelImage: #(#ResourceRetriever nil #startImageEditorIcon)
            )
             #(#MenuItem
                #label: ''
            )
             #(#MenuItem
                #label: 'garbage collect and compress'
                #isButton: true
                #value: #compressingGarbageCollect
                #activeHelpKey: #systemGarbageCollectAndCompress
                #labelImage: #(#ResourceRetriever nil #garbageCollectIcon)
            )
          ) nil
          nil
      )
! !

!NewLauncher class methodsFor:'resources'!

garbageCollectIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#garbageCollectIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher garbageCollectIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'DQD@@@.;.1D[DQDQD@@QDP@@.;.;,[,@@ADP@ADQ@@.;@@.;.1@@@A@@DQD@B;@@@[.;DCH@D@@QDP@K,@@K.;,Q@2@P@ADQ@K.;@@DQDQDPL @@DQDKB;B0@QDQ@@@C@@@QD[B0B0,ADP@"H"@@@ADQ@@@@@@DQ@P@@@0@@DQ@@@@C 8@@ADQL3@@@Q@@@@;.;.@@DCL0H@@@@@@@@NC @@@PLC@ @@@@@@C.;.8@@A@0LB@@@@@@@@8N@@@@DC@0H@@@@@B (@@AD@@PLC@ @@@@****@LG@@A@0LB@@@@@JB CL3L0@DC@0H@@@B***(@0L@Q@SLCL @@@@(J@L3L3AD@L"H @@@@@QDQC@0QDQD@@@DP@@@ADQD@@@@QD@@@@@@@@ @B@ @B@@HB@ H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B@@H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@H@@@H@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@G1@@@C>0@@A1=0@@XO^@@FG30@C0@^@AZ@? @)P?8@@@O>@@B#? @C<?8@@TO>@@_#? @B ?8@E@O>@G9S? @)>?8@?JO>@EO3? @APO @@@@@@]7]7\DUUUDAEUUQ@U7]5\EUUUTAUUUU@]U]W\@@a') ; yourself); yourself]!

saveImageIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#saveImageIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher saveImageIcon'
        ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UPSL3L0A@ET7L3L0?PAUML3L3OT@US\3L3C5@ET43L3L?PAUM3L3LO4@USSL3L3=@ET7L3L0?PAUML3L3O4@US\3L3C=@ET43L3L?PAUM@@@@O4@US?????=@ET?UUUU?PAUO7??6?4@US=T?=+=@ET?ZO?Z?PAUO4C?6/4@U]U**)WU@ET@@@@@@@AUUUUUUUUU%Y%UUUTE%%UUUUTU)UEUUUUEUUUUUUVYUUTEUTUUUUDUAUUUUUUQUPUUVUUUUUTU%P@a') ; colorMapFromArray:#[255 255 255 0 0 0 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C???@@???0@O??<@C???@@???0@O??<@C???@@???0@O??<@C???@@???0@O??<@C???@@???0@O??<@C???@@???0@O??<@C??>@@@@@@@@@@@@;*9R<H*(W)BJ*E:@S.9R,B)HT)@*REJP:$9R<@@a') ; yourself); yourself]!

startChangesBrowserIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startChangesBrowserIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startChangesBrowserIcon'
        ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@B****@@@@@@@@@ @@@B****H@@@@@@@@"@@@C????H @@@@@@@2H@@C????L"@@@@@@@3H@@AUUUUL2@@@@@@@SL@@AUUUUD3@@@_=UUQL@@@EUUUTS@@@A]7UUD@@@@U7]5Q@@@@E7]5T@@@@AUUUU@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BH@@@@@@@@LB@L@@@@@@@@@@@@@@@@J@@@@@@@@@@@@@@@@@@H@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@??8@@O?>@@O?? @C??8@C??>@@??? @???8@O??>@O??? C??? C???8@???8@O??>@C??>@@??? @O?? @C??8@@??8@@O?>@@@@@@@@@@@@@Z.$7LH+-YDBJ+TQ@#.=WHH*+UABJ*5PPZ*$7X@@a') ; yourself); yourself]!

startFileBrowserIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startFileBrowserIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startFileBrowserIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@CLA&Y&Y&Y&X@@@@@@@@L0F@@@@@@A @@@@@@@@3@XN;.;.8F@@@@@@@@CLA ;.@@@@@@@@@@@@@L0FC.8O[6=/[0@@@@@@3@X@; [6=/[6@@@@@@CLA DNC6<@@F<@@@@@@L0F@A@F= [0= @@@@@@3@X@@P=/[6=/@@@@@@CLA @@A/[6=/X@@@@@@L0FC0@O[6=/[0@@@@@@3@XF<@@@@@@@@@@@@@CLA = @@@@@@@@@@@@@L0FA/[6=/A @@@@@@@@3@XO[6=/XF@@@@@@@@CLA @@@@@@X@@@@@@@@L0FY&Y&Y&Y @@@@@@@@C@Y&Y&Y&Y&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C @b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'A??<@@_??@@G??0@A??<@@_??8@G??>@A??? @_??8@G??>@A??? @_??8@G??>@A??? @_??@@G??0@A??<@@_??@@G??0@@??<@@G??@@@@@@@G.P=0AADHP@PQBD@GDP8 AADHD@PQBA@DN^=0@@a') ; yourself); yourself]!

startImageEditorIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startImageEditorIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startImageEditorIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@M7]7]7]7]7]7]@@@@@@@@@@@@@@@@@@@@@@@@@"H"H"HDQEUVY @@@@@BH"H3L QDUUY&@@@@@@HA@#L2ADQUU&X@@@@@@"H"H"HH"I&W]0@@@@@BL3L3L "H&Y]7@@@@@@H"H"H"BH"Y%7\@@@@@@#L3L3HDQEUVY @@@@@BH"H"H QDUUY&@@@@@@H3L3L2ADQUU&X@@@@@@"H"H"HH"I&W]0@@@@@BL#L3L "H&Y]7@@@@@@H2L3L2BH"Y%7\@@@@@@"H"H"HBH"H"H @@@@@@@@@@@@@@@@@@@@@@@@H"H"H"H"H"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@0@0@0L@L@@@@@@@@@@0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@L@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???8@O??>@C??? @???8@O??>PC???&@???90O??>^C???''0???90O??>TC???  ???8HO??>AC??? P???8@O??>@C??? @???8@@@@@@@@@@@@;[7/@D>%J@AJ)P @RK5.@D"%J@AH)R @:JW/@@@a') ; yourself); yourself]!

startMenuEditorIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startMenuEditorIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startMenuEditorIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@DQDQDQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@QH"H DQHQD"H @@@@@ATBH"@RHBH H"@@@@@@H@H"HAT%UUUUT@@@@@@%H"H D%IRT%IP@@@@@BUQIU@UIRT%IR@@@@@@IRHBHAIRT%IRT@@@@@@%H"H ERT%IRT @@@@@BUQIU@RT%IRT%@@@@@@IRHBHAT%IRT%H@@@@@@%H"H D%IRT%IP@@@@@BUQIU@UIRT%IR@@@@@@H"HBHAIRT%IRT@@@@@@"H"H IRT%IRT @@@@@@@@@@@@@@@@@@@@@@@@H"H"H"H"H"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@APT@@@@@@@@@@@@@@@@@T@@@@@@@@@@@@@@@@@@@@@@@@@T@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@T@T@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 255 0 0 127 127 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 0 255 127 0 0 0 127 0 0 0 127 127 127 0 127 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???8@O??>@C??? @???8@O??>PC???&@???90O??>^C???''0???90O??>TC???  ???8HO??>AC??? P???8@O??>@C??? @???8@@@@@@@@@@@@6=D$@O(YI@B*GRP@"9T$@H(WI@BJD2P@"=D<@@@a') ; yourself); yourself]!

startSystemBrowserIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startSystemBrowserIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startSystemBrowserIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@ADQDQDQG0@@@@@@@@@@D"H"H"H.@@@@@@@@@@@RH"H"H"8@@@@@@@@@@O;.;.;.; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@SL3L3L>@@@@@@@@@@@O;.;.;.8@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@VY&Y&Y.@@@@@@@@@@@O;.;.;.8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@N@NC @@8@@@C @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@@@@@@8@C @@@@8b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@@O?<@@C??@@@??0@@O?<@@C??@@@@ @@@@H@@@@B@?? A0O?8@_??>@G@?? @ O?8@H@@@@B@?? A0O?8@_??>@G@?? @@O?8@@@@@@@@@@@9O\7\IRTQDBD%DQ@!!OH''HHRQEABT$QPP99]7\@@a') ; yourself); yourself]!

startSystemBrowserOnHistoryClassIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startSystemBrowserOnHistoryClassIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startSystemBrowserOnHistoryClassIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@ADQDQDQG0@@@@@@@@@@D"H"H"H.@@@@@@@@@@@RH"H"H"8@@@@@@@@@@O;.;.;.; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@SL3L3L>@@@@@@@@@@@O;.;.;.8@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@VY&Y&Y.@@@@@@@@@@@O;.;.;.8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C @@@@8@8@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@8@8@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@@O?<@@C??@@@??0@@O?<@@C??@@@@ @@@@H@@@@B@?? A0O?8@_??>@G@?? @ O?8@H@@@@B@?? A0O?8@_??>@G@?? @@O?8@@@@@@@@@@@%]7/TITIJUBUBR%P=H$/TIQIJRBTRR$ %\'')P@@a') ; yourself); yourself]!

startUIPainterIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startUIPainterIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startUIPainterIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@DQDQDQDQDQDQD@@@@@@@@@@@@@@@@@@@@@@@@@3H"H DQHQD"H @@@@@CLBH"@RHBH H"@@@@@@H@H"HAT%UUUUT@@@@@@%H"H D%IRT%IP@@@@@BUSMU@UIRT%IR@@@@@@IRLBHAIRT%IRT@@@@@@%H"H ERT%IRT @@@@@BUSMU@RT%IRT%@@@@@@IRLBHAT%IRT%H@@@@@@%H"H D%IRT%IP@@@@@BUSMU@UIRT%IR@@@@@@H"LBHAIRT%IRT@@@@@@"H"H IRT%IRT @@@@@@@@@@@@@@@@@@@@@@@@H"H"H"H"H"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@T@AP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@T@@@AP@E@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 255 255 0 0 127 127 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 0 255 127 0 0 0 127 0 0 0 127 127 127 0 127 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???8@O??>@C??? @???8@O??>PC???&@???90O??>^C???''8???90O??>TC???  ???8HO??>A#??? X???8@O??>@C??? @???8@@@@@@@@@@@@>QN@@H$Q@@BADP@@.QD@@H$Q@@BIDP@@>_N@@@@a') ; yourself); yourself]!

startWorkspaceIcon
    "This resource specification was automatically generated
     by the ImageEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the ImageEditor may not be able to read the specification."

    "
     ImageEditor openOnClass:self andSelector:#startWorkspaceIcon
    "

    <resource: #image>

    ^Icon
        constantNamed:#'NewLauncher startWorkspaceIcon'
        ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@M7]7]7]7]7]7]7]@@@@@@@@@@@@@@@@@@@@@@@QDQDQDQDQDQDQ@0@@@AUPUUUUAUAQDQDB@@@@EUAUUUTE@@DQDPH@@@@P@E@@UPUPTQDQ@ @@@AAPTEAUAUAQDQDB@@@@D@AP@ETET@DQDPH@@@@QDQDQDQDQEADQ@ @@@ADQDQDQDQDTPQDB@@@@DQDQDQDQDQQDDPH@@@@QDQDQDQDQEDDQ@ @@@ADQDQDQDQDQEADB@@@@DQDQDQDQDQDTDPH@@@@QDQDQDQDQDQDQ@0@@@@@@@@@@@@@@@@@@@@@@L"H"H"H"H"H"H0L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@@L@@C@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@@L@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'????@O???0C???<@????@O???0C???<@????@O???0C???<@????@O???0C???<@????@O???0C???<@????@O???0C???<@????@@@@@@@@@@@@ //R@HJJT BB"%P@$(/X@IJJU@BR"%H@[O)R@@@a') ; yourself); yourself]! !

!NewLauncher methodsFor:'aspects'!

enableDangerousMenuItemsInRemoteLauncher

    |holder|
    (holder := builder bindingAt:#enableDangerousMenuItemsInRemoteLauncher) isNil ifTrue:[
        builder aspectAt:#enableDangerousMenuItemsInRemoteLauncher put:(holder :=  true asValue).
    ].
    ^ holder
!

javaSupportPresent
    ^ (JavaVM notNil and:[JavaVM isBehavior and:[JavaVM isLoaded]]) asValue

    "Created: / 13.2.1998 / 14:25:59 / cg"
    "Modified: / 13.2.1998 / 14:26:31 / cg"
! !

!NewLauncher methodsFor:'change & update'!

update:something with:aParameter from:changedObject
    "care for project changes & update my infoView"

    ((something == #currentProject) or:[changedObject == Project]) ifTrue: [self updateInfo]

!

updateInfo
    "update the infoView from the current project"

    |project projectName projectDir packageName defNameSpace msg args projectInfo|

    (Project isNil or:[(project := Project current) isNil]) ifTrue:[
        projectName := '* none *'.
        projectDir := '.'.
        packageName := '* none *'.
    ] ifFalse:[
        projectName := project name.
        projectDir := project directory.
        packageName := project packageName.
        defNameSpace := project defaultNameSpace.
    ].
    defNameSpace isNil ifTrue:[
        defNameSpace := Smalltalk.
    ].

    defNameSpace == Smalltalk ifTrue:[
        msg := 'Project: ''%1'' fileOut to: ''%3'' package: ''%2'''.
        args := Array 
                    with:projectName
                    with:packageName 
                    with:(projectDir contractTo:30).
    ] ifFalse:[
        msg := 'Project: ''%1'' fileOut to: ''%3'' package: ''%2''  nameSpace: %4'.
        args := Array 
                        with:projectName
                        with:packageName 
                        with:(projectDir contractTo:30)
                        with:defNameSpace name.
    ].

    self valueOfInfoLabel value:(projectInfo := resources string:msg withArgs:args).
    ^projectInfo
! !

!NewLauncher methodsFor:'help'!

defaultInfoLabel

    ^self updateInfo

! !

!NewLauncher methodsFor:'private'!

changeViewStyleTo:newStyle

    newStyle notNil ifTrue:[
        self withWaitCursorDo:[
            transcript showCR:'change style to ' , newStyle , ' ...'.
            View defaultStyle:newStyle asSymbol.
        ].
        self reOpen
    ]

!

findWindow:title
    "a helper for find & destroy and find & raise operations;
     let user choose a view and return it; return nil on cancel"

    |knownTopViews nameList box|

    knownTopViews := IdentitySet new.
    Screen allScreens do:[:aScreen |
        aScreen knownViews do:[:aView |
            |top showIt wg|

            aView notNil ifTrue:[
                top := aView topView.
                (top isKindOf:DebugView) ifTrue:[
                    "/ although modal, show it.
                    showIt := top realized
                ] ifFalse:[
                    wg := top windowGroup.
                    showIt := (wg notNil and:[wg isModal not]).
                ].
                showIt ifTrue:[
                    knownTopViews add:top
                ]
            ]
        ]
    ].

    knownTopViews := knownTopViews asOrderedCollection.
    knownTopViews sort:[:v1 :v2 | |l1 l2|
                                l1 := v1 label ? 'aView'.
                                l2 := v2 label ? 'aView'.
                                l1 < l2
                       ].
    nameList := knownTopViews collect:[:v | 
                                        |isDead wg p l|

                                        l := v label ? 'aView'.
                                        ((wg := v windowGroup) notNil
                                        and:[(p := wg process) notNil
                                        and:[p state ~~ #dead]]) ifTrue:[
                                            l  
                                        ] ifFalse:[
                                            l , ' (dead ?)'
                                        ]
                                      ].

    box := ListSelectionBox new.
    box noEnterField.
    box list:nameList.
    box label:(resources string:'view selection').
    box title:(resources string:title) withCRs.
    box action:[:selection |
        |v|

        v := knownTopViews at:box selectionIndex.
        box destroy.
        ^ v
    ].
    box extent:400@300.
    box showAtPointer.
    ^ nil

!

fontBoxForEncoding:encodingMatch
    "open a fontBox, showing fonts which match some encoding
     (used when changing to japanese ...)"

    |box y b
     labelDef buttonDef listDef menuDef textDef
     models labels allOfThem filter|

    encodingMatch notNil ifTrue:[
        filter := [:f | f encoding notNil 
                        and:[encodingMatch match:f encoding]].
    ].

    models := OrderedCollection new.
    labels := OrderedCollection new.

    models add:(allOfThem := nil asValue).
    models add:(labelDef := Label defaultFont asValue).
    models add:(buttonDef := Button defaultFont asValue).
    models add:(listDef := SelectionInListView defaultFont asValue).
    models add:(menuDef := MenuView defaultFont asValue).
    models add:(textDef := TextView defaultFont asValue).

    box := Dialog new.
    box label:(resources string:'Font settings').

    models
    with:(resources array:#('all' 'labels' 'buttons' 'lists' 'menus' 'edit text'))
    do:[:model :title |
        |y2 lbl f i|

        f := model value.

        (box addTextLabel:title) adjust:#left.

        y := box yPosition.
        b := box addComponent:(Button label:(resources string:'change ...')) tabable:true.
        b relativeExtent:nil; extent:(b preferredExtent).
        y2 := box yPosition.
        box yPosition:y.
        i := box leftIndent.
        box leftIndent:(b widthIncludingBorder + View viewSpacing).
        (lbl := box addTextLabel:'')
            adjust:#left;
            font:(model value);
            labelChannel:(BlockValue 
                            with:[:v | |f|
                                f := v value.
                                f isNil ifTrue:[
                                    ''
                                ] ifFalse:[
                                    f userFriendlyName
                                ]
                            ]
                            argument:model).
        labels add:lbl.

        box leftIndent:i.
        box yPosition:(box yPosition max:y2).
        box addVerticalSpace.
        box addHorizontalLine.
        box addVerticalSpace.

        b action:[
            |f|

            f := FontPanel 
                fontFromUserInitial:(model value) 
                              title:(resources string:'font for %1' with:title)
                             filter:filter.
            f notNil ifTrue:[
                model == allOfThem ifTrue:[
                    models do:[:m | m value:f].
                    labels do:[:l | l font:f]
                ] ifFalse:[
                    model value:f.  
                    lbl font:f.
                ].
            ]
        ].
        model == allOfThem ifTrue:[
            box addVerticalSpace
        ]
    ].

    box addAbortButton; addOkButton.
    (box addButton:(Button label:(resources string:'defaults')) before:nil)
        action:[
            "/ fetch defaults
            View updateAllStyleCaches.
            labelDef value: Label defaultFont.
            buttonDef value: Button defaultFont.
            listDef value: SelectionInListView defaultFont.
            menuDef value: MenuView defaultFont.
            textDef value: TextView defaultFont.
        ].

    box open.
    box accepted ifTrue:[
        Label defaultFont:labelDef value.
        Button defaultFont:buttonDef value.
        Toggle defaultFont:buttonDef value.
        SelectionInListView defaultFont:listDef value.
        MenuView defaultFont:menuDef value.
        PullDownMenu defaultFont:menuDef value.
        TextView defaultFont:textDef value.
        EditTextView defaultFont:textDef value.
        CodeView defaultFont:textDef value.
    ].
    box destroy.
    ^ box accepted


!

menuClassHistory
    "returns a sub menu on the history of the classes"

    |menu|

    menu := Menu new receiver: self.
    menu addItemGroup: (BrowserView classHistory collect:
        [:histEntry|  
            MenuItem new 
                label: (histEntry upTo: $ ); 
                value: [SystemBrowser open loadFromMessage: histEntry]; 
                activeHelpKey: #classesSystemBrowserOnClass
        ]
    ).
    menu addItem: (MenuItem new label: 'Empty History'; value: [BrowserView classHistory removeAll]; activeHelpKey: #historyEmptyMenu).

    ^menu



!

openApplication: className
     "open an application, given by the classe name."

    self openApplication:className nameSpace:nil
!

openApplication:className nameSpace:aNameSpace
    "open some application, given the classes name.
     Look for it in Smalltalk and the given nameSpace"

    self openApplication:className nameSpace:aNameSpace with:#open
!

openApplication:className nameSpace:aNameSpace with:aSelector
    "open some application, given the classes name.
     Look for it in Smalltalk and the given nameSpace"

    |cls|

    cls := Smalltalk at:className asSymbol.
    cls isNil ifTrue:[
        "/ look if its in the nameSpace
        aNameSpace notNil ifTrue:[
            cls := aNameSpace at:className asSymbol
        ]
    ].

    cls isNil ifTrue:[
        self warn:(resources string:'Sorry, the %1 class is not available.' with:className).
    ] ifFalse:[
        Autoload autoloadFailedSignal handle:[:ex |
            self warn:(resources string:'Sorry, the %1 class seems to be not available.' with:className)
        ] do:[
            self withWaitCursorDo:[cls perform:aSelector]
        ]
    ]

!

saveAllViews
    "tell each topview that we are going to terminate and give it chance
     to save its contents."

    ObjectMemory changed:#aboutToExit
!

saveScreenImage:anImage defaultName:defaultName
    "save an image into a file 
     - ask user for filename using a fileSelectionBox."

    |fileName|

    fileName := Dialog
                    requestFileName:(resources string:'save image in:')
                    default:(defaultName , '.tiff')
                    ok:(resources string:'save')
                    abort:(resources string:'cancel')
                    pattern:'*.tiff'.

    fileName notNil ifTrue:[
        anImage saveOn:fileName
    ].

    "Modified: / 21.2.1996 / 13:09:28 / cg"
    "Created: / 29.1.1998 / 23:20:36 / cg"
!

showDocumentation:aRelativeDocFilePath
    "open an HTML browser on some document"

    "
     although that one is not yet finished,
     its better than nothing ...
    "
    HTMLDocumentView notNil ifTrue:[
        self withWaitCursorDo:[
            "
             temporary kludge;
             not all machines can autoload binaries;
             however, on my SGI (which can) we want it
             to load automatically.
            "
            HTMLDocumentView isLoaded ifFalse:[
                ErrorSignal catch:[HTMLDocumentView autoload]
            ].
            HTMLDocumentView isLoaded ifTrue:[
                HTMLDocumentView openFullOnDocumentationFile:aRelativeDocFilePath. 
                ^ self
            ].
        ]
    ].

    self warn:'Sorry, the ST/X HTML reader is not
included in this release.

Please use Mosaic, netscape, chimera or any
other HTML viewer to see the documentation.

The documentation is found in the ''doc/online'' directory.'.

    "Modified: / 25.2.1998 / 21:24:20 / cg"
! !

!NewLauncher methodsFor:'queries'!

preferredExtent

    ^super preferredExtent max: Screen current extent//(2.5@3.5)


!

processName
    "for monitors only - my name"

    ^ 'ST/X Launcher'

!

transcript
    "my transcript"

    ^ transcript
! !

!NewLauncher methodsFor:'startup / release'!

addTopViewsToCurrentProject
    "ignored here - the launcher is always global (i.e. not project private)."

    ^ self

!

allButOpenInterface:anInterface
    "sent by my superclass to open up my interface"

    "/ if there is already a transcript on my device,
    "/ I am a slave launcher with limited functionality.

    Transcript notNil ifTrue:[
        Transcript ~~ Stderr ifTrue:[
            isMainLauncher := (Transcript graphicsDevice == device).
            self enableDangerousMenuItemsInRemoteLauncher value: isMainLauncher.
        ] ifFalse:[
            isMainLauncher := true
        ]
    ] ifFalse:[
        isMainLauncher := true
    ].

    super allButOpenInterface:anInterface.

    self setupTranscript; updateInfo.
    Project notNil ifTrue: [Project addDependent:self].
    self class openLaunchers add: self.
    ^ builder

    "Created: / 5.2.1998 / 19:45:07 / cg"
    "Modified: / 5.2.1998 / 19:56:43 / cg"
!

closeRequest

    (self confirm:(resources string:'really close %1 ?' with:self class name)) ifTrue:[
        super closeRequest
    ]

!

postOpenWith:aBuilder
    "increase my priority"

    self builder window windowGroup process priority:(Processor userSchedulingPriority + 1).
    super postOpenWith:aBuilder.
    self startClockOnTimedBlock: 
    [
        |now hours minutes suffix|

        now := Time now.

        hours := now hours.
        minutes := now minutes printString.
        suffix := ''.

        (resources at:'TIME_FORMAT' ifAbsent:12) == 12 ifTrue:[
            suffix := ' am '.  
            hours > 12 ifTrue: [hours := hours - 12. suffix := ' pm '].
        ].

        minutes size = 1 ifTrue: [minutes := '0', minutes].

        self valueOfTimeLabel value: hours printString, ':', minutes, suffix.

        Processor removeTimedBlock: timeBlock.
        Processor addTimedBlock: timeBlock afterSeconds: 1
    ].

!

reOpen
    "reopen a new launcher.
     for now (since style & language settings currently do
     not affect living views ...)"

    |contents builder newLauncher|

    contents := transcript endEntry; list.
    builder := self class openAt:(self window origin).
    builder window waitUntilVisible.
    newLauncher := builder application.
    newLauncher transcript list:contents; hideCursor; scrollToBottom; cursorToEnd; showCursor.
    DebugView newDebugger.

    "Modified: / 5.2.1998 / 20:08:31 / cg"
!

restarted
    "image restart - since WindowGroup recreates the process with
     the default priority, we have to raise the prio again.
     Mhmh - this looks like a bug to me ...
     Also, the cursor (which was stored as a write or waitCursor) must
     be reset to normal."

    Processor activeProcess priority:(Processor userSchedulingPriority + 1).
    builder window extent: self preferredExtent.
    super restarted

!

saveAndTerminateRequest
    "some windowManagers can send this, to shutDown an application
     but let it save its state before, for later restart. 
     Although I have not yet encountered such a windowManager,
     we are already prepared for this ;-)"

    self snapshot.
    super saveAndTerminateRequest

!

setupTranscript 
    "create the transcript view"

    |launcher oldLauncher|

    "/ check if this is an additional launcher on a remote display.
    "/ if so, do not close the real launcher.

    (Transcript notNil and:[Transcript ~~ Stderr]) ifTrue:[
        isMainLauncher ifTrue:[
            launcher := Transcript topView application
        ] ifFalse:[
            launcher := self class current.
        ].
        launcher notNil ifTrue:[
            launcher window graphicsDevice == device ifTrue:[
                OpenLaunchers notNil ifTrue:[
                    OpenLaunchers removeIdentical:launcher ifAbsent:nil.
                ].
                (oldLauncher := Smalltalk at: #Launcher) notNil
                    ifTrue: [oldLauncher openLaunchers removeIdentical:launcher ifAbsent:nil].
                launcher close
            ]
        ]
    ].

    transcript := (builder componentAt: #transcriptView) subViews first.

    isMainLauncher ifTrue:[
        transcript beTranscript.
    ] ifFalse:[
        transcript showCR:'**************** Notice ***********************'.
        transcript showCR:'**       this is NOT the Transcript          **'.
        transcript showCR:'** The real Transcript is on the main screen **'.
        transcript showCR:'**                                           **'.
        transcript showCR:'** Menus affecting common state are disabled **'.
        transcript showCR:'***********************************************'.
    ]

    "Modified: / 29.1.1998 / 22:06:03 / cg"
!

uninitialize

    super uninitialize.

    Display beep.
    OpenLaunchers notNil ifTrue:[OpenLaunchers removeIdentical:self ifAbsent:nil].
    Project notNil ifTrue:[Project removeDependent:self]
! !

!NewLauncher methodsFor:'user actions - about'!

openLicenseConditions
    "open an HTML browser on the 'LICENCE' document"

    self withWaitCursorDo:[
        |lang doc|

        ((lang := Smalltalk language) = 'de'
        or:[lang = 'german']) ifTrue:[
            doc := 'german/LICENCE_STX.html'
        ] ifFalse:[
            doc := 'english/LICENCE_STX.html'
        ].
        doc := resources at:'LICENCEFILE' default:doc.
        self showDocumentation:('../' , doc)
    ]

    "Created: / 5.2.1998 / 21:43:19 / cg"
    "Modified: / 25.2.1998 / 21:23:41 / cg"
! !

!NewLauncher methodsFor:'user actions - classes'!

browseAllBreakAndTracePoints
    "open a browser showing all breakPointed/traced methods
     (but, to get rid of them, there is also a menu itme to remove them all)"

    SystemBrowser browseMethods: WrappedMethod allInstances title:'all breakPointed/traced methods'

!

browseImplementors
    "open an implementors- browser after asking for a selector"

    |enterBox selector|

    enterBox := EnterBox 
                    title:(resources at:'Browse implementors of:') withCRs
                    okText:(resources at:'browse')
                    action:[:acceptedString | selector := acceptedString].
    enterBox showAtPointer.

    selector notNil ifTrue:[
        self withWaitCursorDo:[
            SystemBrowser browseImplementorsOf:selector
        ]  
    ].

!

browseResources
    "open a resource- browser after asking for a resource string"

    |box resourceHolder valueHolder component rsrc value t anyString|

    anyString := resources string:'* any *'.

    resourceHolder := ValueHolder newString.
    valueHolder := '*' asValue.

    box := DialogBox new.
    box label:(resources at:'Resource search:').
    component := box addTextLabel:(resources at:'Search for methods which contain a\particular resource specification') withCRs.
    component adjust:#left.
    box addVerticalSpace:10.

    component := box addTextLabel:(resources at:'Resource symbol (empty for any; no matchPattern allowed):') withCRs.
    component adjust:#left.
    component :=  box addComboBoxOn:resourceHolder tabable:true.
    component list:((Array with:anyString) , #('canvas' 'menu' 'keyboard' 'style' 'image' 'programMenu' nil 'needsFix')).

    component := box addTextLabel:(resources at:'Resource value (* for any; matchPattern is allowed):') withCRs.
    component adjust:#left.
    box addInputFieldOn:valueHolder tabable:true.

    box addVerticalSpace:10.
    box addHelpButtonFor:'programming/language.html#RESOURCEDEFS'.
    box addAbortButton; addOkButton.

    box showAtPointer.
    box destroy.

    box accepted ifTrue:[
        rsrc := resourceHolder value.
        value := valueHolder value.

        (rsrc isNil or:[rsrc isEmpty or:[rsrc = '*' or:[rsrc = anyString]]]) ifTrue:[
            t := 'methods with any resource'.
            rsrc := nil
        ] ifFalse:[
            t := 'methods with #' , rsrc , '-resource'.
            rsrc := rsrc withoutSeparators asSymbol
        ].
        (value isNil or:[value isEmpty or:[value = '*']]) ifTrue:[
            t := t , ' and any value'.
            value := nil
        ] ifFalse:[
            t := t , ' and value ' , value.
        ].
        self withWaitCursorDo:[
            SystemBrowser browseForResource:rsrc
                          containing:value
                          in:(Smalltalk allClasses)
                          title:t
        ]  
    ].

!

browseSenders
    "open a senders- browser after asking for a selector"

    |enterBox selector|

    enterBox := EnterBox 
                    title:(resources at:'Browse senders of:') withCRs
                    okText:(resources at:'browse')
                    action:[:acceptedString | selector := acceptedString].
    enterBox showAtPointer.

    selector notNil ifTrue:[
        self withWaitCursorDo:[
            SystemBrowser browseAllCallsOn:selector
        ]  
    ].

!

browseUndeclared
    "open a browser on methods refering to undeclared variables"

    self withWaitCursorDo:[
        SystemBrowser 
            browseReferendsOf:(Smalltalk underclaredPrefix , '*')
            title:(resources string:'references to undeclared variables')
            warnIfNone:true
    ]

!

removeAllBreakAndTracePoints
    "remove all break- and trace points"

    MessageTracer cleanup

!

startClassBrowser
    "open a classBrowser; asks for class"

    SystemBrowser askThenBrowseClass

!

startClassHierarchyBrowser
    "open a classHierarchyBrowser; asks for class"

    SystemBrowser askThenBrowseClassHierarchy

!

startFullClassBrowser
    "open a fullClass systemBrowser; asks for class"

    SystemBrowser askThenBrowseFullClassProtocol

! !

!NewLauncher methodsFor:'user actions - demos'!

openDemo:className
    "open a demo, given its name.
     Looks in both the Smalltalk- and the Demos-Namespace
     for that class."

    self openApplication:className nameSpace:Demos

!

startTicTacToe2
    "opens a 2-user ticTacToe game"

    self openApplication:'TicTacToeGame' nameSpace:Games with:#open2UserGame
! !

!NewLauncher methodsFor:'user actions - file'!

exit
    "saves a snapshot image and exits, after asking for a fileName"

    |fileName saveAndExit box|

    box := EnterBox2 title:'Save image before exiting?' 
        okText:' Save & Exit ' 
        abortText:'Cancel'
        action:[:str|fileName := str. saveAndExit := true].
    box label: 'Exiting ST/X'.
    box initialText: ObjectMemory nameForSnapshot.
    box okText2:'Exit' action2:[:str|saveAndExit := false]; showAtPointer.

    saveAndExit notNil
    ifTrue:[
        saveAndExit
        ifTrue:
        [
            self saveImageAs: fileName
        ].
        Smalltalk exit
    ]



!

objectModuleDialog
    "opens a moduleInfo dialog"

    |allModules moduleNames
     allObjects methodObjects methodNames 
     cObjects cObjectNames
     otherObjects otherObjectNames
     box l handles unloadButton
     list1 list2 listView1 listView2
     y panel 
     showBuiltIn showModules showMethods showCObjects showOthers
     moduleListUpdater check canDoIt menu|

    showBuiltIn := true asValue. 
    canDoIt := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles].

    showModules := canDoIt asValue. 
    showMethods := canDoIt asValue.
    showCObjects := canDoIt asValue.
    showOthers := canDoIt asValue.

    list1 := SelectionInList new.
    list2 := SelectionInList new.

    moduleListUpdater := [
            |l|

            list2 list:nil.

            l := Array new.
            handles := Array new.

            (showModules value or:[showBuiltIn value]) ifTrue:[
                allModules := ObjectMemory binaryModuleInfo asOrderedCollection.
                (showBuiltIn value and:[showModules value]) ifFalse:[
                    allModules := allModules select:[:i |
                        |wantToSee|

                        wantToSee := i dynamic.
                        showBuiltIn value ifTrue:[
                            wantToSee := wantToSee not
                        ].
                        wantToSee
                    ]
                ].

                "/ sorting by reverse id brings newest ones to the top (a side effect)
                allModules sort:[:a :b | (a id) > (b id)].
                moduleNames := allModules collect:[:entry | entry name].
                l := l , moduleNames.
                handles := handles , allModules.
            ].

            showMethods value ifTrue:[
                allObjects := ObjectFileLoader loadedObjectHandles.
                methodObjects := (allObjects select:[:h | h isMethodHandle]) asArray.
                methodNames := methodObjects collect:[:mH | mH method isNil ifTrue:[
                                                                'compiled method - removed' , ' (in ' , mH pathName , ')'
                                                            ] ifFalse:[
                                                                'compiled method ' , mH method whoString , ' (in ' , mH pathName , ')'
                                                            ].
                                                     ].
                l := l , methodNames.
                handles := handles , methodObjects.
            ].

            showCObjects value ifTrue:[
                allObjects := ObjectFileLoader loadedObjectHandles.
                cObjects := (allObjects select:[:h | h isFunctionObjectHandle]) asArray.
                cObjectNames := cObjects collect:[:entry | entry pathName].
                l := l , cObjectNames.
                handles := handles , cObjects.
            ].

            showOthers value ifTrue:[
                allObjects := ObjectFileLoader loadedObjectHandles.
                otherObjects := (allObjects select:[:h | (h isFunctionObjectHandle
                                                         or:[h isMethodHandle
                                                         or:[h isClassLibHandle]]) not]) asArray.
                otherObjectNames := otherObjects collect:[:entry | entry pathName].
                l := l , otherObjectNames.
                handles := handles , otherObjects.
            ].

            list1 list:l.
            unloadButton disable.
        ].

    showBuiltIn onChangeSend:#value to:moduleListUpdater.
    showModules onChangeSend:#value to:moduleListUpdater.
    showMethods onChangeSend:#value to:moduleListUpdater.
    showCObjects onChangeSend:#value to:moduleListUpdater.
    showOthers onChangeSend:#value to:moduleListUpdater.

    box := Dialog new.
    box label:(resources string:'Module dialog').

    listView1 := HVScrollableView for:SelectionInListView miniScrollerH:true.
    listView1 model:list1.
    listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2.
    listView1 action:[:sel |
        |info classNames tabs module|

        listView1 middleButtonMenu:nil.

        box withWaitCursorDo:[
            |nm fileName addr entry1 entry2 entry3 method|

            tabs := TabulatorSpecification unit:#inch positions:#(0 2.6).

            (showModules value or:[showBuiltIn value]) ifTrue:[
                info := allModules at:sel ifAbsent:nil.
            ].
            info isNil ifTrue:[
                "/ selected a method, cObject or unknown

                module := handles at:sel.
                fileName := module pathName.

                module isMethodHandle ifTrue:[

                    (method := module method) isNil ifTrue:[
                        nm := '** removed **'.
                    ] ifFalse:[
                        menu := PopUpMenu
                                    labels:#('inspect' 'browse')
                                    selectors:#(inspect browse).
                        menu actionAt:#inspect put:[ method inspect ].
                        menu actionAt:#browse put:[ |who|
                                                    who := method who.
                                                    SystemBrowser 
                                                        openInClass:(who methodClass) 
                                                        selector:(who methodSelector) 
                                                  ].
                        listView1 middleButtonMenu:menu.

                        nm := (method whoString) asText emphasizeAllWith:(#color->Color blue).
                    ].
                    entry1 := MultiColListEntry new:2 tabulatorSpecification:tabs.
                    entry1 colAt:1 put:'compiled method'; colAt:2 put:nm.

                    entry2 := MultiColListEntry new:2 tabulatorSpecification:tabs.
                    entry2 colAt:1 put:'path'; colAt:2 put:fileName.

                    entry3 := MultiColListEntry new:2 tabulatorSpecification:tabs.
                    entry3 colAt:1 put:'address'; colAt:2 put:('(16r) ' , (method code hexPrintString leftPaddedTo:8 with:$0)).

                    list2 list:(Array with:entry1 with:entry2 with:entry3).
                ] ifFalse:[
                    (module isFunctionObjectHandle 
                    and:[module functions notEmpty]) ifTrue:[

                        menu := PopUpMenu
                                    labels:#('inspect')
                                    selectors:#(inspect).
                        menu actionAt:#inspect put:[ module functions inspect  ].
                        listView1 middleButtonMenu:menu.

                        list2 list:((module functions select:[:f | f notNil])
                                        collect:[:f | |entry|
                                                        entry := MultiColListEntry new:2 tabulatorSpecification:tabs.
                                                        entry colAt:1 put:(f name asText emphasizeAllWith:(#color->Color blue)).
                                                        entry colAt:2 put:('address: (16r) ' , (f code hexPrintString leftPaddedTo:8 with:$0)).
                                                        entry
                                                ]).
                    ] ifFalse:[
                        list2 list:#('nothing known about contents (no functions have been extracted)').    
                    ]
                ].

                unloadButton enable.
            ] ifFalse:[
                "/ selected a package

                "/ fill bottom list with class-info

                classNames := info classNames asSortedCollection.
                classNames := classNames collect:[:cName |
                                |cls entry rev listEntry|

                                listEntry := MultiColListEntry new:2 tabulatorSpecification:tabs.
                                listEntry colAt:1 put:cName.

                                cls := Smalltalk classNamed:cName.
                                cls isNil ifTrue:[
                                    listEntry colAt:2 put:'(class removed)'.
                                ] ifFalse:[
                                    rev := cls binaryRevision.
                                    rev notNil ifTrue:[
                                        cls isLoaded ifFalse:[
                                            entry := '(stub for: ' , rev.
                                        ] ifTrue:[
                                            entry :='(bin: ' , rev.
                                        ].    
                                        cls revision ~= rev ifTrue:[
                                            entry := entry , ' / src: ' , cls revision    
                                        ].
                                        listEntry colAt:2 put:entry , ')'
                                    ] ifFalse:[
                                       cls revision notNil ifTrue:[
                                            listEntry colAt:2 put:'(overloaded by: ' , cls revision , ')' 
                                       ]
                                    ]
                                ].
                                listEntry
                              ].
                list2 list:classNames.
                info dynamic ifTrue:[
                    unloadButton enable.
                ] ifFalse:[
                    unloadButton disable.
                ].
            ]
        ]
    ].


    panel := HorizontalPanelView new.

    panel add:(l := Label label:'show:').
    l adjust:#left; borderWidth:0.
    panel add:(check := CheckBox label:'builtin' model:showBuiltIn).
    box makeTabable:check.
    panel add:(check := CheckBox label:'classLibs' model:showModules).
    canDoIt ifFalse:[
        check disable
    ] ifTrue:[
        box makeTabable:check.
    ].
    panel add:(check := CheckBox label:'methods' model:showMethods).
    canDoIt ifFalse:[
        check disable
    ] ifTrue:[
        box makeTabable:check.
    ].
    panel add:(check := CheckBox label:'c-objects' model:showCObjects).
    canDoIt ifFalse:[
        check disable
    ] ifTrue:[
        box makeTabable:check.
    ].
    panel add:(check := CheckBox label:'others' model:showOthers).
    canDoIt ifFalse:[
        check disable
    ] ifTrue:[
        box makeTabable:check.
    ].

    panel horizontalLayout:#fitSpace.
    "/ panel horizontalLayout:#leftSpace.

    box addComponent:panel tabable:false.

    box addVerticalSpace.
    box addComponent:listView1 tabable:true.
    listView1 topInset:(View viewSpacing + panel preferredExtent y).
    listView1 origin:0.0@0.0 corner:1.0@0.4. "/ ; inset:2.

    l := box addTextLabel:(resources string:'contained classes/subsets:').
    l adjust:#left; borderWidth:0.
    l origin:0.0@0.4 corner:1.0@0.4.
    l topInset:(View viewSpacing).
    l bottomInset:((l preferredExtent y) negated - View viewSpacing).

    listView2 := HVScrollableView for:SelectionInListView  miniScrollerH:true.
    listView2 model:list2; printItems:false.
    box addComponent:listView2 tabable:true.
    listView2 origin:0.0@0.4 corner:1.0@1.0. "/ ; inset:2.
    listView2 disable.

    unloadButton := Button label:(resources string:'unload').
    unloadButton action:[
        self withWaitCursorDo:[
            box withWaitCursorDo:[
                |info idx pathName|

                idx := list1 selectionIndex.
                info := allModules at:idx ifAbsent:nil.

                list1 selectionIndex:nil.

                info isNil ifTrue:[
                    "/ selected a method
                    "/ idx := idx - allModules size.
                    pathName := (handles at:idx) pathName.

                ] ifFalse:[
                    "/ selected a package
                    pathName := info pathName.
                ].
                ObjectFileLoader unloadObjectFile:pathName.
                moduleListUpdater value.
                unloadButton disable.
            ]
        ]
    ].
    moduleListUpdater value.

    box addButton:unloadButton.
    box addAbortButtonLabelled:(resources string:'dismiss').

    y := box yPosition.
    listView2 topInset:(l preferredExtent y + 5).
    listView2 bottomInset:(box preferredExtent y - y).

"/    box width:(400 min:(box device width * 2 // 3)); 
"/        height:(450 min:(box device height - 50)); 
"/        sizeFixed:true.
    box open.

    box destroy.

    "Modified: 17.9.1995 / 16:47:50 / claus"
    "Modified: 18.10.1997 / 03:43:39 / cg"
!

saveImage
    "save image"

    self showCursor:Cursor write.
    [
        (ObjectMemory snapShotOn:ObjectMemory nameForSnapshot) ifFalse:[
            self warn:(resources string:'Failed to save snapshot image (disk full or not writable)').
        ]
    ] valueNowOrOnUnwindDo:[
        self restoreCursors.
    ].

!

saveImageAs
    "save image, after asking for a file name"

    self saveImageAs: (
        FileSelectionBrowser 
            request: 'Save Image As' 
            fileName: ObjectMemory nameForSnapshot
            inDirectory: Filename currentDirectory name
            withFileFilters: #('*.img'))
 
!

saveImageAs: aFileName

    aFileName notNil ifTrue:[
        self showCursor:Cursor write.
        [       
            (ObjectMemory snapShotOn:aFileName) ifFalse:[
                self warn:(resources string:'Failed to save snapshot image (disk full or not writable)').
            ]
        ] valueNowOrOnUnwindDo:[
            self restoreCursors.
        ].
    ].
! !

!NewLauncher methodsFor:'user actions - help'!

activeHelp

    ^helpIsOn ? (helpIsOn := false)
!

showBookPrintDocument
    "open an HTML browser on the 'book'-printing document"

    self showDocumentation:'BOOK.html'
!

startClassDocumentation
    "open an HTML browser on the 'classDoc/TOP' document"

    self showDocumentation:'classDoc/TOP.html'

!

startDocumentationIndex
    "open an HTML browser on the 'index' document"

    self showDocumentation:'index.html'
!

startDocumentationTool
    "open an HTML browser on the 'TOP' document"

    self showDocumentation:'TOP.html'

!

startWhatsNewDocumentation
    "open an HTML browser on the 'whatsNew.html' document"

    self showDocumentation:'whatsNew.html'

!

toggleActiveHelp:aBoolean
    "turn on/off active help"

    ActiveHelp notNil ifTrue:[
        helpIsOn := aBoolean.
        helpIsOn ifTrue:[
            ActiveHelp start
        ] ifFalse:[
            ActiveHelp stop
        ]
    ].

! !

!NewLauncher methodsFor:'user actions - settings'!

compilerSettings
    "open a dialog on compiler related settings"

    |box warnings warnSTX warnUnderscore warnDollar warnOldStyle 
     allowDollar allowUnderscore immutableArrays
     warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox
     warnCompatibility warnCompatibilityBox warnDollarBox
     stcCompilation compilationList stcCompilationOptions stcIncludes stcDefines stcOptions
     stcLibraries stcLibraryPath cc ccOptions historyLines fullHistoryUpdate catchRedefs keepSourceOptions keepSource  
     constantFoldingOptions constantFolding justInTimeCompilation 
     warnEnabler check component oldIndent t supportsJustInTimeCompilation y
     y2 fullDebugSupport yMax
     compileLazy loadBinaries canLoadBinaries|

    canLoadBinaries := ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles].
    loadBinaries := Smalltalk loadBinaries asValue.
    compileLazy := Autoload compileLazy asValue.


    warnings := Compiler warnings asValue.

    warnSTX := Compiler warnSTXSpecials asValue.
    warnUnderscore := Compiler warnUnderscoreInIdentifier asValue.
    warnDollar := Compiler warnDollarInIdentifier asValue.
    warnOldStyle := Compiler warnOldStyleAssignment asValue.
    warnCommonMistakes := Compiler warnCommonMistakes asValue.
    warnCompatibility := Compiler warnPossibleIncompatibilities asValue.
    allowUnderscore := Compiler allowUnderscoreInIdentifier asValue.
    allowDollar := Compiler allowDollarInIdentifier asValue.
    immutableArrays := Compiler arraysAreImmutable asValue.

    constantFoldingOptions := #( nil #level1 #level2 #full ).
    constantFolding := SelectionInList new list:(resources array:#('disabled' 'level1 (always safe)' 'level2 (usually safe)' 'full')).
    constantFolding selectionIndex:3.

    stcCompilationOptions := #( always default never).
    stcCompilation := SelectionInList new 
                        list:(resources array:#('always' 
                                                'primitive code only' 
                                                'never'
                                               )).
    stcCompilation selectionIndex:2.
    (supportsJustInTimeCompilation := ObjectMemory supportsJustInTimeCompilation)
    ifTrue:[
        justInTimeCompilation := ObjectMemory justInTimeCompilation:nil.
        fullDebugSupport := ObjectMemory fullSingleStepSupport:nil.
    ] ifFalse:[
        justInTimeCompilation := false.
        fullDebugSupport := (Compiler lineNumberInfo == #full) asValue.
    ].
    justInTimeCompilation := justInTimeCompilation asValue.
    fullDebugSupport := fullDebugSupport asValue.

    stcIncludes := Compiler stcCompilationIncludes asValue.
    stcDefines := Compiler stcCompilationDefines asValue.
    stcOptions := Compiler stcCompilationOptions asValue.
    ccOptions := Compiler ccCompilationOptions asValue.
    cc := Compiler ccPath asValue.

    ObjectFileLoader notNil ifTrue:[
        (t := ObjectFileLoader searchedLibraries) notNil ifTrue:[
            stcLibraries := (String fromStringCollection:t separatedBy:' ') asValue.
        ].
        (t := ObjectFileLoader libPath) notNil ifTrue:[
            stcLibraryPath := t asValue.
        ]
    ].

    catchRedefs := Class catchMethodRedefinitions asValue.
    historyLines := HistoryManager notNil and:[HistoryManager isLoaded and:[HistoryManager isActive]].
    historyLines ifFalse:[
        fullHistoryUpdate := false    
    ] ifTrue:[
        fullHistoryUpdate := HistoryManager fullHistoryUpdate asValue.
    ].
    historyLines := historyLines asValue.

    keepSourceOptions := #( keep reference absReference sourceReference discard ).
    keepSource := SelectionInList new list:(resources array:#('keep as string' 'reference to filename' 'reference to full path' 'append and ref in `st.src''' 'discard' )).
    keepSource selectionIndex:1.

    warnEnabler := [
              warnings value ifTrue:[
                warnSTXBox enable. 
                warnOldStyleBox enable.
                warnCommonMistakesBox enable.
                warnCompatibilityBox enable.
                allowUnderscore value ifTrue:[
                    warnUnderscoreBox enable.
                ] ifFalse:[
                    warnUnderscoreBox disable.
                ].
                allowDollar value ifTrue:[
                    warnDollarBox enable.
                ] ifFalse:[
                    warnDollarBox disable.
                ].
              ] ifFalse:[
                warnSTXBox disable. 
                warnUnderscoreBox disable.
                warnDollarBox disable.
                warnOldStyleBox disable.
                warnCommonMistakesBox disable.
                warnCompatibilityBox disable.
              ]].

    warnings onChangeSend:#value to:warnEnabler.
    allowUnderscore onChangeSend:#value to:warnEnabler.
    allowDollar onChangeSend:#value to:warnEnabler.

    box := DialogBox new.
    box label:(resources string:'Compiler settings').

    box addCheckBox:(resources string:'catch method redefinitions') on:catchRedefs.
    y := box yPosition.
    check := box addCheckBox:(resources string:'keep history line in methods') on:historyLines.
    HistoryManager isNil ifTrue:[check disable].
    box yPosition:y.
    check := box addCheckBox:(resources string:'keep full class history') on:fullHistoryUpdate.
    check left:0.5.
    HistoryManager isNil ifTrue:[check disable] ifFalse:[check enableChannel:historyLines].

    box addPopUpList:(resources string:'fileIn source mode:') on:keepSource.
    keepSource selectionIndex:( keepSourceOptions indexOf:(ClassCategoryReader sourceMode) ifAbsent:1).

    box addHorizontalLine.

    box addCheckBox:(resources string:'lazy compilation when autoloading') on:compileLazy.
    check := box addCheckBox:(resources string:'if present, load binary objects when autoloading') on:loadBinaries.
    canLoadBinaries ifFalse:[
        loadBinaries value:false.
        check disable
    ].
    supportsJustInTimeCompilation ifTrue:[
        component := box 
                        addCheckBox:(resources string:'just in time compilation to machine code') 
                        on:justInTimeCompilation.
    ].

    box addHorizontalLine.

    ObjectFileLoader notNil ifTrue:[
        compilationList := box addPopUpList:(resources string:'stc compilation to machine code') on:stcCompilation.
        stcCompilation selectionIndex:( stcCompilationOptions indexOf:(Compiler stcCompilation) ifAbsent:2).

        component := box 
                        addLabelledInputField:(resources string:'include directories:')
                        adjust:#right
                        on:stcIncludes 
                        tabable:true
                        separateAtX:0.3.
        component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
        component preferredExtent:(250 @ component preferredExtent y).
        canLoadBinaries ifFalse:[component disable].

"/        box addVerticalSpace.

        component := box 
                        addLabelledInputField:(resources string:'defines:')
                        adjust:#right
                        on:stcDefines 
                        tabable:true
                        separateAtX:0.3.
        component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
        component preferredExtent:(250 @ component preferredExtent y).
        canLoadBinaries ifFalse:[component disable].

"/        box addVerticalSpace.

        component := box 
                        addLabelledInputField:(resources string:'stc options:')
                        adjust:#right
                        on:stcOptions 
                        tabable:true
                        separateAtX:0.3.
        component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
        component preferredExtent:(250 @ component preferredExtent y).
        canLoadBinaries ifFalse:[component disable].

"/        box addVerticalSpace.

        component := box 
                        addLabelledInputField:(resources string:'cc command:')
                        adjust:#right
                        on:cc 
                        tabable:true
                        separateAtX:0.3.
        component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
        component preferredExtent:(250 @ component preferredExtent y).
        canLoadBinaries ifFalse:[component disable].

        component := box 
                        addLabelledInputField:(resources string:'cc options:')
                        adjust:#right
                        on:ccOptions 
                        tabable:true
                        separateAtX:0.3.
        component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
        component preferredExtent:(250 @ component preferredExtent y).
        canLoadBinaries ifFalse:[component disable].

        stcLibraries notNil ifTrue:[
"/            box addVerticalSpace.

            component := box 
                            addLabelledInputField:(resources string:'C-libraries:')
                            adjust:#right
                            on:stcLibraries 
                            tabable:true
                            separateAtX:0.3.
            component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
            component preferredExtent:(250 @ component preferredExtent y).
            canLoadBinaries ifFalse:[component disable].
        ].

        stcLibraryPath notNil ifTrue:[
"/            box addVerticalSpace.

            component := box 
                            addLabelledInputField:(resources string:'stc libPath:')
                            adjust:#right
                            on:stcLibraryPath 
                            tabable:true
                            separateAtX:0.3.
            component immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
            component preferredExtent:(250 @ component preferredExtent y).
            canLoadBinaries ifFalse:[component disable].
        ].

"/        box addVerticalSpace.
        box addHorizontalLine.

        "/ if there is no compiler around,
        "/ change to compile nothing, and disable the checkBoxes
        Compiler canCreateMachineCode ifFalse:[
            stcCompilation selectionIndex:3.
            compilationList disable.
        ].
    ].

    y := box yPosition.

    component := box addCheckBox:(resources string:'allow underscore in identifiers') on:allowUnderscore.
    component width:0.4.

    component := box addCheckBox:(resources string:'allow dollar in identifiers') on:allowDollar.
    component width:0.4.

    component := box addCheckBox:(resources string:'literal arrays are immutable') on:immutableArrays.
    component width:0.4.
    y2 := box yPosition.

    box yPosition:y.
    box leftIndent:0.

    component :=box addPopUpList:(resources string:'constant folding:') on:constantFolding.
    component superView left:0.5; width:0.5.
    constantFolding selectionIndex:( constantFoldingOptions indexOf:(Compiler foldConstants) ifAbsent:1).

    component := box addCheckBox:(resources string:'full debug info') on:fullDebugSupport.
    component left:0.5; width:0.4.
    box yPosition:(box yPosition max:y2).


    box addHorizontalLine.

    box addCheckBox:(resources string:'warnings') on:warnings.
"/    box addVerticalSpace.
    oldIndent := box leftIndent.
    box leftIndent:30.

    y := box yPosition.

    warnSTXBox := box addCheckBox:(resources string:'ST/X extensions') on:warnSTX.
    warnSTXBox width:0.4.

    warnUnderscoreBox := box addCheckBox:(resources string:'underscores in identifiers') on:warnUnderscore.
    warnUnderscoreBox width:0.4.

    warnDollarBox := box addCheckBox:(resources string:'dollars in identifiers') on:warnDollar.
    warnDollarBox width:0.4.

    yMax := box yPosition.

    box yPosition:y.
    box leftIndent:0.
    warnOldStyleBox := box addCheckBox:(resources string:'oldStyle assignment') on:warnOldStyle.
    warnOldStyleBox left:0.5; width:0.4.

    warnCommonMistakesBox := box addCheckBox:(resources string:'common mistakes') on:warnCommonMistakes.
    warnCommonMistakesBox left:0.5; width:0.4.

    warnCompatibilityBox := box addCheckBox:(resources string:'possible incompatibilities') on:warnCompatibility.
    warnCompatibilityBox left:0.5; width:0.4.

    box leftIndent:oldIndent.
    box yPosition:(yMax max: box yPosition).

    box 
        addHelpButtonFor:'Launcher/compilerSettings.html';
        addAbortButton; 
        addOkButton.

    warnEnabler value.
    box open.

    box accepted ifTrue:[
        HistoryManager notNil ifTrue:[
            HistoryManager fullHistoryUpdate:fullHistoryUpdate value.
            historyLines value ifTrue:[
                HistoryManager activate
            ] ifFalse:[
                HistoryManager deactivate
            ].
        ].
        Class catchMethodRedefinitions:catchRedefs value.
        ClassCategoryReader sourceMode:(keepSourceOptions at:keepSource selectionIndex).
        Compiler warnings:warnings value.
        Compiler warnSTXSpecials:warnSTX value.
        Compiler warnOldStyleAssignment:warnOldStyle value.
        Compiler warnUnderscoreInIdentifier:warnUnderscore value.
        Compiler warnDollarInIdentifier:warnDollar value.
        Compiler warnCommonMistakes:warnCommonMistakes value.
        Compiler warnPossibleIncompatibilities:warnCompatibility value.
        Compiler allowUnderscoreInIdentifier:allowUnderscore value.
        Compiler allowDollarInIdentifier:allowDollar value.
        Compiler arraysAreImmutable:immutableArrays value.
        fullDebugSupport value ifTrue:[
            Compiler lineNumberInfo:#full.
        ] ifFalse:[
            Compiler lineNumberInfo:true
        ].

        Compiler stcCompilation:(stcCompilationOptions at:stcCompilation selectionIndex).
        Compiler stcCompilationIncludes:stcIncludes value.
        Compiler stcCompilationDefines:stcDefines value.
        Compiler stcCompilationOptions:stcOptions value.
        Compiler ccCompilationOptions:ccOptions value.
        Compiler ccPath:cc value.
        Compiler foldConstants:(constantFoldingOptions at:constantFolding selectionIndex).

        supportsJustInTimeCompilation ifTrue:[
            justInTimeCompilation value ifTrue:[
                Method allInstancesDo:[:m | m checked:false].
            ].
            ObjectMemory justInTimeCompilation:justInTimeCompilation value.
            ObjectMemory fullSingleStepSupport:fullDebugSupport value.
        ].
        ObjectFileLoader notNil ifTrue:[
            stcLibraries notNil ifTrue:[
                ObjectFileLoader searchedLibraries:(stcLibraries value asCollectionOfWords).
            ].
            stcLibraryPath notNil ifTrue:[
                ObjectFileLoader libPath:(stcLibraryPath value).
            ]
        ].
        Autoload compileLazy:compileLazy value.
        Smalltalk loadBinaries:loadBinaries value.
    ].
    box destroy

!

displaySettings
    "open a dialog on display related settings"

    |box listOfSizes sizeInfos
     sizes sizeNames sizeList sizeX sizeY deepIcons
     isColorMonitor useFixPalette useFixGrayPalette idx ditherStyles ditherSyms ditherList
     y component screen visual clipEncodings clipEncodingSyms clipEncodingList|

    listOfSizes := resources at:'LIST_OF_OFFERED_SCREEN_SIZES' default:#default.
    listOfSizes == #default ifTrue:[
        "/ nothing in resource file; offer at least some.
        sizeInfos := #(
                           ( '11.3'' (235mm x 175mm) LCD'   (235 175)    )
                           ( '17''   (325mm x 245mm)'       (325 245)    )
                           ( '19''   (340mm x 270mm)'       (340 270)    )
                           ( '20''   (350mm x 280mm)'       (350 280)    )
                           ( '21''   (365mm x 285mm)'       (365 285)    )
                       ).
    ] ifFalse:[
        sizeInfos := resources array:listOfSizes.
    ].
    sizeNames := sizeInfos collect:[:entry | entry at:1].
    sizes := sizeInfos collect:[:entry | entry at:2].

    screen := Screen current.
    visual := screen visualType.

    isColorMonitor := screen hasColors asValue.
    deepIcons := screen supportsDeepIcons asValue.
    useFixPalette := screen fixColors notNil asValue.
    useFixGrayPalette := screen fixGrayColors notNil asValue.

    sizeList := SelectionInList with:sizeNames.
    sizeX := screen widthInMillimeter asValue.
    sizeY := screen heightInMillimeter asValue.

    clipEncodingSyms := #(nil #iso8859 #jis #jis7 #sjis #euc #big5).
    clipEncodings := resources array:#('untranslated' 'iso8859' 'jis' 'jis7' 'shift-JIS' 'EUC' 'big5').
    clipEncodingList := SelectionInList new.
    clipEncodingList list:clipEncodings.
    clipEncodingList selectionIndex:(clipEncodingSyms indexOf:screen clipBoardEncoding ifAbsent:1).

    ditherList := SelectionInList new.

    (visual == #StaticGray or:[visual == #GrayScale]) ifTrue:[
        ditherStyles := #('threshold' 'ordered dither' 'error diffusion').
        ditherSyms := #(threshold ordered floydSteinberg).
    ] ifFalse:[
        visual ~~ #TrueColor ifTrue:[
            ditherStyles := #('nearest color' 'error diffusion').
            ditherSyms := #(ordered floydSteinberg).
        ]
    ].
    ditherSyms notNil ifTrue:[    
        ditherList list:ditherStyles.
        ditherList selectionIndex:(ditherSyms indexOf:(Image ditherAlgorithm) ifAbsent:#threshold).
    ].

    box := DialogBox new.
    box label:(resources string:'Display screen settings').

    (box addTextLabel:(resources string:'Actual visible screen area:'))
        adjust:#left.

    (box addPopUpList:(resources string:'common sizes:') on:sizeList)
        label:'monitor size'.

    idx := sizes findFirst:[:entry |
                                ((entry at:1) = sizeX value)
                                and:[((entry at:2) = sizeY value)]
                           ].
    idx ~~ 0 ifTrue:[
        sizeList selectionIndex:idx
    ].

    sizeList onChangeSend:#value to:[
                                        |idx|

                                        idx := sizeList selectionIndex.
                                        sizeX value:((sizes at:idx) at:1).
                                        sizeY value:((sizes at:idx) at:2).
                                    ].

    y := box yPosition.
    component := box addTextLabel:(resources string:'screen size:').
    component width:0.3; adjust:#right; borderWidth:0.

    box yPosition:y.
    component := box addInputFieldOn:nil tabable:true.
    component width:0.25; left:0.3; 
              immediateAccept:false; acceptOnLeave:false; 
              cursorMovementWhenUpdating:#beginOfLine;
              converter:(PrintConverter new initForInteger);
              model:sizeX.

    box yPosition:y.
    component := box addTextLabel:(' x ').
    component width:0.1; left:0.55; adjust:#center; borderWidth:0.

    box yPosition:y.
    component := box addInputFieldOn:nil tabable:true.
    component width:0.25; left:0.65; 
              immediateAccept:false; acceptOnLeave:false; 
              cursorMovementWhenUpdating:#beginOfLine;
              converter:(PrintConverter new initForInteger);
              model:sizeY.

    box yPosition:y.
    component := box addTextLabel:('(mm)').
    component width:0.1; left:0.9; adjust:#center; borderWidth:0.

    box addVerticalSpace.
    box addHorizontalLine.
    box addVerticalSpace.

    (box addTextLabel:(resources string:'Screen: depth: %1 visual: %2  (%3)'
                                 with:Screen current depth printString
                                 with:Screen current visualType
                                 with:Screen current serverVendor))
        adjust:#left.

    box addVerticalSpace.
    box addHorizontalLine.
    box addVerticalSpace.

    box addCheckBox:(resources string:'color monitor') on:isColorMonitor.

    visual == #PseudoColor ifTrue:[
        box addVerticalSpace.
        component := box addCheckBox:(resources string:'use fix color palette %1' with:'(4x8x4)') on:useFixPalette.

        box addVerticalSpace.
        component := box addCheckBox:(resources string:'use fix gray color palette %1' with:'(32)') on:useFixGrayPalette.
    ].

    ditherSyms notNil ifTrue:[
        box addVerticalSpace.
        component := box addPopUpList:(resources string:'image display:') on:ditherList.
        component defaultLabel:'image display'.
        component superView horizontalLayout:#leftSpace.
    ].

    box addVerticalSpace.
    box addCheckBox:(resources string:'allow colored/grayscale icons') on:deepIcons.

    box addVerticalSpace.
    box addHorizontalLine.
    box addVerticalSpace.

    component := box addPopUpList:(resources string:'clipBoard encoding:') on:clipEncodingList.
    component superView horizontalLayout:#leftSpace.

    box 
        addHelpButtonFor:'Launcher/screenSettings.html';
        addAbortButton; addOkButton.
    box open.

    box accepted ifTrue:[
        Image flushDeviceImages.

        screen visualType == #PseudoColor ifTrue:[
            useFixPalette value ifTrue:[
                Color colorAllocationFailSignal handle:[:ex |
                    self warn:(resources string:'Could not allocate colors.').
                ] do:[
                    Color getColorsRed:4 green:8 blue:4 on:screen
                ]
            ] ifFalse:[
                screen releaseFixColors
            ].

            useFixGrayPalette value ifTrue:[
                Color colorAllocationFailSignal handle:[:ex |
                    self warn:(resources string:'Could not allocate colors.').
                ] do:[
                    Color getGrayColors:32 on:screen
                ]
            ] ifFalse:[
                screen releaseFixGrayColors
            ]
        ].
        screen hasColors:isColorMonitor value.
        screen widthInMillimeter:sizeX value.
        screen heightInMillimeter:sizeY value.

        screen supportsDeepIcons:deepIcons value.
        ditherSyms notNil ifTrue:[
            Image ditherAlgorithm:(ditherSyms at:ditherList selectionIndex).
        ].

        self withWaitCursorDo:[
            View defaultStyle:(View defaultStyle).
        ].

        screen clipBoardEncoding:(clipEncodingSyms at:clipEncodingList selectionIndex).
    ].
    box destroy

!

fontSettings
    "open a dialog on font related settings"

    (self fontBoxForEncoding:nil) ifTrue:[self reOpen]

!

keyboardSetting 
    "open a dialog on keyboard related settings"

    |mappings listOfRawKeys listOfFunctions
     box l
     list1 list2 listView1 listView2 
     frame selectionForwarder macroForwarder macroTextView y|

    mappings := Screen current keyboardMap.

    listOfRawKeys := (mappings keys asArray collect:[:key | key asString]) sort.
    listOfFunctions := (mappings values asSet asArray collect:[:key | key asString]) sort.

    selectionForwarder := Plug new.
    selectionForwarder respondTo:#showFunction
                  with:[
                        |raw|
                        raw := list1 selection.
                        list2 retractInterestsFor:selectionForwarder.
                        list2 selection:(mappings at:raw asSymbol) asString.
                        list2 onChangeSend:#showRawKey to:selectionForwarder.
                       ].
    selectionForwarder respondTo:#showRawKey
                  with:[
                        |f raw|

                        f := list2 selection.
                        list1 retractInterestsFor:selectionForwarder.
                        raw := mappings keyAtValue:f asString.
                        raw isNil ifTrue:[
                            raw := mappings keyAtValue:f first.
                            raw isNil ifTrue:[
                                raw := mappings keyAtValue:f asSymbol.
                            ]
                        ].
                        list1 selection:raw.
                        list1 onChangeSend:#showFunction to:selectionForwarder.
                       ].

    macroForwarder := [
                        |f macro indent|
                        f := list2 selection.
                        (f startsWith:'Cmd') ifTrue:[
                            f := f copyFrom:4
                        ].
                        macro := FunctionKeySequences at:(f asSymbol) ifAbsent:nil.
                        macro notNil ifTrue:[
                            macro := macro asStringCollection.
                            indent := macro
                                         inject:99999 into:[:min :element |
                                             |stripped|

                                             stripped := element withoutLeadingSeparators.
                                             stripped size == 0 ifTrue:[
                                                 min
                                             ] ifFalse:[
                                                 min min:(element size - stripped size)
                                             ]
                                         ].
                            indent ~~ 0 ifTrue:[
                                macro := macro collect:[:line | 
                                             line size > indent ifTrue:[
                                                line copyFrom:indent+1
                                             ] ifFalse:[
                                                line
                                             ].
                                        ]
                            ].                        
                        ].
                        macroTextView contents:macro.
                       ].

    list1 := SelectionInList with:listOfRawKeys.
    list1 onChangeSend:#showFunction to:selectionForwarder.

    list2 := SelectionInList with:listOfFunctions.
    list2 onChangeSend:#showRawKey to:selectionForwarder.
    list2 onChangeSend:#value to:macroForwarder.

    box := Dialog new.
    box label:(resources string:'Keyboard mappings').

    l := box addTextLabel:(resources string:'KEY_MSG') withCRs.
    l adjust:#left; borderWidth:0.

    frame := View new.
    frame extent:300 @ 300.
    frame borderWidth:0.

    listView1 := ScrollableView for:SelectionInListView in:frame.
    listView1 model:list1.
    listView1 origin:0.0@0.0 corner:0.5@1.0; inset:2.

    listView2 := ScrollableView for:SelectionInListView in:frame.
    listView2 model:list2.
    listView2 origin:0.5@0.0 corner:1.0@1.0; inset:2.

    frame topInset:box yPosition.
    box addComponent:frame withExtent:350@200.
    box makeTabable:listView1. 
    box makeTabable:listView2. 
    frame origin:0.0@0.0 corner:1.0@0.6.

    box addVerticalSpace.

    l := box addTextLabel:(resources string:'Macro text (if any):') withCRs.
    l adjust:#left; borderWidth:0.
    l origin:0.0@0.6 corner:1.0@0.6.
    l topInset:(View viewSpacing).
    l bottomInset:(l preferredExtent y negated - View viewSpacing).

    macroTextView := HVScrollableView for:TextView miniScroller:true.
    box addComponent:macroTextView tabable:true.
    macroTextView origin:0.0@0.6 corner:1.0@1.0.
    y := box yPosition.

    box
        addHelpButtonFor:'Launcher/keyboardSetting.html';
        "addAbortButton;" 
        addOkButtonLabelled:(resources string:'dismiss').

    macroTextView topInset:(l preferredExtent y + 5).
    macroTextView bottomInset:(box preferredExtent y - y).

    box open.

    box accepted ifTrue:[
        "no action yet ..."
    ].
    box destroy


!

languageSetting 
    "open a dialog on language related settings"

    |listOfLanguages translatedLanguages switch box languageList flags|

    "
     get list of supported languages from the launchers resources ...
    "
    listOfLanguages := resources at:'LIST_OF_OFFERED_LANGUAGES' default:#('default').
    listOfLanguages := listOfLanguages asOrderedCollection.
    translatedLanguages := listOfLanguages collect:[:lang | |item|
                                        item := resources at:lang.
                                        item isString ifTrue:[
                                            item
                                        ] ifFalse:[
                                            item at:1
                                        ]
                                ].
    flags := listOfLanguages collect:[:lang | |item|
                                        item := resources at:lang.
                                        item isArray ifTrue:[
                                            item at:2
                                        ] ifFalse:[
                                            nil
                                        ]
                                ].
    flags := flags collect:[:nm | nm notNil ifTrue:[Image fromFile:nm] ifFalse:[nil]].

    languageList := translatedLanguages with:flags collect:[:lang :flag |
                                LabelAndIcon icon:flag string:lang.
                        ].

    box := ListSelectionBox title:(resources string:'LANG_MSG') withCRs.
    box label:(resources string:'Language selection').
    box list:languageList.
    box initialText:(Language).
    box action:[:newLanguage |
        self withWaitCursorDo:[
            |fontPref idx language oldLanguage enc answer matchingFonts|

            idx := translatedLanguages indexOf:newLanguage withoutSeparators.
            idx ~~ 0 ifTrue:[
                language := listOfLanguages at:idx
            ] ifFalse:[
                language := newLanguage
            ].

            "/ check if the new language needs a differently encoded font;
            "/ ask user to switch font and allow cancellation.
            "/ Otherwise, you are left with unreadable menu & button items ...

            oldLanguage := Smalltalk language.
            Smalltalk language:language asSymbol.
            ResourcePack flushCachedResourcePacks.
            fontPref := self class classResources at:'PREFERRED_FONT_ENCODING' default:'iso8859*'.
            Smalltalk language:oldLanguage.

            switch := true.
            enc := MenuView defaultFont encoding.
            (fontPref match:enc) ifFalse:[
                "/ look if there is one at all.
                matchingFonts := Screen current listOfAvailableFonts select:[:f | fontPref match:f encoding].
                matchingFonts size == 0 ifTrue:[
                    (Dialog 
                        confirm:(resources 
                                    string:'your display does not offer any %1-encoded font.\\Change the language anyway ?\ (texts will probably be unreadable then)'
                                      with:fontPref) withCRs)
                    ifFalse:[
                        switch := false
                    ]
                ] ifFalse:[
                    answer := Dialog 
                                confirmWithCancel:(resources 
                                                        string:'menu font is not %1-encoded.\\Change it ?'
                                                        with:fontPref) withCRs
                                           labels:(resources
                                                        array:#('cancel' 'no' 'yes'))
                                           default:3.
                    answer isNil ifTrue:[
                        switch := false
                    ] ifFalse:[
                        answer ifTrue:[
                            switch := (self fontBoxForEncoding:fontPref)
                        ]
                    ].
                ].
            ].

            switch ifTrue:[
                transcript showCR:'change language to ' , newLanguage , ' ...'.
                Smalltalk language:language asSymbol.
                ResourcePack flushCachedResourcePacks
            ].
        ].
        switch ifTrue:[
            self reOpen.
            DebugView newDebugger.
        ]
    ].    
    box
        addHelpButtonFor:'Launcher/languageSetting.html'.
    box open.
    box destroy

    "Modified: / 6.2.1998 / 00:01:01 / cg"
!

loadSettings
    "restore settings from a settings-file."

    "a temporary kludge - we need a central systemSettings object for this,
     which can be saved/restored with a single store/read."

    |fileName|

    fileName := Dialog 
        requestFileName:(resources string:'load settings from:') 
        default:'settings.stx'
        ok:(resources string:'load') 
        abort:(resources string:'cancel') 
        pattern:'*.stx'
        fromDirectory:nil.

    (fileName isNil or:[fileName isEmpty]) ifTrue:[
        "/ canceled
        ^ self
    ].

    self withWaitCursorDo:[
        Smalltalk fileIn:fileName.
        self reOpen
    ].


!

memorySettings
    "open a dialog on objectMemory related settings"

    |box igcLimit igcFreeLimit igcFreeAmount newSpaceSize
     compressLimit
     oldIncr component fields codeLimit codeTrigger stackLimit|

    "/
    "/ extract relevant system settings ...
    "/
    igcLimit := ObjectMemory incrementalGCLimit asValue.
    igcFreeLimit := ObjectMemory freeSpaceGCLimit asValue.
    igcFreeAmount := ObjectMemory freeSpaceGCAmount asValue.
    newSpaceSize := ObjectMemory newSpaceSize asValue.
    oldIncr := ObjectMemory oldSpaceIncrement asValue.
    compressLimit := ObjectMemory oldSpaceCompressLimit asValue.
    codeLimit := ObjectMemory dynamicCodeLimit asValue.
    codeTrigger := ObjectMemory dynamicCodeGCTrigger asValue.
    stackLimit := Process defaultMaximumStackSize asValue.

    "/
    "/ create a box on those values ...
    "/
    fields := OrderedCollection new.

    box := DialogBox new.
    box label:(resources string:'Memory manager settings').

    (box addTextLabel:'Warning - invalid settings may result in failures or poor performance

You have been warned.') adjust:#left.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'size of newSpace:')
                    adjust:#right
                    on:nil "/ newSpaceSize 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:newSpaceSize.
    fields add:component.

    box addHorizontalLine.


    component := box 
                    addLabelledInputField:(resources string:'incremental GC allocation trigger:')
                    adjust:#right
                    on:nil "/ igcLimit 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:igcLimit.
    fields add:component.

    box addTextLabel:'(start IGC whenever this amount has been allocated)'.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'incremental GC freespace trigger:')
                    adjust:#right
                    on:nil "/ igcFreeLimit 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:igcFreeLimit.
    fields add:component.

    box addTextLabel:'(start IGC whenever freespace drops below this)'.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'incremental GC amount:')
                    adjust:#right
                    on:nil "/ igcFreeAmount 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:igcFreeAmount.
    fields add:component.

    box addTextLabel:'(try to keep this amount for peak requests)'.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'oldspace increment:')
                    adjust:#right
                    on:nil "/ oldIncr 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:oldIncr.
    fields add:component.

    box addTextLabel:'(increase oldSpace in chunks of this size)'.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'oldspace compress limit:')
                    adjust:#right
                    on:nil "/ compressLimit 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:compressLimit.
    fields add:component.

    box addTextLabel:'(suppress compressing GC if more memory is in use)'.
    box addHorizontalLine.

    component := box 
                    addLabelledInputField:(resources string:'stack limit:')
                    adjust:#right
                    on:nil 
                    tabable:true
                    separateAtX:0.7.
    component acceptOnLeave:false.
    component converter:(PrintConverter new initForNumber).
    component model:stackLimit.
    fields add:component.

    box addTextLabel:'(trigger recursionInterrupt if more stack is used by a process)'.
    box addHorizontalLine.

    ObjectMemory supportsJustInTimeCompilation ifTrue:[
        component := box 
                        addLabelledInputField:(resources string:'dynamic code limit:')
                        adjust:#right
                        on:nil
                        tabable:true
                        separateAtX:0.7.
        component acceptOnLeave:false.
        component converter:(PrintConverter new initForNumberOrNil).
        component model:codeLimit.
        fields add:component.

        box addTextLabel:'(flush dynamic compiled code to stay within this limit)'.
        box addHorizontalLine.

        component := box 
                        addLabelledInputField:(resources string:'dynamic code GC trigger:')
                        adjust:#right
                        on:nil
                        tabable:true
                        separateAtX:0.7.
        component acceptOnLeave:false.
        component converter:(PrintConverter new initForNumberOrNil).
        component model:codeTrigger.
        fields add:component.

        box addTextLabel:'(start incremental GC whenever this amount of code has been allocated)'.
        box addHorizontalLine.
    ].

    box addAbortButton; addOkButton.
    box
        addHelpButtonFor:'Launcher/memorySettings.html'.

    "/
    "/ show the box ...
    "/
    box open.

    "/
    "/ update system settings
    "/
    box accepted ifTrue:[
        fields do:[:comp | comp accept].

        igcFreeAmount value ~~ ObjectMemory freeSpaceGCAmount ifTrue:[
            ObjectMemory freeSpaceGCAmount:igcFreeAmount value.
        ].
        igcFreeLimit value ~~ ObjectMemory freeSpaceGCLimit ifTrue:[
            ObjectMemory freeSpaceGCLimit:igcFreeLimit value.
        ].
        igcLimit value ~~ ObjectMemory incrementalGCLimit ifTrue:[
            ObjectMemory incrementalGCLimit:igcLimit value.
        ].
        newSpaceSize value ~~ ObjectMemory newSpaceSize ifTrue:[
            ObjectMemory newSpaceSize:newSpaceSize value.
        ].
        oldIncr value ~~ ObjectMemory oldSpaceIncrement ifTrue:[
            ObjectMemory oldSpaceIncrement:oldIncr value.
        ].
        stackLimit value ~~ Process defaultMaximumStackSize ifTrue:[
            Process defaultMaximumStackSize:stackLimit value.
        ].
        ObjectMemory oldSpaceCompressLimit:compressLimit value.
        ObjectMemory dynamicCodeLimit:codeLimit value.
        ObjectMemory dynamicCodeGCTrigger:codeTrigger value.
    ].
    box destroy
!

messageSettings
    "open a dialog on infoMessage related settings"

    |box vmInfo vmErrors displayErrors classInfos|

    vmInfo := ObjectMemory infoPrinting asValue.
    vmErrors := ObjectMemory debugPrinting asValue.
    classInfos := Object infoPrinting asValue.
    displayErrors := DeviceWorkstation errorPrinting asValue.

    box := DialogBox new.
    box label:(resources string:'Messages').

    box addCheckBox:(resources string:'VM info messages') on:vmInfo.
    box addCheckBox:(resources string:'VM error messages') on:vmErrors.
    box addHorizontalLine.

    box addCheckBox:(resources string:'Display error messages (Xlib, Xtlib ...)') on:displayErrors.
    box addCheckBox:(resources string:'Other info messages') on:classInfos.

    box addHelpButtonFor:'Launcher/messageSettings.html'.
    box addAbortButton; addOkButton.
    box open.

    box accepted ifTrue:[
        ObjectMemory infoPrinting:vmInfo value.
        ObjectMemory debugPrinting:vmErrors value.
        Object infoPrinting:classInfos value.
        DeviceWorkstation errorPrinting:displayErrors value.
    ].
    box destroy


!

miscSettings
    "open a dialog on misc other settings"

    |box shadows takeFocus returnFocus
     hostNameInLabel showAccelerators 
     preemptive hostNameInLabelHolder|

    "/ 
    "/ extract relevant system settings ...
    "/
    shadows := PopUpView shadows asValue.
    hostNameInLabel := StandardSystemView includeHostNameInLabel.
    hostNameInLabelHolder := hostNameInLabel asValue.
    returnFocus := StandardSystemView returnFocusWhenClosingModalBoxes asValue.
    takeFocus := StandardSystemView takeFocusWhenMapped asValue.

    showAccelerators := MenuView showAcceleratorKeys asValue.
    preemptive := Processor isTimeSlicing asValue.

    "/
    "/ create a box on those values ...
    "/
    box := DialogBox new.
    box label:(resources string:'Other settings').

    box addCheckBox:(resources string:'shadows under popup views') on:shadows.
    box addCheckBox:(resources string:'boxes return focus to previously active view') on:returnFocus.
    box addCheckBox:(resources string:'views catch focus when mapped') on:takeFocus.
    box addCheckBox:(resources string:'hostname in window labels') on:hostNameInLabelHolder.
    box addCheckBox:(resources string:'show accelerator keys in menus') on:showAccelerators.

    box addHorizontalLine.

    box addCheckBox:(resources string:'preemptive scheduling') on:preemptive.

    box 
        addHelpButtonFor:'Launcher/miscSettings.html';
        addAbortButton; 
        addOkButton.

    "/
    "/ show the box ...
    "/
    box open.

    "/
    "/ update system settings
    "/
    box accepted ifTrue:[
        PopUpView shadows:shadows value.
        hostNameInLabelHolder value ~~ hostNameInLabel ifTrue:[ 
            StandardSystemView includeHostNameInLabel:hostNameInLabelHolder value.

            Screen allScreens do:[:aDisplay |
                aDisplay allViewsDo:[:aView |
                    |l|

                    aView isTopView ifTrue:[
                        aView isPopUpView ifFalse:[
                            l := aView label.
                            aView label:(l , ' '); label:l.  "/ force a change
                        ]
                    ]
                ]
            ]
        ].
        StandardSystemView returnFocusWhenClosingModalBoxes:returnFocus value.
        StandardSystemView takeFocusWhenMapped:takeFocus value.
        MenuView showAcceleratorKeys:showAccelerators value.
        Processor isTimeSlicing ~~ preemptive value ifTrue:[
            preemptive value ifTrue:[
                Processor startTimeSlicing
            ] ifFalse:[
                Processor stopTimeSlicing
            ]
        ]
    ].
    box destroy


!

printerSettings
    "open a dialog on printer related settings"

    |box 
     possiblePrinters possibleTypes printerType printCommand 
     pageFormat landscape updater
     formatLabel formatComponent landscapeLabel landscapeComponent
     topMargin leftMargin rightMargin bottomMargin unitList unit
     topMarginComponent leftMarginComponent
     rightMarginComponent
     bottomMarginComponent supportsColor supportsColorComponent
     y y1 commandListPop component commandList row|

    possiblePrinters := PrinterStream withAllSubclasses asArray.
    possibleTypes := possiblePrinters collect:[:cls | cls printerTypeName].

    printerType := SelectionInList new list:(resources array:possibleTypes).
    printerType selectionIndex:(possiblePrinters identityIndexOf:Printer).
    printCommand := Printer printCommand asValue.

    pageFormat := SelectionInList new list:(Printer defaultPageFormats).
    pageFormat selection:(Printer pageFormat).
    landscape := Printer landscape asValue.

    topMargin := Printer topMargin asValue.
    leftMargin := Printer leftMargin asValue.
    rightMargin := Printer rightMargin asValue.
    bottomMargin := Printer bottomMargin asValue.
    supportsColor := Printer supportsColor asValue.

    box := DialogBox new.
    box label:(resources string:'Printer settings').

"/ either use a popUpList ...
"/    box addPopUpList:(resources string:'printer type:') on:printerType.

"/ or a comboList;
"/ which one looks better ?
    y := box yPosition.
    component := box addTextLabel:(resources string:'printer type:').
    component width:0.25; adjust:#right; borderWidth:0.
    box yPosition:y.
    component := box addComboListOn:printerType tabable:true.
    component aspect:#selectionIndex; changeMessage:#selectionIndex:; useIndex:true.
    component width:0.75; left:0.25.
"/ end of question

    y := box yPosition.
    component := box addTextLabel:(resources string:'print command:').
    component width:0.25; adjust:#right; borderWidth:0.
    box yPosition:y.
    commandListPop := box addComboBoxOn:printCommand tabable:true.
"/    commandListPop := box addInputFieldOn:printCommand tabable:true.
    commandListPop width:0.75; left:0.25; immediateAccept:true; acceptOnLeave:false; cursorMovementWhenUpdating:#beginOfLine.
    "/ some common print commands ...

    commandList := resources at:'PRINT_COMMANDS' ifAbsent:nil.
    commandList isNil ifTrue:[
        commandList := PrinterStream defaultCommands.
        commandList isNil ifTrue:[
            commandList := #('lpr' 
                             'lp' 
                            ).
        ]
    ].

    commandListPop list:commandList.
    box addVerticalSpace.
    box addHorizontalLine.
    box addVerticalSpace.

    row := OrderedCollection new.
    row add:(formatLabel := Label label:(resources string:'page format:')).
    formatLabel borderWidth:0.
    row add:(formatComponent := PopUpList on:pageFormat).
    formatComponent label:'unknown'.

    row add:(landscapeLabel := Label label:(resources string:'landscape:')).
    landscapeLabel borderWidth:0.
    row add:(landscapeComponent := CheckToggle on:landscape).

    y := box yPosition.
    box
        addRow:(1 to:2)
        fromX:0
        toX:0.5
        collect:[:idx | row at:idx]
        tabable:false
        horizontalLayout:#leftSpace
        verticalLayout:#center.
    y1 := box yPosition.
    box yPosition:y.

    box
        addRow:(3 to:4)
        fromX:0.5
        toX:1.0
        collect:[:idx | row at:idx]
        tabable:false
        horizontalLayout:#leftSpace
        verticalLayout:#center.

    box yPosition:(box yPosition max:y1).

    box makeTabable:(formatComponent).
    box makeTabable:(landscapeComponent).

    box addVerticalSpace.
    box addHorizontalLine.
    box addVerticalSpace.

    y := box yPosition.

    topMarginComponent := box 
        addLabelledInputField:(resources string:'top margin:')
        adjust:#right
        on:nil "/ topMargin 
        tabable:true
        from:0.0 to:0.5
        separateAtX:0.6.
    topMarginComponent converter:(PrintConverter new initForNumber).
    topMarginComponent model:topMargin.
    y1 := box yPosition.

    box yPosition:y.
    unitList := SelectionInList with:#('inch' 'mm').
    unitList selectionIndex:1.

    component := box addComponent:(PopUpList on:unitList).
    component
        left:0.6;
        width:0.3.

    box yPosition:y1.

    leftMarginComponent := box 
        addLabelledInputField:(resources string:'left margin:')
        adjust:#right
        on:nil "/ leftMargin 
        tabable:true
        from:0.0 to:0.5
        separateAtX:0.6.
    leftMarginComponent converter:(PrintConverter new initForNumber).
    leftMarginComponent model:leftMargin.

    rightMarginComponent := box 
        addLabelledInputField:(resources string:'right margin:')
        adjust:#right
        on:nil "/ rightMargin 
        tabable:true
        from:0.0 to:0.5
        separateAtX:0.6.
    rightMarginComponent converter:(PrintConverter new initForNumber).
    rightMarginComponent model:rightMargin.

    bottomMarginComponent := box 
        addLabelledInputField:(resources string:'bottom margin:')
        adjust:#right
        on:nil "/ bottomMargin 
        tabable:true
        from:0.0 to:0.5
        separateAtX:0.6.
    bottomMarginComponent converter:(PrintConverter new initForNumber).
    bottomMarginComponent model:bottomMargin.

    box addHorizontalLine.
    supportsColorComponent := box addCheckBox:(resources string:'Color printer') on:supportsColor.
    box addVerticalSpace.

    updater := [ |p fg hasPageSize hasMargins|

                       printerType selectionIndex ~~ 0 ifTrue:[
                           p := possiblePrinters at:(printerType selectionIndex).
                           hasPageSize := p supportsPageSizes. 
                           hasMargins := p supportsMargins. 
                       ] ifFalse:[
                           hasPageSize := false.
                           hasMargins := false.
                       ].
                       hasPageSize ifTrue:[
                          fg := Button new foregroundColor.
                          formatComponent enable.
                          landscapeComponent enable.

                          formatComponent label:p pageFormat.
                          pageFormat value:(p pageFormat).
                          landscape value:(p landscape).
                       ] ifFalse:[ 
                          fg := Button new disabledForegroundColor.
                          formatComponent disable.
                          landscapeComponent disable.

                          formatComponent label:'unknown'.
                          landscape value:nil.
                       ].
                       hasMargins ifTrue:[
                          unitList selectionIndex == 2 ifTrue:[
                              unit := #mm
                          ] ifFalse:[
                              unit := #inch
                          ].

                          topMargin value:(UnitConverter convert:p topMargin from:#inch to:unit).
                          leftMargin value:(UnitConverter convert:p leftMargin from:#inch to:unit).
                          rightMargin value:(UnitConverter convert:p rightMargin from:#inch to:unit).
                          bottomMargin value:(UnitConverter convert:p bottomMargin from:#inch to:unit).

                          topMarginComponent enable.
                          leftMarginComponent enable.
                          rightMarginComponent enable.
                          bottomMarginComponent enable.
                       ] ifFalse:[ 
                          topMarginComponent disable.
                          leftMarginComponent disable.
                          rightMarginComponent disable.
                          bottomMarginComponent disable.
                       ].
                       formatLabel foregroundColor:fg.
                       landscapeLabel foregroundColor:fg.

                       p notNil ifTrue:[ 
                           commandList := p defaultCommands.
                           commandList notNil ifTrue:[
                                commandListPop list:commandList 
                           ].

                           printCommand value:(p printCommand).
                       ].
                       p supportsPostscript ifFalse:[
                           supportsColorComponent disable.
                           supportsColor value:false
                       ] ifTrue:[
                           supportsColorComponent enable.
                           supportsColor value:(Printer supportsColor).
                       ]
                     ].
    unitList onChangeSend:#value to:updater.
    printerType onChangeSend:#value to:updater.
    updater value.

    box addVerticalSpace;
        addHelpButtonFor:'Launcher/printerSettings.html';
        addAbortButton; addOkButton.
    box open.

    box accepted ifTrue:[
        Printer := possiblePrinters at:(printerType selectionIndex).
        Printer printCommand:printCommand value.

        Printer supportsPageSizes ifTrue:[
            Printer pageFormat:(pageFormat selection).
            Printer landscape:(landscape value).
        ].
        Printer supportsMargins ifTrue:[
            unitList selectionIndex == 2 ifTrue:[
                unit := #mm
            ] ifFalse:[
                unit := #inch
            ].
            Printer topMargin:(UnitConverter convert:topMargin value from:unit to:#inch).
            Printer leftMargin:(UnitConverter convert:leftMargin value from:unit to:#inch).
            Printer rightMargin:(UnitConverter convert:rightMargin value from:unit to:#inch).
            Printer bottomMargin:(UnitConverter convert:bottomMargin value from:unit to:#inch).
        ].
        Printer supportsPostscript ifTrue:[
            Printer supportsColor:supportsColor value.
        ].
    ].
    box destroy

!

saveSettings
    "save settings to a settings-file."

    "a temporary kludge - we need a central systemSettings object for this,
     which can be saved/restored with a single store/read."

    |s screen fileName|

    fileName := Dialog 
        requestFileName:(resources string:'save settings in:') 
        default:'settings.stx'
        ok:(resources string:'save') 
        abort:(resources string:'cancel') 
        pattern:'*.stx'
        fromDirectory:nil.

    (fileName isNil or:[fileName isEmpty]) ifTrue:[
        "/ canceled
        ^ self
    ].

    s := fileName asFilename writeStream.
    s isNil ifTrue:[
        self warn:'cannot write the ''' , fileName , ''' file'.
        ^ self
    ].

    s nextPutLine:'"/ ST/X saved settings';
      nextPutLine:'"/ DO NOT MODIFY MANUALLY';
      nextPutLine:'"/ (modifications would be lost with next save-settings)';
      nextPutLine:'"/';
      nextPutLine:'"/ this file was automatically generated by the';
      nextPutLine:'"/ ''save settings'' function of the Launcher';
      nextPutLine:'"/'.
    s cr.

    s nextPutLine:'"/'.
    s nextPutLine:'"/ saved by ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName , ' at ' , AbsoluteTime now printString.
    s nextPutLine:'"/'.
    s cr.

    s nextPutLine:'"/'.
    s nextPutLine:'"/ Display settings:'.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ only restore the display settings, if on the same Display ...'.
    s nextPutLine:'Display displayName = ' , (Display displayName storeString) , ' ifTrue:['.
      screen := Screen current.
      screen fixColors notNil ifTrue:[
        s nextPutLine:'  Image flushDeviceImages.'.
        s nextPutLine:'  Color colorAllocationFailSignal catch:['.
        s nextPutLine:'    Color getColorsRed:6 green:6 blue:4 on:Display'.
        s nextPutLine:'  ].'.
      ] ifFalse:[
        s nextPutLine:'  Display releaseFixColors.'.
      ].
      s nextPutLine:'  Display hasColors: ' , (screen hasColors storeString) , '.'.
      s nextPutLine:'  Display widthInMillimeter: ' , (screen widthInMillimeter storeString) , '.'.
      s nextPutLine:'  Display heightInMillimeter: ' , (screen heightInMillimeter storeString) , '.'.
      s nextPutLine:'  Display supportsDeepIcons: ' , (screen supportsDeepIcons storeString) , '.'.
      s nextPutLine:'  Image ditherAlgorithm: ' , (Image ditherAlgorithm storeString) , '.'.
      s nextPutLine:'  View defaultStyle:(View defaultStyle). "/ to flush any device images'.
    s nextPutLine:'].'.
    s cr.

    s nextPutLine:'"/'.
    s nextPutLine:'"/ Compiler settings:'.
    s nextPutLine:'"/'.
    s nextPutLine:'Compiler warnSTXSpecials: ' , (Compiler warnSTXSpecials storeString) , '.';
      nextPutLine:'Compiler warnUnderscoreInIdentifier: ' , (Compiler warnUnderscoreInIdentifier storeString) , '.';
      nextPutLine:'Compiler warnOldStyleAssignment: ' , (Compiler warnOldStyleAssignment storeString) , '.';
      nextPutLine:'Compiler warnCommonMistakes: ' , (Compiler warnCommonMistakes storeString) , '.';
      nextPutLine:'Compiler warnPossibleIncompatibilities: ' , (Compiler warnPossibleIncompatibilities storeString) , '.';
      nextPutLine:'Compiler allowUnderscoreInIdentifier: ' , (Compiler allowUnderscoreInIdentifier storeString) , '.';
      nextPutLine:'Compiler arraysAreImmutable: ' , (Compiler arraysAreImmutable storeString) , '.';
      nextPutLine:'Compiler lineNumberInfo: ' , (Compiler lineNumberInfo storeString) , '.';

      nextPutLine:'Compiler foldConstants: ' , (Compiler foldConstants storeString) , '.';

      nextPutLine:'Compiler stcCompilationIncludes: ' , (Compiler stcCompilationIncludes storeString) , '.';
      nextPutLine:'Compiler stcCompilationDefines: ' , (Compiler stcCompilationDefines storeString) , '.';
      nextPutLine:'Compiler stcCompilationOptions: ' , (Compiler stcCompilationOptions storeString) , '.';
      nextPutLine:'Compiler ccCompilationOptions: ' , (Compiler ccCompilationOptions storeString) , '.';
      nextPutLine:'Compiler ccPath: ' , (Compiler ccPath storeString) , '.';

      nextPutLine:'ObjectMemory justInTimeCompilation: ' , (ObjectMemory justInTimeCompilation storeString) , '.';
      nextPutLine:'ObjectMemory fullSingleStepSupport: ' , (ObjectMemory fullSingleStepSupport storeString) , '.'.

    HistoryManager notNil ifTrue:[
        HistoryManager isActive ifTrue:[
            s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager activate].'.
            s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager fullHistoryUpdate:' , HistoryManager fullHistoryUpdate storeString , '].'.
        ] ifFalse:[
            s nextPutLine:'HistoryManager notNil ifTrue:[HistoryManager deactivate].'.
        ].
    ].

    ObjectFileLoader notNil ifTrue:[
        s nextPutLine:'ObjectFileLoader searchedLibraries: ' , (ObjectFileLoader searchedLibraries storeString) , '.'.
        s nextPutLine:'ObjectFileLoader libPath: ' , (ObjectFileLoader libPath storeString) , '.'.
    ].

    s nextPutLine:'Class catchMethodRedefinitions: ' , (Class catchMethodRedefinitions storeString) , '.'.
    s nextPutLine:'ClassCategoryReader sourceMode: ' , (ClassCategoryReader sourceMode storeString) , '.'.

    s cr.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ Info & Debug Messages:'.
    s nextPutLine:'"/'.
    s nextPutLine:'ObjectMemory infoPrinting: ' , (ObjectMemory infoPrinting storeString) , '.';
      nextPutLine:'ObjectMemory debugPrinting: ' , (ObjectMemory debugPrinting storeString) , '.';
      nextPutLine:'Object infoPrinting: ' , (Object infoPrinting storeString) , '.';
      nextPutLine:'DeviceWorkstation errorPrinting: ' , (DeviceWorkstation errorPrinting storeString) , '.'.


    s cr.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ Misc settings:'.
    s nextPutLine:'"/'.
    s nextPutLine:'Class keepMethodHistory: ' , (Class methodHistory notNil storeString) , '.';
      nextPutLine:'Smalltalk logDoits: ' , (Smalltalk logDoits storeString) , '.';
      nextPutLine:'Autoload compileLazy: ' , (Autoload compileLazy storeString) , '.';
      nextPutLine:'Smalltalk loadBinaries: ' , (Smalltalk loadBinaries storeString) , '.';
      nextPutLine:'StandardSystemView includeHostNameInLabel: ' , (StandardSystemView includeHostNameInLabel storeString) , '.';

      "/ claus - I dont think its a good idea to save those ...
      nextPutLine:'"/ Class updateChanges: ' , (Class updatingChanges storeString) , '.';
      nextPutLine:'"/ ObjectMemory nameForChanges: ' , (ObjectMemory nameForChanges storeString) , '.';

      nextPutLine:'StandardSystemView returnFocusWhenClosingModalBoxes: ' , (StandardSystemView returnFocusWhenClosingModalBoxes storeString) , '.';
      nextPutLine:'StandardSystemView takeFocusWhenMapped: ' , (StandardSystemView takeFocusWhenMapped storeString) , '.';
      nextPutLine:'MenuView showAcceleratorKeys: ' , (MenuView showAcceleratorKeys storeString) , '.';
      nextPutLine:'Class tryLocalSourceFirst: ' , (Class tryLocalSourceFirst storeString) , '.'.
    (Exception emergencyHandler == Launcher notifyingEmergencyHandler) ifTrue:[
        s nextPutLine:'Exception emergencyHandler:(Launcher notifyingEmergencyHandler).'.
    ].

    s cr.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ Printer settings:'.
    s nextPutLine:'"/'.
    s nextPutLine:'Printer := ' , (Printer name) , '.';
      nextPutLine:'Printer printCommand: ' , (Printer printCommand storeString) , '.'.

    Printer supportsPageSizes ifTrue:[
        s nextPutLine:'Printer pageFormat: ' , (Printer pageFormat storeString) , '.'.
        s nextPutLine:'Printer landscape: ' , (Printer landscape storeString) , '.'.
    ].
    Printer supportsMargins ifTrue:[
        s nextPutLine:'Printer topMargin: ' , (Printer topMargin storeString) , '.'.
        s nextPutLine:'Printer leftMargin: ' , (Printer leftMargin storeString) , '.'.
        s nextPutLine:'Printer rightMargin: ' , (Printer rightMargin storeString) , '.'.
        s nextPutLine:'Printer bottomMargin: ' , (Printer bottomMargin storeString) , '.'.
    ].
    Printer supportsPostscript ifTrue:[
        s nextPutLine:'Printer supportsColor: ' , (Printer supportsColor storeString) , '.'.
    ].

    s cr.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ Font settings:'.
    s nextPutLine:'"/'.
    s nextPutLine:'View defaultFont: ' , (View defaultFont storeString) , '.'.
    s nextPutLine:'Label defaultFont: ' , (Label defaultFont storeString) , '.'.
    s nextPutLine:'Button defaultFont: ' , (Button defaultFont storeString) , '.'.
    s nextPutLine:'Toggle defaultFont: ' , (Toggle defaultFont storeString) , '.'.
    s nextPutLine:'SelectionInListView defaultFont: ' , (SelectionInListView defaultFont storeString) , '.'.
    s nextPutLine:'MenuView defaultFont: ' , (MenuView defaultFont storeString) , '.'.
    s nextPutLine:'PullDownMenu defaultFont: ' , (PullDownMenu defaultFont storeString) , '.'.
    s nextPutLine:'TextView defaultFont: ' , (TextView defaultFont storeString) , '.'.
    s nextPutLine:'EditTextView defaultFont: ' , (EditTextView defaultFont storeString) , '.'.
    s nextPutLine:'CodeView defaultFont: ' , (CodeView defaultFont storeString) , '.'.

    s cr.
    s nextPutLine:'"/'.
    s nextPutLine:'"/ Language setting:'.
    s nextPutLine:'"/'.
    s nextPutLine:'Smalltalk language: ' , (Smalltalk language storeString) , '.'.
    s nextPutLine:'Smalltalk languageTerritory: ' , (Smalltalk languageTerritory storeString) , '.'.
    s close.

    "
     Transcript topView application saveSettings
    " 


!

sourceAndDebuggerSettings
    "open a dialog on misc other settings"

    |box check logDoits updChanges changeFileName
     useManager hasManager 
     repository repositoryHolder localSourceFirst 
     sourceCacheDir cacheEntry
     component localCheck oldIndent nm fn manager
     keepMethodHistory showErrorNotifier showVerboseStack
     syntaxColoring syntaxColor syntaxColors colorMenu oldUserPreferences
     syntaxEmphasises syntaxColorSelector syntaxEmphasisSelector syntaxColoringBox
     syntaxEmphasisesBox syntaxColoringResetBox syntaxColoringEnableBlock|

    "/ 
    "/ extract relevant system settings ...
    "/
    keepMethodHistory := Class methodHistory notNil asValue.
    logDoits := Smalltalk logDoits asValue.
    updChanges := Class updatingChanges asValue.
    changeFileName := ObjectMemory nameForChanges asValue.

    hasManager := AbstractSourceCodeManager notNil
                  and:[AbstractSourceCodeManager isLoaded].

    hasManager ifTrue:[
        useManager := (manager := Smalltalk at:#SourceCodeManager) notNil asValue.
        localSourceFirst := Class tryLocalSourceFirst asValue.
        manager notNil ifTrue:[
            repository := manager repositoryName.
            repository notNil ifTrue:[
                repositoryHolder := repository asValue
            ] ifFalse:[
                repositoryHolder := '' asValue
            ].
        ].
    ] ifFalse:[
        useManager := false.
        localSourceFirst := false
    ].
    showErrorNotifier := (Exception emergencyHandler == Launcher notifyingEmergencyHandler) asValue.
    showVerboseStack := (DebugView defaultVerboseBacktrace ? false) asValue.
    syntaxColoring := UserPreferences current syntaxColoring asValue.

    sourceCacheDir := nil asValue.

    "/
    "/ create a box on those values ...
    "/
    box := DialogBox new.
    box label:(resources string:'Source & Debugger settings').

    box addCheckBox:(resources string:'remember changed methods (for previous method in browser)') on:keepMethodHistory.
    box addCheckBox:(resources string:'log compiles in changes file') on:updChanges.
    box addCheckBox:(resources string:'log doIts in changes file') on:logDoits.

    component := box 
                    addLabelledInputField:(resources string:'change file name:')
                    adjust:#right
                    on:changeFileName 
                    tabable:true
                    separateAtX:0.4.
    component immediateAccept:true; acceptOnLeave:false.

"/    y := box yPosition.
"/    component := box addTextLabel:(resources string:'change file name:').
"/    component width:0.5; adjust:#right; borderWidth:0.
"/    box yPosition:y.
"/    component := box addInputFieldOn:changeFileName tabable:true.
"/    component width:0.5; left:0.5; immediateAccept:true; acceptOnLeave:false.

    box addHorizontalLine.

    hasManager ifTrue:[
        check := box addCheckBox:(resources string:'sourcecode from sourcecode management') on:useManager.
        oldIndent := box leftIndent.
        box leftIndent:30.

        repositoryHolder notNil ifTrue:[
            component := box 
                            addLabelledInputField:(resources string:'repository:')
                            adjust:#right
                            on:repositoryHolder 
                            tabable:true
                            separateAtX:0.4.
            component immediateAccept:true; acceptOnLeave:false.
            component enableChannel:useManager.
        ].

        cacheEntry := box 
                        addLabelledInputField:(resources string:'source cache dir:')
                        adjust:#right
                        on:sourceCacheDir 
                        tabable:true
                        separateAtX:0.4.
        cacheEntry immediateAccept:true; acceptOnLeave:false.
        cacheEntry enableChannel:useManager.

        localCheck := box addCheckBox:(resources string:'if present, use local source (suppress checkout)') on:localSourceFirst.
        localCheck enableChannel:useManager.

        box leftIndent:oldIndent.

        (AbstractSourceCodeManager isNil 
        or:[AbstractSourceCodeManager defaultManager isNil]) ifTrue:[
            useManager value:false.
            cacheEntry disable.
            check disable.
            localCheck enable.
        ] ifFalse:[
            sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName).
        ].
        box addHorizontalLine.
    ].

    box addCheckBox:(resources string:'show error notifier before opening debugger') on:showErrorNotifier.
    box addCheckBox:(resources string:'verbose backtrace by default in debugger') on:showVerboseStack.

    box addHorizontalLine.
    box addCheckBox:(resources string:'syntax coloring') on:syntaxColoring.

    oldUserPreferences := UserPreferences current copy.

    syntaxColoringBox := box addComboListOn: (syntaxColors := SelectionInList with:UserPreferences syntaxColors asValue initialSelection:1).
    syntaxColorSelector    := [(syntaxColors selection replChar:$  withString: '') asLowercaseFirst asSymbol].
    syntaxEmphasisSelector := [((syntaxColorSelector value readStream upToAll: 'Color'), 'Emphasis') asLowercaseFirst asSymbol].
    syntaxColor := (UserPreferences current perform: syntaxColorSelector value) asValue.
    colorMenu := ColorMenu new.
    colorMenu model: syntaxColor.
    syntaxColor onChangeSend: #value to: 
        [UserPreferences current at:  syntaxColorSelector value put: syntaxColor value].
    syntaxColors onChangeSend: #value to: 
        [syntaxColor value: (UserPreferences current perform:syntaxColorSelector value).
         syntaxEmphasises selection: (UserPreferences current perform: syntaxEmphasisSelector value)].
    syntaxEmphasisesBox := box addComboListOn: (syntaxEmphasises := SelectionInList with:#(normal bold italic) asValue initialSelection:1).
    syntaxEmphasises onChangeSend: #value to: 
        [UserPreferences current at: syntaxEmphasisSelector value put: syntaxEmphasises selection asSymbol].
    syntaxColors changed:#value. "/ to force initial update of emphasis
    box addComponent:colorMenu tabable:true.
    syntaxColoringResetBox := box addComponent:(Button new label: (resources string:'reset'); action: [UserPreferences reset. syntaxColor value: (UserPreferences current perform:syntaxColorSelector value)]).

    syntaxColoringEnableBlock := 
    [syntaxColoring value 
        ifTrue: [syntaxColoringBox enable.  colorMenu enable.  syntaxEmphasisesBox enable.  syntaxColoringResetBox enable] 
        ifFalse:[syntaxColoringBox disable. colorMenu disable. syntaxEmphasisesBox disable. syntaxColoringResetBox disable]
    ].
    syntaxColoringEnableBlock value.
    syntaxColoring onChangeSend: #value to: syntaxColoringEnableBlock.

    box addHorizontalLine.
    box 
        addHelpButtonFor:'Launcher/sourceSettings.html';
        addAbortButton; 
        addOkButton.

    "/
    "/ show the box ...
    "/
    box open.

    "/
    "/ update system settings
    "/
    box accepted ifTrue:[
        Class keepMethodHistory:keepMethodHistory value.
        Smalltalk logDoits:logDoits value.
        Class updateChanges:updChanges value.
        ObjectMemory nameForChanges:changeFileName value.

        (hasManager and:[useManager value]) ifTrue:[
            manager isNil ifTrue:[
                Smalltalk at:#SourceCodeManager put:(AbstractSourceCodeManager defaultManager).
                manager := Smalltalk at:#SourceCodeManager.
            ].
            Class tryLocalSourceFirst:(localSourceFirst value).
            manager notNil ifTrue:[
                localSourceFirst value ifFalse:[
                    nm := sourceCacheDir value.

                    (fn := nm asFilename) exists ifFalse:[
                        (self confirm:('cache directory ''' , nm , ''' does not exists\create ?' withCRs)) ifTrue:[
                            fn makeDirectory; 
                               makeReadableForAll;
                               makeWritableForAll;
                               makeExecutableForAll.
                        ]
                    ].
                    (fn exists 
                    and:[fn isDirectory
                    and:[fn isReadable
                    and:[fn isWritable]]]) ifTrue:[
                        AbstractSourceCodeManager cacheDirectoryName:(sourceCacheDir value).
                    ]
                ]
            ].

            repositoryHolder notNil ifTrue:[
                repositoryHolder value size > 0 ifTrue:[
                    manager initializeForRepository:repositoryHolder value.
                ].
            ].
        ] ifFalse:[
            Smalltalk at:#SourceCodeManager put:nil
        ].

        showErrorNotifier value ifFalse:[
            Exception emergencyHandler:nil
        ] ifTrue:[
            Exception emergencyHandler:(Launcher notifyingEmergencyHandler)
        ].
        DebugView defaultVerboseBacktrace:(showVerboseStack value).
        UserPreferences current syntaxColoring:syntaxColoring value.

    ] ifFalse: [
        (UserPreferences reset; current) declareAllFrom: oldUserPreferences
    ].
    box destroy

    "Modified: / 15.4.1998 / 13:41:37 / cg"
    "Modified: / 16.4.1998 / 17:18:16 / ca"
!

viewStyleSetting 
    "open a dialog on viewStyle related settings"

    |listOfStyles resourceDir dir box 
     list listView scrView infoLabel infoForwarder newStyle
     someRsrcFile didApply|

    "
     search resources directory for a list of .style files ...
    "
    someRsrcFile := Smalltalk getSystemFileName:('resources' asFilename constructString:'normal.style').
    someRsrcFile notNil ifTrue:[
        resourceDir := someRsrcFile asFilename directoryName
    ] ifFalse:[
        resourceDir := Smalltalk getSystemFileName:'resources'.
    ].

    resourceDir isNil ifTrue:[
        self warn:'no styles found (missing ''resources'' directory)'.
        ^ self
    ].
    dir := resourceDir asFilename directoryContents.

    listOfStyles := dir select:[:aFileName | aFileName asFilename hasSuffix:'style'].
    listOfStyles := listOfStyles collect:[:aFileName | aFileName asFilename withoutSuffix name].
    Filename isCaseSensitive ifFalse:[
        listOfStyles := listOfStyles collect:[:aStyleName | aStyleName asLowercase].
    ].
    listOfStyles sort.

"/ old code: used a standard ListSelectionBox
"/ changed to intercept selection and add info-output.

"/    box := ListSelectionBox title:(resources string:'STYLE_MSG') withCRs.
"/    box label:(resources string:'Style selection').
"/    box list:listOfStyles.
"/    box initialText:View defaultStyle.
"/    box selectAction:[:newStyle |
"/    ].    
"/    box action:[:newStyle |
"/        transcript topView withCursor:Cursor wait do:[
"/            transcript showCR:'change style to ' , newStyle , ' ...'.
"/            View defaultStyle:newStyle asSymbol.
"/        ]
"/    ].    
"/    box showAtPointer

"/ new code: build box 'by 'hand'
"/
    infoForwarder := [
                        |nm sheet comment|
                        nm := list selection.
                        sheet := ViewStyle fromFile:(nm , '.style').
                        comment := sheet at:#comment ifAbsent:''.
                        infoLabel label:comment withCRs asStringCollection
                       ].

    list := SelectionInList with:listOfStyles.
    list onChangeSend:#value to:infoForwarder.

    box := Dialog new.
    box label:(resources string:'Style selection').

    (box addTextLabel:(resources string:'STYLE_MSG') withCRs) adjust:#left.
    listView := SelectionInListView on:list.
    listView doubleClickAction:[:sel | box accept value:true. box hide].
    scrView := box addComponent:(ScrollableView forView:listView) tabable:true.

    box addVerticalSpace.

    (infoLabel := box addTextLabel:'\\' withCRs) adjust:#centerLeft.

    box addAbortButton.
    "b := box addButton:(Button label:(resources string:'apply'))."
    "b action:[didApply := true. self changeViewStyleTo:(list selection)]."
    box addOkButton.
    list selection:(View defaultStyle).

    box stickAtBottomWithVariableHeight:scrView.
    box stickAtBottomWithFixHeight:infoLabel.
    box open.

    box accepted ifTrue:[
        ((newStyle := list selection) ~= View defaultStyle
        or:[didApply ~~ true]) ifTrue:[
            self changeViewStyleTo:newStyle.
        ].
    ].
    box destroy
! !

!NewLauncher methodsFor:'user actions - system'!

compressingGarbageCollect
    "perform a compressing garbageCollect"

    ObjectMemory verboseGarbageCollect

!

garbageCollect
    "perform a non-compressing garbageCollect"

    ObjectMemory reclaimSymbols

!

initJavaVM
    JavaVM initializeVM

    "Created: / 9.2.1998 / 12:06:07 / cg"
!

startLatencyMonitor
    "open an interruptLatencyMonitor view"

    InterruptLatencyMonitor notNil ifTrue:[
        Autoload autoloadFailedSignal catch:[
            InterruptLatencyMonitor autoload.
        ].
        InterruptLatencyMonitor isLoaded ifTrue:[
            InterruptLatencyMonitor open.
            ^ self.
        ]
    ].
    self warn:'Sorry - the irq latency monitor is only available
in the full commercial release'.

!

startStopEventTrace
    "start/stop event tracing for a particular view"

    |v wg|

    v := Screen current viewFromUser.
    v notNil ifTrue:[
        v := v topView.
        wg := v windowGroup.
        wg notNil ifTrue:[
            "/
            "/ toggle eventTrace in its windowGroup
            "/
            wg traceEvents:(wg preEventHook isNil)
        ]
    ]

! !

!NewLauncher methodsFor:'user actions - tools'!

newProject 
    "creates a new project & opens a projectView for it"

    Project notNil ifTrue: [(ProjectView for: Project new) open]
!

selectProject
    "asks for and switch to another project"

    |list box|

    Project notNil ifTrue:[
        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.
        box destroy
    ]
!

startNewLauncher
    "opens the new launcher"

    NewLauncher openAt:(self window origin)

!

startOldLauncher
    "opens the old launcher"

    Launcher openAt:(self window origin)

! !

!NewLauncher methodsFor:'user actions - windows'!

deIconifyAllWindows
    |setOfViews|

    setOfViews := Project current views asIdentitySet.
    setOfViews addAll:(Project defaultProject views).

    setOfViews do:[:aTopView |
        aTopView device == Screen current ifTrue:[
            aTopView expand
        ].
    ].

!

findAndDestroyWindow
    "find a window (by name) and destroy it"

    |v|
    v := self findWindow:'select view to close:'.
    v notNil ifTrue:[v destroy]

!

findAndRaiseWindow
    "find a window (by name) and raise it"

    |v|

    v := self findWindow:'select view to raise deiconified:'.
    v notNil ifTrue:[v raiseDeiconified]

!

fullScreenHardcopy
    "after a second (to allow redraw of views under menu ...),
     save the contents of the whole screen."

    Processor 
        addTimedBlock:[
                        self 
                            saveScreenImage:(Image fromScreen) 
                            defaultName:'screen'
                      ] 
        afterSeconds:1

!

iconifyAllWindows
    |setOfViews|

    setOfViews := Project current views asIdentitySet.
    setOfViews addAll:(Project defaultProject views).

    setOfViews do:[:aTopView |
        aTopView device == Screen current ifTrue:[
            aTopView collapse
        ]
    ]

!

pickAView
    "let user pick a view and return it"

    |v|

    (Delay forSeconds:1) wait.
    v := Screen current viewFromUser.
    v isNil ifTrue:[
        self warn:'Sorry, this is not a smalltalk view'.
        ^ nil
    ].
    ^ v

!

screenHardcopy
    "after a second (to allow redraw of views under menu ...),
     let user specify a rectangular area on the screen
     and save its contents."

    |area|

    Processor 
        addTimedBlock:[
                        [Screen current leftButtonPressed] whileTrue:[Processor yield].

                        area := Rectangle fromUser.
                        (area width > 0 and:[area height > 0]) ifTrue:[
                            self saveScreenImage:(Image fromScreen:area) defaultName:'hardcopy'
                        ]
                      ] 
        afterSeconds:1

!

startWindowTreeView
    "open a windowTree view (on a topView)"

    |v|

    v := self pickAView.
    v notNil ifTrue:[
        WindowTreeView openOn:v topView
    ]

!

viewDestroy
    "let user pick a view and destroy it.
     Even allow destroying non-smalltalk views
     (also for views which I forgot due to some error)"

    |device v id i c|

    (Delay forSeconds:1) wait.

    device := Screen current.
    i := Image fromFile:'bitmaps/xpmBitmaps/cursors/cross2.xpm'.
    i isNil ifTrue:[
        c := Cursor crossHair
    ] ifFalse:[
        c := Cursor fromImage:i
    ].
    id := device viewIdFromPoint:(device pointFromUserShowing:c).
    (v := device viewFromId:id) notNil ifTrue:[
        v topView destroy.
        ^ self
    ].
    id = device rootView id ifTrue:[
        ^ self
    ].
    (Dialog confirm:'mhmh, this may not a be smalltalk view\(Or I somehow forgot about it).\Destroy anyway ?' withCRs)
    ifTrue:[
        device destroyView:nil withId:id
    ].


!

viewHardcopy
    "after a second (to allow redraw of views under menu ...),
     let user specify a view and save its contents."

    Processor 
        addTimedBlock:[
                        |v|
                        (v := Screen current viewFromUser) notNil ifTrue:[
                            self saveScreenImage:(Image fromView:(v topView)) defaultName:'hardcopy'
                        ]
                      ] 
        afterSeconds:1

!

viewInspect
    "let user pick a view and inspect it. Only smalltalk views are allowed"

    |v|

    (v := self pickAView) notNil 
    ifTrue:
    [
        v inspect
    ]

! !

!NewLauncher class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/NewLauncher.st,v 1.54 1998-04-16 15:22:15 cg Exp $'
! !