2377
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2004 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 |
"
|
1975
|
12 |
"{ Package: 'stx:libview2' }"
|
|
13 |
|
3621
|
14 |
"{ NameSpace: Smalltalk }"
|
|
15 |
|
1975
|
16 |
View subclass:#TransparentBox
|
2003
|
17 |
instanceVariableNames:'shapeForm'
|
1975
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Views-Basic'
|
|
21 |
!
|
|
22 |
|
2003
|
23 |
!TransparentBox class methodsFor:'documentation'!
|
|
24 |
|
2377
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2004 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 |
|
2003
|
39 |
examples
|
|
40 |
"
|
|
41 |
| tv b1 b2 |
|
|
42 |
|
2004
|
43 |
b1 := Button label:'close'.
|
|
44 |
b1 action:[ tv close ].
|
2003
|
45 |
b1 origin:10@10.
|
|
46 |
|
|
47 |
b2 := Button label:'hello'.
|
|
48 |
b2 origin:100@100.
|
|
49 |
|
|
50 |
tv := self new.
|
|
51 |
tv extent:200@200.
|
|
52 |
|
|
53 |
tv addSubView:b1.
|
|
54 |
tv addSubView:b2.
|
|
55 |
tv open
|
|
56 |
"
|
|
57 |
! !
|
1975
|
58 |
|
|
59 |
!TransparentBox methodsFor:'events'!
|
|
60 |
|
|
61 |
sizeChanged:how
|
2003
|
62 |
shapeForm notNil ifTrue:[
|
|
63 |
self computeShape.
|
|
64 |
].
|
|
65 |
^ super sizeChanged: how.
|
1975
|
66 |
! !
|
|
67 |
|
|
68 |
!TransparentBox methodsFor:'initialization'!
|
|
69 |
|
2003
|
70 |
realize
|
1975
|
71 |
self computeShape.
|
2003
|
72 |
super realize.
|
1975
|
73 |
! !
|
|
74 |
|
|
75 |
!TransparentBox methodsFor:'queries'!
|
|
76 |
|
|
77 |
isTransparentBox
|
|
78 |
|
|
79 |
^true
|
|
80 |
!
|
|
81 |
|
|
82 |
specClass
|
|
83 |
^ TransparentBoxSpec
|
2003
|
84 |
!
|
|
85 |
|
|
86 |
windowStyle
|
|
87 |
^ #undecorated
|
1975
|
88 |
! !
|
|
89 |
|
|
90 |
!TransparentBox methodsFor:'shape computation'!
|
|
91 |
|
2003
|
92 |
addSubView:aView
|
|
93 |
super addSubView:aView.
|
|
94 |
shapeForm notNil ifTrue:[
|
|
95 |
self computeShape
|
|
96 |
].
|
|
97 |
!
|
|
98 |
|
1975
|
99 |
computeShape
|
2003
|
100 |
| subViews w h |
|
1975
|
101 |
|
3621
|
102 |
device supportsArbitraryShapedViews ifFalse:[^self].
|
1975
|
103 |
|
|
104 |
w := self extent x.
|
|
105 |
h := self extent y.
|
2003
|
106 |
shapeForm := Form width:w height:h.
|
|
107 |
shapeForm fill:(Color colorId:0).
|
1975
|
108 |
|
2003
|
109 |
shapeForm foreground:(Color colorId:1).
|
1975
|
110 |
|
|
111 |
subViews := self subViews.
|
|
112 |
subViews isEmptyOrNil ifTrue:[
|
2003
|
113 |
self fillFormWithBorderShape:shapeForm.
|
1975
|
114 |
] ifFalse:[
|
|
115 |
subViews do:[:aSubView|
|
2003
|
116 |
aSubView fillFormWithBorderShape:shapeForm.
|
1975
|
117 |
]
|
|
118 |
].
|
2003
|
119 |
"/ self viewShape:shapeForm.
|
|
120 |
self borderShape:shapeForm.
|
1975
|
121 |
! !
|
|
122 |
|
|
123 |
!TransparentBox class methodsFor:'documentation'!
|
|
124 |
|
|
125 |
version
|
3621
|
126 |
^ '$Header$'
|
1975
|
127 |
! !
|
3289
|
128 |
|