344
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
3150
|
3 |
All Rights Reserved
|
344
|
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 |
|
3150
|
13 |
"{ Package: 'stx:libwidg2' }"
|
344
|
14 |
|
|
15 |
SimpleView subclass:#NoteBookFrameView
|
|
16 |
instanceVariableNames:''
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Views-Misc'
|
|
20 |
!
|
|
21 |
|
|
22 |
!NoteBookFrameView class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1997 by eXept Software AG
|
3150
|
27 |
All Rights Reserved
|
344
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
|
43 |
this view is used as the bottom part of a notebook,
|
|
44 |
in which the selected subCanvas is drawn.
|
|
45 |
Its only reason for existance is to redefine the
|
|
46 |
border drawing to NOT draw the top border.
|
354
|
47 |
|
|
48 |
[author:]
|
3150
|
49 |
Claus Gittinger
|
354
|
50 |
|
|
51 |
[see also:]
|
3150
|
52 |
NoteBookView TabView
|
344
|
53 |
"
|
|
54 |
! !
|
|
55 |
|
|
56 |
!NoteBookFrameView methodsFor:'drawing'!
|
|
57 |
|
3150
|
58 |
drawEdgesForX:x y:y width:w height:h level:l
|
|
59 |
shadow:shadowColor light:lightColor
|
|
60 |
halfShadow:halfShadowColor halfLight:halfLightColor
|
|
61 |
style:edgeStyle
|
344
|
62 |
|
|
63 |
"draw 3D edges into a rectangle, but NOT the top edge"
|
|
64 |
|
|
65 |
|topLeftFg botRightFg topLeftHalfFg botRightHalfFg
|
|
66 |
count "{ Class: SmallInteger }"
|
|
67 |
r "{ Class: SmallInteger }"
|
|
68 |
b "{ Class: SmallInteger }"
|
|
69 |
xi "{ Class: SmallInteger }"
|
|
70 |
yi "{ Class: SmallInteger }"
|
|
71 |
run paint|
|
|
72 |
|
|
73 |
count := l.
|
|
74 |
(count < 0) ifTrue:[
|
3150
|
75 |
topLeftFg := shadowColor.
|
|
76 |
botRightFg := lightColor.
|
|
77 |
topLeftHalfFg := halfShadowColor.
|
|
78 |
botRightHalfFg := halfLightColor.
|
|
79 |
count := count negated
|
344
|
80 |
] ifFalse:[
|
3150
|
81 |
topLeftFg := lightColor.
|
|
82 |
botRightFg := shadowColor.
|
|
83 |
topLeftHalfFg := halfLightColor.
|
|
84 |
botRightHalfFg := halfShadowColor.
|
344
|
85 |
].
|
|
86 |
topLeftHalfFg isNil ifTrue:[
|
3150
|
87 |
topLeftHalfFg := topLeftFg
|
344
|
88 |
].
|
|
89 |
botRightHalfFg isNil ifTrue:[
|
3150
|
90 |
botRightHalfFg := botRightFg
|
344
|
91 |
].
|
|
92 |
|
|
93 |
r := x + w - 1. "right"
|
|
94 |
b := y + h - 1. "bottom"
|
|
95 |
|
|
96 |
self lineWidth:0.
|
|
97 |
|
|
98 |
"top and left edges"
|
|
99 |
((edgeStyle == #soft) and:["l" count > 0]) ifTrue:[
|
3150
|
100 |
paint := topLeftHalfFg
|
344
|
101 |
] ifFalse:[
|
3150
|
102 |
paint := topLeftFg
|
344
|
103 |
].
|
|
104 |
self paint:paint.
|
|
105 |
|
|
106 |
0 to:(count - 1) do:[:i |
|
3150
|
107 |
run := y + i.
|
|
108 |
run := x + i.
|
|
109 |
self displayDeviceLineFromX:run y:y toX:run y:b "left"
|
344
|
110 |
].
|
|
111 |
(edgeStyle == #soft) ifTrue:[
|
|
112 |
"
|
3150
|
113 |
self paint:topLeftFg.
|
|
114 |
self displayDeviceLineFromX:x y:y toX:r y:y.
|
|
115 |
self displayDeviceLineFromX:x y:y toX:x y:b
|
344
|
116 |
"
|
3150
|
117 |
(l > 2) ifTrue:[
|
|
118 |
self paint:(device blackColor).
|
|
119 |
self displayDeviceLineFromX:x y:y toX:x y:b.
|
|
120 |
]
|
344
|
121 |
].
|
|
122 |
|
|
123 |
xi := x + 1.
|
|
124 |
yi := y + 1.
|
|
125 |
|
|
126 |
"/ does not look good
|
|
127 |
"/ style == #st80 iftrue:[
|
|
128 |
"/ yi := yi + 1
|
|
129 |
"/ ].
|
|
130 |
|
|
131 |
"bottom and right edges"
|
|
132 |
(edgeStyle == #soft "new:" and:[count > 1]) ifTrue:[
|
3150
|
133 |
paint := botRightHalfFg
|
344
|
134 |
] ifFalse:[
|
3150
|
135 |
paint := botRightFg
|
344
|
136 |
].
|
|
137 |
|
|
138 |
self paint:paint.
|
|
139 |
0 to:(count - 1) do:[:i |
|
3150
|
140 |
run := b - i.
|
|
141 |
self displayDeviceLineFromX:xi-1 y:run toX:r y:run. "bottom"
|
|
142 |
run := r - i.
|
|
143 |
self displayDeviceLineFromX:run y:yi-1 toX:run y:b. "right"
|
|
144 |
xi := xi + 1.
|
|
145 |
yi := yi + 1
|
344
|
146 |
].
|
|
147 |
((edgeStyle == #soft) and:[l > 1]) ifTrue:[
|
3150
|
148 |
self paint:(device blackColor) "shadowColor".
|
|
149 |
self displayDeviceLineFromX:(x + (1 - 1)) y:b toX:r y:b.
|
|
150 |
self displayDeviceLineFromX:r y:(y + (1 - 1)) toX:r y:b
|
344
|
151 |
].
|
|
152 |
|
|
153 |
self edgeDrawn:#all
|
|
154 |
|
|
155 |
"Modified: 7.3.1997 / 17:59:19 / cg"
|
|
156 |
|
|
157 |
|
|
158 |
!
|
|
159 |
|
3150
|
160 |
drawTopEdgeLevel:level shadow:shadowColor light:lightColor halfShadow:halfShadowColor halfLight:halfLightColor style:edgeStyle
|
344
|
161 |
"does NOT draw the top edge"
|
|
162 |
|
|
163 |
^ self
|
|
164 |
|
|
165 |
! !
|
|
166 |
|
|
167 |
!NoteBookFrameView class methodsFor:'documentation'!
|
|
168 |
|
|
169 |
version
|
3150
|
170 |
^ '$Header: /cvs/stx/stx/libwidg2/NoteBookFrameView.st,v 1.3 2006-11-13 16:11:31 cg Exp $'
|
344
|
171 |
! !
|