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