278
|
1 |
BoundedWrapper subclass:#BorderedWrapper
|
|
2 |
instanceVariableNames:'border inset insideColor'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Graphics-Display Objects'
|
|
6 |
!
|
|
7 |
|
|
8 |
!BorderedWrapper class methodsFor:'documentation'!
|
|
9 |
|
|
10 |
examples
|
|
11 |
"
|
|
12 |
[exBegin]
|
|
13 |
|t s v e component|
|
|
14 |
|
|
15 |
t := StandardSystemView extent:250@200.
|
|
16 |
s := HVScrollableView for:View miniScroller:true in:t.
|
|
17 |
s origin:0.0@0.0 corner:1.0@1.0.
|
|
18 |
v := s scrolledView.
|
|
19 |
|
|
20 |
e := Rectangle origin:0@0 corner:80@80.
|
|
21 |
component := FillingWrapper on:e.
|
|
22 |
component foregroundColor:Color red.
|
|
23 |
v addComponent:(BorderedWrapper on:component at:10@10).
|
|
24 |
|
|
25 |
e := EllipticalArc boundingBox:(0@0 corner:80@80)
|
|
26 |
startAngle:0 sweepAngle:360.
|
|
27 |
component := StrokingWrapper on:e.
|
|
28 |
component lineWidth:5.
|
|
29 |
v addComponent:(BorderedWrapper on:component at:10@10).
|
|
30 |
|
|
31 |
e := Arrow from:0@0 to:50@150.
|
|
32 |
component := StrokingWrapper on:e.
|
|
33 |
component lineWidth:2.
|
|
34 |
v addComponent:(BorderedWrapper on:component at:100@100).
|
|
35 |
|
|
36 |
t open
|
|
37 |
[exEnd]
|
|
38 |
"
|
|
39 |
! !
|
|
40 |
|
|
41 |
!BorderedWrapper class methodsFor:'instance creation'!
|
|
42 |
|
|
43 |
on:aComponent in:aLayout border:aBorder
|
|
44 |
^ (super on:aComponent in:aLayout) border:aBorder
|
|
45 |
|
|
46 |
"Created: 28.5.1996 / 23:15:00 / cg"
|
|
47 |
! !
|
|
48 |
|
|
49 |
!BorderedWrapper methodsFor:'accessing'!
|
|
50 |
|
|
51 |
border
|
|
52 |
"return border"
|
|
53 |
|
|
54 |
^ border
|
|
55 |
|
|
56 |
"Created: 28.5.1996 / 23:15:15 / cg"
|
|
57 |
!
|
|
58 |
|
|
59 |
border:something
|
|
60 |
"set border"
|
|
61 |
|
|
62 |
border := something.
|
|
63 |
|
|
64 |
"Created: 28.5.1996 / 23:15:15 / cg"
|
|
65 |
! !
|
|
66 |
|
|
67 |
!BorderedWrapper methodsFor:'displaying'!
|
|
68 |
|
|
69 |
displayOn:aGC
|
|
70 |
|bounds x y w h tX tY|
|
|
71 |
|
|
72 |
super displayOn:aGC.
|
|
73 |
|
|
74 |
bounds := self bounds.
|
|
75 |
x := bounds left rounded.
|
|
76 |
y := bounds top rounded.
|
|
77 |
w := bounds width rounded.
|
|
78 |
h := bounds height rounded.
|
|
79 |
|
|
80 |
tX := aGC translation x.
|
|
81 |
tY := aGC translation y.
|
|
82 |
|
|
83 |
aGC drawEdgesForX:x+tX
|
|
84 |
y:y+tY
|
|
85 |
width:w
|
|
86 |
height:h
|
|
87 |
level:1
|
|
88 |
shadow:Color black
|
|
89 |
light:Color white
|
|
90 |
halfShadow:Color grey
|
|
91 |
halfLight:Color grey
|
|
92 |
style:#iris
|
|
93 |
|
|
94 |
"Modified: 29.5.1996 / 00:36:00 / cg"
|
|
95 |
! !
|
|
96 |
|
|
97 |
!BorderedWrapper class methodsFor:'documentation'!
|
|
98 |
|
|
99 |
version
|
|
100 |
^ '$Header: /cvs/stx/stx/libview2/BorderedWrapper.st,v 1.1 1996-05-28 22:43:05 cg Exp $'
|
|
101 |
! !
|