author | Stefan Vogel <sv@exept.de> |
Wed, 26 Nov 2014 17:02:19 +0100 | |
changeset 5184 | 50ede725bf12 |
parent 4863 | 12c87ee0e767 |
child 5402 | 36164fbcd8dc |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
" |
|
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
13 |
|
77 | 14 |
DialogBox subclass:#InfoBox |
355 | 15 |
instanceVariableNames:'formLabel textLabel' |
16 |
classVariableNames:'InfoBitmap' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Views-DialogBoxes' |
|
0 | 19 |
! |
20 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
21 |
!InfoBox class methodsFor:'documentation'! |
0 | 22 |
|
197 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
||
36 |
||
77 | 37 |
! |
8 | 38 |
|
39 |
documentation |
|
40 |
" |
|
355 | 41 |
Historic note: |
42 |
originally, ST/X had separate classes for the various entry methods; |
|
43 |
there were YesNoBox, EnterBox, InfoBox and so on. |
|
44 |
In the meantime, the DialogBox class (and therefore its alias: Dialog) |
|
45 |
is going to duplicate most funcionality found in these classes. |
|
46 |
||
47 |
In the future, those existing subclasses' functionality is going to |
|
48 |
be moved fully into Dialog, and the subclasses will be replaced by dummy |
|
49 |
delegators. (They will be kept for backward compatibility, though). |
|
50 |
||
51 |
||
52 |
||
38 | 53 |
this class implements a pop-up box to show an information message. |
54 |
It has a single ok-Button, which closes the box. |
|
55 |
Also entering return has (by default) the same effect as pressing |
|
56 |
the ok-button. |
|
59 | 57 |
InfoBox is a superclass of some other boxes - see WarningBox, YesNoBox etc. |
58 |
most of them simply redefine the icon shown in the upper left or |
|
59 |
add buttons. |
|
60 |
||
585 | 61 |
[instance variables:] |
59 | 62 |
|
355 | 63 |
formLabel <Label> shows a bitmap (warning, question-mark) |
59 | 64 |
|
355 | 65 |
textLabel <Label> shows the boxes text |
59 | 66 |
|
585 | 67 |
|
68 |
[author:] |
|
69 |
Claus Gittinger |
|
77 | 70 |
" |
59 | 71 |
|
77 | 72 |
! |
38 | 73 |
|
77 | 74 |
examples |
75 |
" |
|
2469 | 76 |
Notice, the preferred use is via the DialogBox class messages, |
77 |
such as |
|
78 |
[exBegin] |
|
79 |
Dialog information:'Time to go home' |
|
80 |
[exEnd] |
|
81 |
these (DialogBox) mesages are compatible with VW and should therefore |
|
82 |
be used for portability. |
|
83 |
||
84 |
Direct use of InfoBox is only required for highly specialized boxes. |
|
85 |
||
86 |
||
87 |
||
59 | 88 |
InfoBoxes are created with: |
89 |
||
370 | 90 |
aBox := InfoBox title:'some title'. |
38 | 91 |
|
92 |
and shown with: |
|
93 |
||
370 | 94 |
aBox showAtPointer |
59 | 95 |
or |
370 | 96 |
aBox open |
38 | 97 |
|
98 |
The default box shows 'yes' in its button; this can be changed with: |
|
99 |
||
370 | 100 |
aBox okText:'some string'. |
38 | 101 |
|
102 |
the boxes bitmap-image can be changed with: |
|
103 |
||
370 | 104 |
aBox image:aForm |
77 | 105 |
|
106 |
||
107 |
Since this type of information is pretty common, a convenient information |
|
108 |
method has been added to Object. |
|
109 |
Thus, you can use: |
|
593 | 110 |
[exBegin] |
370 | 111 |
self information:'hello world' |
593 | 112 |
[exEnd] |
370 | 113 |
|
77 | 114 |
everwhere in your program. |
370 | 115 |
for ST-80 compatibility, you can also use: |
593 | 116 |
[exBegin] |
370 | 117 |
Dialog information:'hello world' |
593 | 118 |
[exEnd] |
370 | 119 |
|
120 |
||
77 | 121 |
|
122 |
standard box: |
|
593 | 123 |
[exBegin] |
370 | 124 |
|box| |
77 | 125 |
|
370 | 126 |
box := InfoBox title:'hello world '. |
127 |
box open |
|
593 | 128 |
[exEnd] |
77 | 129 |
|
130 |
||
131 |
changing the buttons label: |
|
593 | 132 |
[exBegin] |
370 | 133 |
|box| |
77 | 134 |
|
370 | 135 |
box := InfoBox title:'hello world '. |
136 |
box okText:'wow'. |
|
137 |
box open |
|
593 | 138 |
[exEnd] |
77 | 139 |
|
140 |
||
141 |
changing the icon: |
|
142 |
||
593 | 143 |
[exBegin] |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
144 |
|box| |
77 | 145 |
|
370 | 146 |
box := InfoBox title:'hello world '. |
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
147 |
box image:(Image fromFile:'libtool/bitmaps/SBrowser.xbm' inPackage:'stx:libtool'). |
370 | 148 |
box okText:'wow'. |
149 |
box open |
|
593 | 150 |
[exEnd] |
77 | 151 |
|
152 |
or even: |
|
593 | 153 |
[exBegin] |
370 | 154 |
|box| |
77 | 155 |
|
370 | 156 |
box := InfoBox title:'hello garfield '. |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
157 |
box image:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedTo:200@100). |
370 | 158 |
box okText:'wow'. |
159 |
box open |
|
593 | 160 |
[exEnd] |
77 | 161 |
|
162 |
||
163 |
If you plan to use boxes as in the last example, you may want to |
|
164 |
keep the box around for reuse (since the image magnification takes some time). |
|
593 | 165 |
[exBegin] |
370 | 166 |
|box| |
77 | 167 |
|
370 | 168 |
box := InfoBox title:'hello garfield '. |
2362
f6ace7307e4d
examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
169 |
box image:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedTo:200@100). |
370 | 170 |
box okText:'wow'. |
171 |
box open. |
|
77 | 172 |
|
370 | 173 |
box title:'hello again'. |
174 |
box open |
|
593 | 175 |
[exEnd] |
77 | 176 |
|
63 | 177 |
" |
77 | 178 |
! ! |
179 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
180 |
!InfoBox class methodsFor:'instance creation'! |
38 | 181 |
|
77 | 182 |
title:titleString |
183 |
"create a new infoBox with title, aTitleString" |
|
184 |
||
185 |
^ (self new) title:titleString |
|
38 | 186 |
|
77 | 187 |
" |
188 |
(InfoBox title:'hello') open |
|
189 |
" |
|
4207 | 190 |
|
191 |
"Modified: / 22-12-2010 / 19:30:50 / cg" |
|
192 |
! |
|
193 |
||
194 |
title:titleString label:labelString |
|
195 |
"create a new infoBox with label, labelString" |
|
196 |
||
197 |
^ (self new) title:titleString label:labelString |
|
198 |
||
199 |
" |
|
200 |
(InfoBox title:'hello' label:'Attention' ) open |
|
201 |
" |
|
202 |
||
203 |
"Created: / 22-12-2010 / 19:31:03 / cg" |
|
77 | 204 |
! ! |
60 | 205 |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
206 |
!InfoBox class methodsFor:'defaults'! |
60 | 207 |
|
574 | 208 |
defaultLabel |
209 |
"return the boxes default window title." |
|
210 |
||
211 |
^ 'Info' |
|
212 |
||
213 |
"Created: 23.4.1996 / 17:12:33 / cg" |
|
214 |
! |
|
215 |
||
77 | 216 |
iconBitmap |
217 |
"return the bitmap shown as icon in my instances. |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
218 |
This is the default image; you can overwrite this in a concrete |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
219 |
instance with the #image: message" |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
220 |
|
1365 | 221 |
<resource: #style (#'infoBox.icon' #'infoBox.iconFile')> |
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
222 |
|
2786 | 223 |
InfoBitmap isNil ifTrue:[ |
224 |
InfoBitmap := self iconBitmapFromStyle:'infoBox.icon' orStyleFile:'infoBox.iconFile' orFilename:'bitmaps/Information.xbm'. |
|
225 |
]. |
|
226 |
^ InfoBitmap |
|
227 |
||
228 |
"Modified: / 26.10.1997 / 17:02:51 / cg" |
|
229 |
! |
|
230 |
||
231 |
iconBitmapFromStyle:styleName orStyleFile:styleFile orFilename:fileName |
|
232 |
"return the bitmap shown as icon in my instances. |
|
233 |
This is the default image; you can overwrite this in a concrete |
|
234 |
instance with the #image: message" |
|
235 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
236 |
|img imgFileName| |
38 | 237 |
|
2786 | 238 |
img := self styleSheet at:styleName. |
239 |
img isNil ifTrue:[ |
|
240 |
imgFileName := StyleSheet at:styleFile default:fileName. |
|
241 |
img := Smalltalk imageFromFileNamed:imgFileName forClass:self. |
|
77 | 242 |
]. |
2786 | 243 |
img notNil ifTrue:[ |
244 |
img := img onDevice:Display |
|
245 |
]. |
|
246 |
^ img |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
247 |
|
1365 | 248 |
"Modified: / 26.10.1997 / 17:02:51 / cg" |
59 | 249 |
! ! |
250 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
251 |
!InfoBox class methodsFor:'styles'! |
59 | 252 |
|
253 |
updateStyleCache |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
254 |
"extract values from the styleSheet and cache them in class variables. |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
255 |
Here, the cached infoBitmap is simply flushed." |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
370
diff
changeset
|
256 |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
257 |
InfoBitmap := nil |
38 | 258 |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
259 |
"Modified: 1.4.1997 / 14:44:50 / cg" |
59 | 260 |
! ! |
261 |
||
0 | 262 |
!InfoBox methodsFor:'accessing'! |
263 |
||
184 | 264 |
form:aFormOrImage |
265 |
"historical leftover - define a form to be displayed left of the title" |
|
266 |
||
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
267 |
<resource:#obsolete> |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
268 |
|
184 | 269 |
self image:aFormOrImage |
270 |
! |
|
271 |
||
38 | 272 |
formLabel |
273 |
"return the formLabel = can be used to change its appearance" |
|
274 |
||
275 |
^ formLabel |
|
276 |
! |
|
277 |
||
197 | 278 |
image:aForm |
279 |
"define a form to be displayed left of the title |
|
280 |
- usually left as defaulted: |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
281 |
an exclamation-mark here, warn-sign in warningBox, |
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
282 |
others in other subclasses." |
0 | 283 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
284 |
formLabel label:aForm. |
197 | 285 |
formLabel forceResize. |
286 |
shown ifTrue:[self resize] |
|
0 | 287 |
! |
288 |
||
77 | 289 |
textLabel |
290 |
"return the textLabel = can be used to change its appearance" |
|
291 |
||
292 |
^ textLabel |
|
293 |
! |
|
294 |
||
0 | 295 |
title |
8 | 296 |
"return the boxes title string" |
0 | 297 |
|
298 |
^ textLabel label |
|
4207 | 299 |
|
300 |
"Created: / 22-12-2010 / 19:27:43 / cg" |
|
197 | 301 |
! |
0 | 302 |
|
197 | 303 |
title:aString |
4207 | 304 |
"set the boxes label string" |
60 | 305 |
|
197 | 306 |
aString ~= textLabel label ifTrue:[ |
4207 | 307 |
textLabel label:aString. |
308 |
textLabel forceResize. |
|
309 |
shown ifTrue:[self resize] |
|
197 | 310 |
] |
4207 | 311 |
|
312 |
"Created: / 22-12-2010 / 19:27:16 / cg" |
|
313 |
! |
|
314 |
||
315 |
title:aString label:windowLabel |
|
316 |
"set the boxes label string" |
|
317 |
||
318 |
self label:windowLabel. |
|
319 |
aString ~= textLabel label ifTrue:[ |
|
320 |
textLabel label:aString. |
|
321 |
textLabel forceResize. |
|
322 |
shown ifTrue:[self resize] |
|
323 |
] |
|
324 |
||
325 |
"Created: / 22-12-2010 / 19:32:12 / cg" |
|
0 | 326 |
! ! |
327 |
||
77 | 328 |
!InfoBox methodsFor:'initialization'! |
0 | 329 |
|
77 | 330 |
initFormBitmap |
331 |
"setup the bitmap shown in the upper left - |
|
332 |
extracted into a separate method for easier redefinition |
|
333 |
in subclasses" |
|
0 | 334 |
|
2969
eb87f1aedd6c
Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents:
2802
diff
changeset
|
335 |
formLabel label:(self class iconBitmap) |
0 | 336 |
! |
337 |
||
180
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
338 |
initFormLabel |
570 | 339 |
"setup the icon shown in the infoBox. |
340 |
Can be redefined in subclasses." |
|
341 |
||
180
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
342 |
|mm| |
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
343 |
|
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
344 |
mm := ViewSpacing. |
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
345 |
|
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
346 |
formLabel := Label in:self. |
3866 | 347 |
formLabel name: 'formLabel'. |
180
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
348 |
formLabel borderWidth:0. |
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
349 |
formLabel origin:(mm @ mm). |
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
350 |
|
4385 | 351 |
"Created: / 16-11-1995 / 18:32:32 / cg" |
352 |
"Modified: / 22-04-1996 / 18:15:37 / cg" |
|
353 |
"Modified (format): / 28-02-2012 / 18:20:23 / cg" |
|
180
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
354 |
! |
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
355 |
|
77 | 356 |
initialize |
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
357 |
|mm sep| |
77 | 358 |
|
359 |
super initialize. |
|
360 |
self addOkButton. |
|
0 | 361 |
|
574 | 362 |
"/ label := 'Info'. |
77 | 363 |
|
364 |
mm := ViewSpacing. |
|
365 |
||
180
0eb12501889e
hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents:
174
diff
changeset
|
366 |
self initFormLabel. |
77 | 367 |
self initFormBitmap. |
0 | 368 |
|
77 | 369 |
textLabel := Label label:'Information' in:self. |
3866 | 370 |
textLabel name: 'textLabel'. |
77 | 371 |
textLabel borderWidth:0. |
367 | 372 |
textLabel origin:[(mm + formLabel widthIncludingBorder + mm) @ mm]. |
0 | 373 |
|
4295 | 374 |
yPosition := textLabel corner y. |
375 |
formLabel notNil ifTrue:[yPosition := yPosition max:(formLabel corner y)]. |
|
376 |
yPosition := yPosition + ViewSpacing. |
|
377 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
378 |
(styleSheet at:'infoBoxSeparator' default:false) ifTrue:[ |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
379 |
sep := Separator in:self. |
2800
25f261040a9a
allow adding a (single) checkBox
Claus Gittinger <cg@exept.de>
parents:
2786
diff
changeset
|
380 |
sep origin:[0.0 @ ((formLabel bottom max:textLabel bottom) + mm)]. |
3609
3bd1b03b1ffb
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3121
diff
changeset
|
381 |
sep extent:(1.0 @ sep preferredHeight). |
4295 | 382 |
yPosition := yPosition max:(sep corner y). |
383 |
yPosition := yPosition + ViewSpacing. |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
384 |
]. |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
385 |
|
77 | 386 |
" |
387 |
|b| |
|
388 |
||
389 |
b := InfoBox new. |
|
390 |
b title:'hello'. |
|
391 |
b open |
|
392 |
" |
|
367 | 393 |
|
4295 | 394 |
"Modified: / 29-07-2011 / 12:31:29 / cg" |
0 | 395 |
! ! |
197 | 396 |
|
397 |
!InfoBox methodsFor:'queries'! |
|
398 |
||
3121 | 399 |
beepWhenOpening |
400 |
^ UserPreferences current beepForInfoDialog |
|
401 |
||
402 |
" |
|
403 |
Dialog information:'hello' |
|
404 |
Dialog warn:'hello' |
|
405 |
Dialog error:'hello' |
|
406 |
" |
|
407 |
! |
|
408 |
||
197 | 409 |
preferredExtent |
410 |
"return my preferred extent" |
|
411 |
||
370 | 412 |
|w h mm| |
197 | 413 |
|
3750
3d4912629acf
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3609
diff
changeset
|
414 |
"/ If I have an explicit preferredExtent.. |
3d4912629acf
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3609
diff
changeset
|
415 |
explicitExtent notNil ifTrue:[ |
3d4912629acf
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3609
diff
changeset
|
416 |
^ explicitExtent |
3d4912629acf
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3609
diff
changeset
|
417 |
]. |
797 | 418 |
|
3750
3d4912629acf
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3609
diff
changeset
|
419 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
420 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
421 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
422 |
]. |
197 | 423 |
|
370 | 424 |
mm := ViewSpacing. |
425 |
||
426 |
w := ((margin + mm) * 2) + |
|
427 |
formLabel widthIncludingBorder + |
|
428 |
mm + textLabel width. |
|
429 |
||
3609
3bd1b03b1ffb
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3121
diff
changeset
|
430 |
w := w max:(okButton preferredWidth + (mm * 2)). |
2802
19b141dd52b9
fixed preferredWidth when components were added
Claus Gittinger <cg@exept.de>
parents:
2800
diff
changeset
|
431 |
w := w max:self maxPreferredWidthOfAddedComponents. |
370 | 432 |
|
433 |
h := (mm * 6) |
|
434 |
+ ((formLabel heightIncludingBorder) max:(textLabel height)) |
|
3609
3bd1b03b1ffb
added preferredWidth & preferredHeight
Claus Gittinger <cg@exept.de>
parents:
3121
diff
changeset
|
435 |
+ ((addedComponents ? #()) inject:0 into:[:sum :thisComponent | sum + thisComponent preferredHeight]) |
370 | 436 |
+ okButton heightIncludingBorder. |
197 | 437 |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
438 |
(styleSheet at:'infoBoxSeparator' default:false) ifTrue:[ |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
439 |
h := h + (ViewSpacing * 3) |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
440 |
]. |
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
441 |
|
197 | 442 |
^ w @ h |
370 | 443 |
|
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
444 |
"Modified: 1.4.1997 / 14:53:35 / cg" |
197 | 445 |
! ! |
446 |
||
1172
d10e4627b0e3
allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
447 |
!InfoBox class methodsFor:'documentation'! |
243 | 448 |
|
449 |
version |
|
4863
12c87ee0e767
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
4385
diff
changeset
|
450 |
^ '$Header: /cvs/stx/stx/libwidg/InfoBox.st,v 1.52 2014-01-16 14:33:19 stefan Exp $' |
4207 | 451 |
! |
452 |
||
453 |
version_CVS |
|
4863
12c87ee0e767
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
4385
diff
changeset
|
454 |
^ '$Header: /cvs/stx/stx/libwidg/InfoBox.st,v 1.52 2014-01-16 14:33:19 stefan Exp $' |
243 | 455 |
! ! |
4863
12c87ee0e767
Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents:
4385
diff
changeset
|
456 |