Initial revision
authorclaus
Sat, 25 Mar 1995 23:23:29 +0100
changeset 84 700f3924df1d
parent 83 a383cbb18ab9
child 85 d9713a3ca092
Initial revision
AboutBox.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AboutBox.st	Sat Mar 25 23:23:29 1995 +0100
@@ -0,0 +1,118 @@
+"
+ 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.1 1995-03-25 22:23:29 claus Exp $
+"
+!
+
+documentation
+"
+    A box specialized to show the ST/X about information.
+"
+!
+
+examples
+"
+    AboutBox new open
+"
+!
+
+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
+
+! !
+
+!AboutBox methodsFor:'initialization'!
+
+initialize 
+    |box dark green lbl|
+
+    super initialize.
+
+    self label:'About ...'.
+
+    device hasColors ifTrue:[
+        green := (Color red:0 green:80 blue:20) darkened.
+    ] ifFalse:[
+        green := White.
+    ].
+    device hasGreyscales ifTrue:[
+        dark := Color grey:10.
+    ] ifFalse:[
+        dark := 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:
+'Smalltalk/X
+
+Version ......... ' , Smalltalk versionString , '.' , Smalltalk releaseNr printString ,
+                      ' (' , Smalltalk versionDate printString , ')
+Configuration ... ' , Smalltalk configuration , '
+Running on ...... ' , OperatingSystem getHostName , '
+
+' , Smalltalk copyrightString.
+
+    self okText:'close'.
+
+
+! !
+
+!AboutBox methodsFor:'show / hide'!
+
+show
+    self autoHideAfter:10 with:[].
+    super showAtCenter.
+
+    "
+     AboutBox new show
+    "
+! !
+