84
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
92
|
3 |
All Rights Reserved
|
84
|
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 |
"
|
111
|
26 |
$Header: /cvs/stx/stx/libtool/AboutBox.st,v 1.7 1995-08-10 18:36:52 claus Exp $
|
84
|
27 |
"
|
|
28 |
!
|
|
29 |
|
|
30 |
documentation
|
|
31 |
"
|
|
32 |
A box specialized to show the ST/X about information.
|
92
|
33 |
Can be subclasses for your own aboutBoxes; to do so, redefine
|
|
34 |
defaultIcon and aboutText.
|
84
|
35 |
|
92
|
36 |
example:
|
|
37 |
AboutBox new open
|
|
38 |
|
|
39 |
AboutBox new showAtPointer
|
84
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
copyright
|
|
44 |
"
|
|
45 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
92
|
46 |
All Rights Reserved
|
84
|
47 |
|
|
48 |
This software is furnished under a license and may be used
|
|
49 |
only in accordance with the terms of that license and with the
|
|
50 |
inclusion of the above copyright notice. This software may not
|
|
51 |
be provided or otherwise made available to, or used by, any
|
|
52 |
other person. No title to or ownership of the software is
|
|
53 |
hereby transferred.
|
|
54 |
"
|
|
55 |
! !
|
|
56 |
|
|
57 |
!AboutBox class methodsFor:'defaults'!
|
|
58 |
|
|
59 |
defaultIcon
|
|
60 |
CachedIcon isNil ifTrue:[
|
92
|
61 |
CachedIcon := Form fromFile:'SmalltalkX.xbm' resolution:100.
|
84
|
62 |
].
|
|
63 |
^ CachedIcon
|
92
|
64 |
!
|
84
|
65 |
|
92
|
66 |
aboutText
|
|
67 |
^
|
|
68 |
'Smalltalk/X
|
|
69 |
|
|
70 |
Version ......... ' , Smalltalk versionString , '.' , Smalltalk releaseNr printString ,
|
|
71 |
' (' , Smalltalk versionDate printString , ')
|
|
72 |
Configuration ... ' , Smalltalk configuration , '
|
|
73 |
Running on ...... ' , OperatingSystem getHostName , '
|
|
74 |
|
|
75 |
' , Smalltalk copyrightString.
|
84
|
76 |
! !
|
|
77 |
|
|
78 |
!AboutBox methodsFor:'initialization'!
|
|
79 |
|
|
80 |
initialize
|
107
|
81 |
|dark green lbl|
|
84
|
82 |
|
|
83 |
super initialize.
|
|
84 |
|
|
85 |
self label:'About ...'.
|
|
86 |
|
|
87 |
device hasColors ifTrue:[
|
105
|
88 |
green := (Color red:0 green:80 blue:20) "darkened".
|
92
|
89 |
dark := Color grey:10.
|
84
|
90 |
] ifFalse:[
|
100
|
91 |
green := Color white.
|
|
92 |
dark := Color black.
|
84
|
93 |
].
|
|
94 |
|
|
95 |
self viewBackground:dark;
|
92
|
96 |
allSubViewsDo:[:s | s viewBackground:dark].
|
|
97 |
|
84
|
98 |
self form:(self class defaultIcon).
|
|
99 |
(lbl := self formLabel) viewBackground:dark.
|
|
100 |
lbl foregroundColor:green backgroundColor:dark.
|
|
101 |
(lbl := self textLabel) viewBackground:dark.
|
|
102 |
lbl foregroundColor:White backgroundColor:dark.
|
92
|
103 |
self title:(self class aboutText).
|
84
|
104 |
self okText:'close'.
|
|
105 |
! !
|
|
106 |
|
|
107 |
!AboutBox methodsFor:'show / hide'!
|
|
108 |
|
|
109 |
show
|
100
|
110 |
"redefined to automatically hide myself after some time"
|
|
111 |
|
84
|
112 |
self autoHideAfter:10 with:[].
|
|
113 |
super showAtCenter.
|
|
114 |
|
|
115 |
"
|
|
116 |
AboutBox new show
|
|
117 |
"
|
|
118 |
! !
|
|
119 |
|