StataScriptEditorMain.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 17 Mar 2015 04:34:49 +0000
changeset 1 7bfafe79fa34
parent 0 da028ec9cc07
permissions -rw-r--r--
Minor UI fixes * Fixed About box * Added "Documentation" and "Report Problem" menu entries * Better file open handling * Nicer window labeling

"{ Package: 'jv:statascripteditor' }"

"{ NameSpace: Smalltalk }"

StandaloneStartup subclass:#StataScriptEditorMain
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Stata Script Editor'
!


!StataScriptEditorMain class methodsFor:'constants & defaults'!

applicationRegistryPath
    "the key under which this application stores its process ID in the registry
     as a collection of path-components.
     i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
     in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
     (would also be used as a relative path for a temporary lock file under unix).
     Used to detect if another instance of this application is already running."

    ^ #('stx' 'StataScriptEditor')
!

applicationUUID
    "answer an application-specific unique uuid.
     This is used as the name of some exclusive OS-resource, which is used to find out,
     if another instance of this application is already running.
     Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used.
     If redefined, please return a real UUID (i.e. UUID fromString:'.....') and not a string or 
     similar possibly conflicting identifier.
     You can paste a fresh worldwide unique id via the editor's more-misc-paste UUID menuFunction."

    ^ UUID fromString:'9cae6e80-ad00-11e4-9cc7-606720e43e2c' 
! !

!StataScriptEditorMain class methodsFor:'defaults'!

allowDebugOption
    "enable/disable the --debug startup option.
     Can be redefined in subclasses to enable it"

    ^ true

    "Created: / 12-03-2015 / 02:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

suppressRCFileReading
    "enable/disable the rc-file reading (and also the --rcFileName option).
     If suppressed, there is no chance to interfere with the startup.
     Can be redefined in subclasses to disable it"

    ^ true

    "Created: / 12-03-2015 / 02:28:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!StataScriptEditorMain class methodsFor:'startup'!

main:argv
    "main entry; argv is the array of command arguments (as array of words from space-separated command line).
     Parse arguments, and proceed to the real work function"

    "/ do not exit here; caller will go into event loop when returning

    Smalltalk openDisplay.
    StataScriptEditor open

    "Modified: / 12-03-2015 / 03:16:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

realMain:args
    "opens the application"

    StataScriptEditor open
!

usage
    Stderr nextPutLine:'usage: ',self applicationName,' [options...]'.
    Stderr nextPutLine:'  -h .................. output this message'.

    Smalltalk isStandAloneApp ifTrue:[ Smalltalk exit:1 ].
! !

!StataScriptEditorMain class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !