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