1319
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2000 by eXept Software AG
|
|
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 |
|
1480
|
14 |
"{ Package: 'stx:libview2' }"
|
|
15 |
|
1318
|
16 |
PopUpView subclass:#PopUpBanner
|
|
17 |
instanceVariableNames:''
|
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Views-Basic'
|
|
21 |
!
|
|
22 |
|
1319
|
23 |
!PopUpBanner class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2000 by eXept Software AG
|
|
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 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
1338
|
42 |
Shows a banner popUp (splash window);
|
1319
|
43 |
can be used at startup to make wait-time a bit more interesting.
|
|
44 |
See use in smalltalk.rc / showBanner.rc / hideBanner.rc.
|
|
45 |
|
|
46 |
[author:]
|
|
47 |
Claus Gittinger
|
|
48 |
"
|
|
49 |
|
1338
|
50 |
!
|
|
51 |
|
|
52 |
examples
|
|
53 |
"
|
|
54 |
[exBegin]
|
|
55 |
|img bannerView|
|
|
56 |
|
|
57 |
img := Image fromFile:'banner1.xpm'.
|
|
58 |
bannerView := PopUpBanner forImage:img.
|
|
59 |
bannerView showCentered.
|
|
60 |
|
|
61 |
Delay waitForSeconds:2.
|
|
62 |
bannerView destroy
|
|
63 |
[exEnd]
|
|
64 |
"
|
|
65 |
|
1319
|
66 |
! !
|
1318
|
67 |
|
|
68 |
!PopUpBanner class methodsFor:'instance creation'!
|
|
69 |
|
|
70 |
forImage:anImage
|
|
71 |
|v|
|
|
72 |
|
|
73 |
v := self new.
|
|
74 |
v viewBackground:anImage.
|
1338
|
75 |
v cursor:Cursor wait.
|
1318
|
76 |
^ v
|
|
77 |
! !
|
|
78 |
|
1772
|
79 |
!PopUpBanner methodsFor:'activation & deactivation'!
|
1318
|
80 |
|
|
81 |
open
|
|
82 |
"default for popUpBanners is to come up modeless"
|
|
83 |
|
1339
|
84 |
|center r1 r2|
|
|
85 |
|
1340
|
86 |
"/ sorry - zooming does not work during early initialization;
|
|
87 |
"/ REASON: at smalltalk.rc reading time, scheduling does not yet take place;
|
|
88 |
"/ therefore, Delaydoes not work.
|
|
89 |
"/ sigh.
|
|
90 |
"/ center := self center.
|
|
91 |
"/ r1 := (center corner:center) insetBy:-5.
|
|
92 |
"/ r2 := self origin corner:self corner.
|
|
93 |
"/ self device zoom:r1 to:r2 duration:300.
|
1339
|
94 |
|
1320
|
95 |
self realize
|
1318
|
96 |
|
|
97 |
!
|
|
98 |
|
|
99 |
showCentered
|
|
100 |
self extent:viewBackground extent.
|
|
101 |
self showAt:((self device extent // 2) - (viewBackground extent // 2))
|
|
102 |
|
|
103 |
|
|
104 |
! !
|
|
105 |
|
1339
|
106 |
!PopUpBanner methodsFor:'deactivation'!
|
|
107 |
|
|
108 |
destroy
|
1340
|
109 |
"/ sorry - zooming does not work during early initialization;
|
|
110 |
"/ REASON: at smalltalk.rc reading time, scheduling does not yet take place;
|
1721
|
111 |
"/ therefore, Delay does not work, therefore zoom:to:duratio: does not work.
|
|
112 |
"/ - sigh.
|
1340
|
113 |
|
1721
|
114 |
"/ |screen center r1 r2|
|
|
115 |
"/
|
1340
|
116 |
"/ screen := self device.
|
|
117 |
"/ center := self center.
|
|
118 |
"/ r1 := (center corner:center) insetBy:-5.
|
|
119 |
"/ r2 := self origin corner:self corner.
|
1721
|
120 |
|
1339
|
121 |
super destroy.
|
|
122 |
|
1340
|
123 |
"/ screen zoom:r2 to:r1 duration:300.
|
1339
|
124 |
! !
|
|
125 |
|
1480
|
126 |
!PopUpBanner methodsFor:'event handling'!
|
|
127 |
|
|
128 |
buttonPress:button x:x y:y
|
|
129 |
"destroy view when user clicks into"
|
|
130 |
|
|
131 |
self destroy
|
|
132 |
! !
|
|
133 |
|
1318
|
134 |
!PopUpBanner methodsFor:'queries'!
|
|
135 |
|
|
136 |
grabWhenMapped
|
|
137 |
^ false
|
|
138 |
! !
|
|
139 |
|
|
140 |
!PopUpBanner class methodsFor:'documentation'!
|
|
141 |
|
|
142 |
version
|
1772
|
143 |
^ '$Header: /cvs/stx/stx/libview2/PopUpBanner.st,v 1.10 2003-05-07 15:18:41 cg Exp $'
|
1318
|
144 |
! !
|