0
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 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 |
InfoBox subclass:#WarningBox
|
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:'WarnBitmap'
|
|
16 |
poolDictionaries:''
|
38
|
17 |
category:'Views-DialogBoxes'
|
0
|
18 |
!
|
|
19 |
|
|
20 |
WarningBox comment:'
|
|
21 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
22 |
All Rights Reserved
|
|
23 |
|
38
|
24 |
$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.4 1994-08-07 13:23:39 claus Exp $
|
|
25 |
'!
|
|
26 |
|
|
27 |
!WarningBox class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
32 |
All Rights Reserved
|
|
33 |
|
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
version
|
|
44 |
"
|
|
45 |
$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.4 1994-08-07 13:23:39 claus Exp $
|
|
46 |
"
|
|
47 |
!
|
0
|
48 |
|
38
|
49 |
documentation
|
|
50 |
"
|
|
51 |
this class implements a pop-up box to show an information message.
|
|
52 |
WarningBoxes are basically InfoBoxes with a different bitmap-image.
|
|
53 |
(also, they add a beep when popping up)
|
|
54 |
|
|
55 |
They are created with:
|
|
56 |
|
|
57 |
aBox := WarningBox title:'some title'.
|
|
58 |
|
|
59 |
and shown with:
|
|
60 |
|
|
61 |
aBox showAtPointer
|
|
62 |
|
|
63 |
The default box shows 'yes' in its button; this can be changed with:
|
|
64 |
|
|
65 |
aBox okText:'some string'.
|
|
66 |
|
|
67 |
|
|
68 |
Examples:
|
|
69 |
|
|
70 |
|aBox|
|
|
71 |
|
|
72 |
aBox := WarningBox title:'Press ''OK'' to continue'.
|
|
73 |
aBox okText:'OK'.
|
|
74 |
aBox showAtPointer.
|
|
75 |
|
|
76 |
"
|
|
77 |
! !
|
0
|
78 |
|
|
79 |
!WarningBox methodsFor:'initialization'!
|
|
80 |
|
38
|
81 |
initFormBitmap
|
0
|
82 |
WarnBitmap isNil ifTrue:[
|
38
|
83 |
WarnBitmap := Form fromFile:'Warning.xbm' resolution:100 on:Display
|
0
|
84 |
].
|
|
85 |
formLabel form:WarnBitmap
|
|
86 |
! !
|
|
87 |
|
|
88 |
!WarningBox methodsFor:'realization'!
|
|
89 |
|
|
90 |
show
|
|
91 |
"added bell to wake up user"
|
|
92 |
|
|
93 |
device beep.
|
|
94 |
super show
|
26
|
95 |
!
|
|
96 |
|
|
97 |
showAtPointer
|
|
98 |
"added bell to wake up user"
|
|
99 |
|
|
100 |
device beep.
|
|
101 |
super showAtPointer
|
0
|
102 |
! !
|