AboutBox.st
author claus
Thu, 10 Aug 1995 20:38:26 +0200
changeset 111 b4ef3e799345
parent 110 570a38362ae1
child 125 6d6f62d9e73d
permissions -rw-r--r--
,

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      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.
"

'From Smalltalk/X, Version:2.10.5 on 22-mar-1995 at 6:53:38 am'!

InfoBox subclass:#AboutBox
	 instanceVariableNames:''
	 classVariableNames:'CachedIcon'
	 poolDictionaries:''
	 category:'Views-DialogBoxes'
!

!AboutBox class methodsFor:'documentation'!

version
"
$Header: /cvs/stx/stx/libtool/AboutBox.st,v 1.7 1995-08-10 18:36:52 claus Exp $
"
!

documentation
"
    A box specialized to show the ST/X about information.
    Can be subclasses for your own aboutBoxes; to do so, redefine
    defaultIcon and aboutText.

    example:
	AboutBox new open

	AboutBox new showAtPointer
"
!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      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.
"
! !

!AboutBox class methodsFor:'defaults'!

defaultIcon
    CachedIcon isNil ifTrue:[
	CachedIcon := Form fromFile:'SmalltalkX.xbm' resolution:100.
    ].
    ^ CachedIcon
!

aboutText
    ^
'Smalltalk/X

Version ......... ' , Smalltalk versionString , '.' , Smalltalk releaseNr printString ,
		      ' (' , Smalltalk versionDate printString , ')
Configuration ... ' , Smalltalk configuration , '
Running on ...... ' , OperatingSystem getHostName , '

' , Smalltalk copyrightString.
! !

!AboutBox methodsFor:'initialization'!

initialize 
    |dark green lbl|

    super initialize.

    self label:'About ...'.

    device hasColors ifTrue:[
	green := (Color red:0 green:80 blue:20) "darkened".
	dark := Color grey:10.
    ] ifFalse:[
	green := Color white.
	dark := Color black.
    ].

    self viewBackground:dark; 
	 allSubViewsDo:[:s | s viewBackground:dark].

    self form:(self class defaultIcon).
    (lbl := self formLabel) viewBackground:dark.
    lbl foregroundColor:green backgroundColor:dark.
    (lbl := self textLabel) viewBackground:dark.
    lbl foregroundColor:White backgroundColor:dark.
    self title:(self class aboutText).
    self okText:'close'.
! !

!AboutBox methodsFor:'show / hide'!

show
    "redefined to automatically hide myself after some time"

    self autoHideAfter:10 with:[].
    super showAtCenter.

    "
     AboutBox new show
    "
! !