author | Claus Gittinger <cg@exept.de> |
Sun, 24 Mar 1996 18:59:04 +0100 | |
changeset 451 | 35d5ba59ee0e |
parent 248 | 3813e693e329 |
child 452 | 33ce1b3cd502 |
permissions | -rw-r--r-- |
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 |
InfoBox subclass:#AboutBox |
|
451
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
14 |
instanceVariableNames:'' |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
15 |
classVariableNames:'CachedIcon' |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
16 |
poolDictionaries:'' |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
17 |
category:'Views-DialogBoxes' |
84 | 18 |
! |
19 |
||
20 |
!AboutBox class methodsFor:'documentation'! |
|
21 |
||
198 | 22 |
copyright |
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
26 |
||
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
84 | 34 |
! |
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
A box specialized to show the ST/X about information. |
|
92 | 39 |
Can be subclasses for your own aboutBoxes; to do so, redefine |
40 |
defaultIcon and aboutText. |
|
84 | 41 |
|
92 | 42 |
example: |
43 |
AboutBox new open |
|
44 |
||
45 |
AboutBox new showAtPointer |
|
84 | 46 |
" |
47 |
! ! |
|
48 |
||
49 |
!AboutBox class methodsFor:'defaults'! |
|
50 |
||
92 | 51 |
aboutText |
125 | 52 |
"return a string to be shown in the box" |
53 |
||
179
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
54 |
|distributor| |
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
55 |
|
186 | 56 |
distributor := ''. |
57 |
"/ distributor := Smalltalk distributorString. |
|
58 |
"/ distributor notEmpty ifTrue:[ |
|
59 |
"/ distributor := 'Distributed by: ' , distributor |
|
60 |
"/ ]. |
|
179
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
61 |
|
92 | 62 |
^ |
179
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
63 |
'SmallTalk/X |
92 | 64 |
|
65 |
Version ......... ' , Smalltalk versionString , '.' , Smalltalk releaseNr printString , |
|
66 |
' (' , Smalltalk versionDate printString , ') |
|
67 |
Configuration ... ' , Smalltalk configuration , ' |
|
68 |
Running on ...... ' , OperatingSystem getHostName , ' |
|
69 |
||
179
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
70 |
' , Smalltalk copyrightString , ' |
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
71 |
|
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
72 |
' , distributor. |
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
73 |
|
f464e3c75104
if nonEmpty, display distributorString
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
74 |
"Modified: 16.11.1995 / 18:34:16 / cg" |
198 | 75 |
! |
76 |
||
77 |
defaultIcon |
|
78 |
"return a smalltalk/X icon" |
|
79 |
||
80 |
CachedIcon isNil ifTrue:[ |
|
81 |
CachedIcon := Form fromFile:'SmalltalkX.xbm' resolution:100. |
|
82 |
]. |
|
83 |
^ CachedIcon |
|
84 | 84 |
! ! |
85 |
||
451
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
86 |
!AboutBox methodsFor:'accessing'! |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
87 |
|
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
88 |
backgroundColor:aColor |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
89 |
|lbl| |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
90 |
|
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
91 |
self withAllSubViewsDo:[:s | s viewBackground:aColor]. |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
92 |
|
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
93 |
(lbl := self formLabel) viewBackground:aColor. |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
94 |
lbl backgroundColor:aColor. |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
95 |
(lbl := self textLabel) viewBackground:aColor. |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
96 |
lbl backgroundColor:aColor. |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
97 |
|
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
98 |
"Created: 24.3.1996 / 18:19:35 / cg" |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
99 |
! ! |
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
100 |
|
84 | 101 |
!AboutBox methodsFor:'initialization'! |
102 |
||
103 |
initialize |
|
107 | 104 |
|dark green lbl| |
84 | 105 |
|
106 |
super initialize. |
|
107 |
||
108 |
self label:'About ...'. |
|
109 |
||
110 |
device hasColors ifTrue:[ |
|
248 | 111 |
green := (Color red:0 green:80 blue:20) "darkened". |
112 |
dark := Color grey:10. |
|
84 | 113 |
] ifFalse:[ |
248 | 114 |
green := Color white. |
115 |
dark := Color black. |
|
84 | 116 |
]. |
117 |
||
451
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
118 |
self backgroundColor:dark. |
248 | 119 |
|
120 |
"Created: 7.12.1995 / 17:03:09 / cg" |
|
451
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
121 |
"Modified: 24.3.1996 / 18:58:36 / cg" |
84 | 122 |
! ! |
123 |
||
124 |
!AboutBox methodsFor:'show / hide'! |
|
125 |
||
126 |
show |
|
100 | 127 |
"redefined to automatically hide myself after some time" |
128 |
||
84 | 129 |
self autoHideAfter:10 with:[]. |
130 |
super showAtCenter. |
|
131 |
||
132 |
" |
|
133 |
AboutBox new show |
|
134 |
" |
|
135 |
! ! |
|
136 |
||
248 | 137 |
!AboutBox class methodsFor:'documentation'! |
138 |
||
139 |
version |
|
451
35d5ba59ee0e
added access method for background color
Claus Gittinger <cg@exept.de>
parents:
248
diff
changeset
|
140 |
^ '$Header: /cvs/stx/stx/libtool/AboutBox.st,v 1.14 1996-03-24 17:59:04 cg Exp $' |
248 | 141 |
! ! |