AboutBox.st
changeset 84 700f3924df1d
child 92 e9cc2640660f
equal deleted inserted replaced
83:a383cbb18ab9 84:700f3924df1d
       
     1 "
       
     2  COPYRIGHT (c) 1995 by Claus Gittinger
       
     3               All Rights Reserved
       
     4 
       
     5  This software is furnished under a license and may be used
       
     6  only in accordance with the terms of that license and with the
       
     7  inclusion of the above copyright notice.   This software may not
       
     8  be provided or otherwise made available to, or used by, any
       
     9  other person.  No title to or ownership of the software is
       
    10  hereby transferred.
       
    11 "
       
    12 
       
    13 'From Smalltalk/X, Version:2.10.5 on 22-mar-1995 at 6:53:38 am'!
       
    14 
       
    15 InfoBox subclass:#AboutBox
       
    16 	 instanceVariableNames:''
       
    17 	 classVariableNames:'CachedIcon'
       
    18 	 poolDictionaries:''
       
    19 	 category:'Views-DialogBoxes'
       
    20 !
       
    21 
       
    22 !AboutBox class methodsFor:'documentation'!
       
    23 
       
    24 version
       
    25 "
       
    26 $Header: /cvs/stx/stx/libtool/AboutBox.st,v 1.1 1995-03-25 22:23:29 claus Exp $
       
    27 "
       
    28 !
       
    29 
       
    30 documentation
       
    31 "
       
    32     A box specialized to show the ST/X about information.
       
    33 "
       
    34 !
       
    35 
       
    36 examples
       
    37 "
       
    38     AboutBox new open
       
    39 "
       
    40 !
       
    41 
       
    42 copyright
       
    43 "
       
    44  COPYRIGHT (c) 1995 by Claus Gittinger
       
    45               All Rights Reserved
       
    46 
       
    47  This software is furnished under a license and may be used
       
    48  only in accordance with the terms of that license and with the
       
    49  inclusion of the above copyright notice.   This software may not
       
    50  be provided or otherwise made available to, or used by, any
       
    51  other person.  No title to or ownership of the software is
       
    52  hereby transferred.
       
    53 "
       
    54 ! !
       
    55 
       
    56 !AboutBox class methodsFor:'defaults'!
       
    57 
       
    58 defaultIcon
       
    59     CachedIcon isNil ifTrue:[
       
    60         CachedIcon := Form fromFile:'SmalltalkX.xbm' resolution:100.
       
    61     ].
       
    62     ^ CachedIcon
       
    63 
       
    64 ! !
       
    65 
       
    66 !AboutBox methodsFor:'initialization'!
       
    67 
       
    68 initialize 
       
    69     |box dark green lbl|
       
    70 
       
    71     super initialize.
       
    72 
       
    73     self label:'About ...'.
       
    74 
       
    75     device hasColors ifTrue:[
       
    76         green := (Color red:0 green:80 blue:20) darkened.
       
    77     ] ifFalse:[
       
    78         green := White.
       
    79     ].
       
    80     device hasGreyscales ifTrue:[
       
    81         dark := Color grey:10.
       
    82     ] ifFalse:[
       
    83         dark := Black.
       
    84     ].
       
    85 
       
    86     self viewBackground:dark; 
       
    87          allSubViewsDo:[:s | s viewBackground:dark].
       
    88     self form:(self class defaultIcon).
       
    89     (lbl := self formLabel) viewBackground:dark.
       
    90     lbl foregroundColor:green backgroundColor:dark.
       
    91     (lbl := self textLabel) viewBackground:dark.
       
    92     lbl foregroundColor:White backgroundColor:dark.
       
    93     self title:
       
    94 'Smalltalk/X
       
    95 
       
    96 Version ......... ' , Smalltalk versionString , '.' , Smalltalk releaseNr printString ,
       
    97                       ' (' , Smalltalk versionDate printString , ')
       
    98 Configuration ... ' , Smalltalk configuration , '
       
    99 Running on ...... ' , OperatingSystem getHostName , '
       
   100 
       
   101 ' , Smalltalk copyrightString.
       
   102 
       
   103     self okText:'close'.
       
   104 
       
   105 
       
   106 ! !
       
   107 
       
   108 !AboutBox methodsFor:'show / hide'!
       
   109 
       
   110 show
       
   111     self autoHideAfter:10 with:[].
       
   112     super showAtCenter.
       
   113 
       
   114     "
       
   115      AboutBox new show
       
   116     "
       
   117 ! !
       
   118