author | Claus Gittinger <cg@exept.de> |
Fri, 15 Jun 2018 10:54:35 +0200 | |
changeset 5816 | 7876c07931a7 |
parent 5674 | b0c29ac08517 |
child 5943 | 5bd4c8c6ec5f |
permissions | -rw-r--r-- |
542 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by Claus Gittinger / 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 |
" |
|
1844 | 12 |
"{ Package: 'stx:libwidg2' }" |
13 |
||
4876 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
824 | 16 |
SimpleView subclass:#DSVLabelView |
3774 | 17 |
instanceVariableNames:'dataSet lineDrag columns selection enabled preferredHeight |
18 |
handleCursor tabSpacing opaqueColumnResize verticalLabelSpacing |
|
19 |
indexOfSortColumn reverseSort' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Views-DataSet' |
|
542 | 23 |
! |
24 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
25 |
Object subclass:#LineDrag |
3774 | 26 |
instanceVariableNames:'topX topY botY column minX startX transX topView color' |
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
29 |
privateIn:DSVLabelView |
|
1491 | 30 |
! |
31 |
||
542 | 32 |
!DSVLabelView class methodsFor:'documentation'! |
33 |
||
34 |
copyright |
|
35 |
" |
|
36 |
COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG |
|
37 |
All Rights Reserved |
|
38 |
||
39 |
This software is furnished under a license and may be used |
|
40 |
only in accordance with the terms of that license and with the |
|
41 |
inclusion of the above copyright notice. This software may not |
|
42 |
be provided or otherwise made available to, or used by, any |
|
43 |
other person. No title to or ownership of the software is |
|
44 |
hereby transferred. |
|
45 |
" |
|
46 |
||
47 |
||
48 |
||
49 |
||
50 |
! |
|
51 |
||
52 |
documentation |
|
53 |
" |
|
2789 | 54 |
shows the labels assigned to the column descriptions. |
55 |
Used as the title-part of a DataSetView. |
|
542 | 56 |
|
57 |
[Instance variables:] |
|
58 |
||
1487 | 59 |
dataSet <DSVColumnView> column view which shows the columns |
824 | 60 |
|
1487 | 61 |
selection <Integer or nil> current selected index or nil. |
824 | 62 |
|
1086 | 63 |
enabled <Boolean> if a press action exists on a column |
64 |
entry, this action could be enabled or |
|
65 |
disabled. |
|
66 |
||
1487 | 67 |
preferredHeight <Integer> the preferred height of the labelView |
1086 | 68 |
|
542 | 69 |
|
70 |
[author:] |
|
71 |
Claus Atzkern |
|
72 |
||
73 |
[see also:] |
|
74 |
DSVColumnView |
|
75 |
DataSetColumnSpec |
|
76 |
DataSetColumn |
|
77 |
DataSetView |
|
78 |
" |
|
79 |
! ! |
|
80 |
||
1940 | 81 |
!DSVLabelView class methodsFor:'accessing'! |
82 |
||
83 |
tabSpacing |
|
84 |
"returns the tab spacing |
|
85 |
" |
|
86 |
^ 2 |
|
87 |
! ! |
|
88 |
||
1844 | 89 |
!DSVLabelView class methodsFor:'defaults'! |
90 |
||
91 |
defaultFont |
|
92 |
^ DSVColumnView defaultFont |
|
93 |
! ! |
|
94 |
||
1487 | 95 |
!DSVLabelView methodsFor:'accessing'! |
824 | 96 |
|
1487 | 97 |
columns:aListOfColumns |
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
98 |
"the list of columns changed" |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
99 |
|
2152
6c52408279f9
halts and unused methods removed
Claus Gittinger <cg@exept.de>
parents:
2151
diff
changeset
|
100 |
aListOfColumns = columns ifTrue:[^ self]. |
2150 | 101 |
|
1487 | 102 |
columns := aListOfColumns. |
103 |
preferredHeight := nil. |
|
104 |
selection := nil. |
|
105 |
||
2146 | 106 |
self changed:#columnLayout. |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
107 |
! |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
108 |
|
3583 | 109 |
dataSet |
110 |
^ dataSet |
|
111 |
! |
|
112 |
||
3766 | 113 |
indexOfSortColumn |
114 |
^ indexOfSortColumn |
|
115 |
! |
|
116 |
||
1931 | 117 |
opaqueColumnResize |
118 |
^ opaqueColumnResize |
|
119 |
! |
|
120 |
||
121 |
opaqueColumnResize:aBoolean |
|
122 |
opaqueColumnResize := aBoolean |
|
3769 | 123 |
! |
124 |
||
125 |
reverseSort |
|
126 |
^ reverseSort |
|
884 | 127 |
! ! |
128 |
||
824 | 129 |
!DSVLabelView methodsFor:'drawing'! |
130 |
||
1487 | 131 |
invalidate |
2146 | 132 |
(shown) ifTrue:[ |
1487 | 133 |
super invalidate |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
134 |
] |
824 | 135 |
! |
136 |
||
1487 | 137 |
invalidateItemAt:anIndex |
138 |
"invalidate rectangle assigned to an item at an index |
|
824 | 139 |
" |
1487 | 140 |
|cL xL xR hg| |
141 |
||
2146 | 142 |
(shown) ifTrue:[ |
1487 | 143 |
cL := columns at:anIndex ifAbsent:[^ nil]. |
2146 | 144 |
xL := self xVisibleOfColNr:anIndex. |
1487 | 145 |
xR := xL + cL width. |
146 |
||
147 |
(xL < width and:[xR > 0]) ifTrue:[ |
|
148 |
xL := xL max:0. |
|
149 |
xR := xR min:width. |
|
150 |
hg := height - margin - margin. |
|
151 |
||
152 |
self invalidate:(Rectangle left:xL top:margin width:(xR - xL) height:hg) |
|
153 |
] |
|
154 |
] |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1269
diff
changeset
|
155 |
! |
562 | 156 |
|
2146 | 157 |
redrawColumnsInX:x y:y width:w height:h |
4522 | 158 |
"redraw a rectangle" |
159 |
||
160 |
|bg fg fgColor bgColor |
|
1487 | 161 |
inset "{ Class:SmallInteger }" |
162 |
maxX "{ Class:SmallInteger }" |
|
1524
b7f986aa45f4
visibility of label; show as button (yes/no)
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
163 |
lblH "{ Class:SmallInteger }" |
1487 | 164 |
wt "{ Class:SmallInteger }" |
165 |
x1 "{ Class:SmallInteger }" |
|
166 |
x0 "{ Class:SmallInteger }" |
|
3648 | 167 |
item| |
168 |
||
2146 | 169 |
(shown) ifFalse:[^ self]. |
824 | 170 |
|
4876 | 171 |
bgColor := dataSet labelBackgroundColor. |
5422 | 172 |
gc paint:bgColor. |
173 |
gc fillRectangleX:x y:y width:w height:h. |
|
824 | 174 |
|
1487 | 175 |
columns isEmpty ifTrue:[^ self]. |
176 |
||
4876 | 177 |
fgColor := dataSet labelForegroundColor. |
1487 | 178 |
inset := dataSet horizontalSpacing + 1. |
179 |
maxX := (x + w) min:(width - margin). |
|
1524
b7f986aa45f4
visibility of label; show as button (yes/no)
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
180 |
lblH := height - margin - margin. |
859 | 181 |
|
2146 | 182 |
x1 := self xVisibleOfColNr:1. |
824 | 183 |
|
3648 | 184 |
columns keysAndValuesDo:[:eachKey :eachCol| |
185 |
item := eachCol label. |
|
186 |
||
187 |
wt := eachCol width. |
|
1487 | 188 |
x0 := x1. |
189 |
x1 := x1 + wt. |
|
824 | 190 |
|
1487 | 191 |
(x1 > x and:[x0 < maxX]) ifTrue:[ |
1940 | 192 |
|left right rect| |
193 |
||
194 |
left := x0 max:x. |
|
195 |
right := x1 min:maxX. |
|
196 |
rect := Rectangle left:left top:y width:(right - left) height:h. |
|
197 |
||
4522 | 198 |
"/ clipRect := nil. |
5410 | 199 |
self clippingBounds:rect. |
1940 | 200 |
|
3648 | 201 |
fg := (item foregroundColor) ? fgColor. |
1487 | 202 |
|
3648 | 203 |
(bg := item backgroundColor) notNil ifTrue:[ |
907 | 204 |
bg ~= bgColor ifTrue:[ |
5422 | 205 |
gc paint:bg. |
206 |
gc fillRectangleX:x0 y:margin width:wt height:lblH. |
|
907 | 207 |
] |
208 |
] ifFalse:[ |
|
209 |
bg := bgColor |
|
210 |
]. |
|
824 | 211 |
|
5422 | 212 |
gc paint:fg on:bg. |
3648 | 213 |
item redrawX:x0 w:wt h:height inset:inset on:self. |
1524
b7f986aa45f4
visibility of label; show as button (yes/no)
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
214 |
] |
824 | 215 |
]. |
2146 | 216 |
! |
217 |
||
218 |
redrawEdgesX:x y:yTop width:aWidth height:aHeight |
|
219 |
"redraw the edges in the range |
|
220 |
" |
|
3467 | 221 |
|desc startOfTabX endOfTabX lastColumn has3Dseparators separatorOneDColor |
2146 | 222 |
maxX "{ Class:SmallInteger }" |
223 |
h "{ Class:SmallInteger }" |
|
224 |
x1 "{ Class:SmallInteger }" |
|
225 |
x0 "{ Class:SmallInteger }" |
|
226 |
y0 "{ Class:SmallInteger }" |
|
227 |
absLabelLevel |
|
228 |
| |
|
229 |
||
3464 | 230 |
|
2146 | 231 |
maxX := (x + aWidth) min:(width - margin). |
232 |
absLabelLevel := 1. |
|
233 |
x1 := self xVisibleOfColNr:1. |
|
234 |
||
235 |
y0 := margin. |
|
236 |
h := height - margin - margin. |
|
3464 | 237 |
|
3467 | 238 |
has3Dseparators := dataSet has3Dseparators. |
239 |
separatorOneDColor := dataSet separatorOneDColor. |
|
240 |
lastColumn := columns last. |
|
3464 | 241 |
|
2146 | 242 |
columns keysAndValuesDo:[:aKey :aCol| |
243 |
desc := aCol description. |
|
244 |
x0 := x1. |
|
245 |
x1 := x1 + aCol width. |
|
246 |
||
3464 | 247 |
endOfTabX := nil. |
248 |
||
2146 | 249 |
aKey == selection ifTrue:[ |
3464 | 250 |
startOfTabX notNil ifTrue:[ endOfTabX := x0 ]. |
251 |
||
2146 | 252 |
(x1 > x and:[x0 < maxX]) ifTrue:[ |
3464 | 253 |
dataSet drawEdgesAtX:x0 y:y0 width:(x1 - x0) height:h level:-1 on:self. |
2146 | 254 |
]. |
3464 | 255 |
|
2146 | 256 |
] ifFalse:[ |
3464 | 257 |
desc labelHasButtonLayout ifTrue:[ |
3466 | 258 |
startOfTabX isNil ifTrue:[ startOfTabX := x0 ]. |
259 |
||
3464 | 260 |
(desc== lastColumn or:[desc labelIsPartOfGroup not]) ifTrue:[ |
261 |
endOfTabX := x1. |
|
262 |
] |
|
263 |
] ifFalse:[ |
|
264 |
startOfTabX notNil ifTrue:[ |
|
265 |
endOfTabX := x0. |
|
266 |
]. |
|
267 |
]. |
|
2146 | 268 |
]. |
3464 | 269 |
endOfTabX notNil ifTrue:[ |
270 |
startOfTabX isNil ifTrue:[ startOfTabX := x0 ]. |
|
271 |
||
272 |
startOfTabX < endOfTabX ifTrue:[ |
|
273 |
(endOfTabX > x and:[startOfTabX < maxX]) ifTrue:[ |
|
274 |
has3Dseparators ifTrue:[ |
|
275 |
dataSet drawEdgesAtX:startOfTabX y:y0 width:(endOfTabX - startOfTabX) height:h level:absLabelLevel on:self. |
|
276 |
] ifFalse:[ |
|
5422 | 277 |
gc paint:separatorOneDColor. |
278 |
gc displayLineFromX:endOfTabX-1 y:0 toX:endOfTabX-1 y:h. |
|
3464 | 279 |
]. |
280 |
]. |
|
2146 | 281 |
]. |
3464 | 282 |
startOfTabX := nil. |
283 |
]. |
|
2146 | 284 |
]. |
285 |
||
3464 | 286 |
has3Dseparators ifTrue:[ |
287 |
x1 < (maxX - absLabelLevel - absLabelLevel - 3) ifTrue:[ |
|
288 |
dataSet |
|
289 |
drawEdgesAtX:x1 y:y0 |
|
290 |
width:(width"-margin"-x1"-absLabelLevel") height:h |
|
291 |
level:absLabelLevel on:self |
|
292 |
]. |
|
3467 | 293 |
] ifFalse:[ |
294 |
h := h - 1. |
|
5422 | 295 |
gc paint:separatorOneDColor. |
296 |
gc displayLineFromX:x y:h toX:(x + aWidth) y:h. |
|
2146 | 297 |
]. |
298 |
! |
|
299 |
||
4162 | 300 |
redrawX:xArg y:y width:wArg height:h |
301 |
|savClip x w | |
|
2146 | 302 |
|
3694
8a9158be10d7
dont do a super redraw - it clears what has just been drawn
Claus Gittinger <cg@exept.de>
parents:
3648
diff
changeset
|
303 |
shown ifFalse:[^ self]. |
2146 | 304 |
|
4162 | 305 |
x := xArg. |
2146 | 306 |
w := wArg. |
4162 | 307 |
|
2146 | 308 |
self redrawColumnsInX:x y:y width:w height:h. |
4162 | 309 |
columns size == 0 ifTrue:[ ^ self ]. |
310 |
||
4522 | 311 |
savClip := gc clippingBoundsOrNil. |
2146 | 312 |
|
4162 | 313 |
dataSet has3Dseparators ifTrue:[ | eoXlastCol | |
314 |
eoXlastCol := self xVisibleOfColNr:( columns size + 1). |
|
315 |
x >= eoXlastCol ifTrue:[ |
|
316 |
w := w +( x - eoXlastCol ). |
|
317 |
x := eoXlastCol. |
|
318 |
]. |
|
319 |
]. |
|
5189 | 320 |
self clippingBounds:(Rectangle left:x top:margin width:w height:height-margin-margin). |
4162 | 321 |
|
322 |
xArg > x ifTrue:[ |
|
5422 | 323 |
gc paint:(dataSet backgroundColor). |
324 |
gc fillRectangleX:x y:y width:w height:h. |
|
4162 | 325 |
]. |
326 |
self redrawEdgesX:x y:y width:w height:h. |
|
5189 | 327 |
self clippingBounds:savClip. |
637 | 328 |
! ! |
329 |
||
2820 | 330 |
!DSVLabelView methodsFor:'enumerating columns'! |
331 |
||
332 |
columnsDo:aOneArgBlock |
|
333 |
"evaluate the argument, aOneArgBlock for every column" |
|
334 |
||
335 |
columns do:aOneArgBlock |
|
336 |
! ! |
|
337 |
||
637 | 338 |
!DSVLabelView methodsFor:'event handling'! |
542 | 339 |
|
1491 | 340 |
buttonMotion:state x:x y:y |
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
341 |
"mouse-button was moved; |
1491 | 342 |
redraw thumb at its new position and, if scroll-mode is asynchronous, |
343 |
the scroll action is performed |
|
344 |
" |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
345 |
|colNr x1 col| |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
346 |
|
1958 | 347 |
state = 0 ifTrue:[ |
348 |
lineDrag := nil. |
|
349 |
]. |
|
350 |
||
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
351 |
lineDrag notNil ifTrue:[ |
1932 | 352 |
(opaqueColumnResize ? (UserPreferences current opaqueTableColumnResizing == true)) ifTrue:[ |
1939 | 353 |
lineDrag moveToX:x. |
354 |
dataSet changeWidthOfColumn:lineDrag column deltaX:lineDrag deltaX. |
|
355 |
lineDrag resetDeltaX. |
|
356 |
] ifFalse:[ |
|
3537 | 357 |
lineDrag invertLinesMovingToX:x. |
1931 | 358 |
]. |
359 |
^ self. |
|
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
360 |
]. |
1491 | 361 |
|
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
362 |
"/ in the resize area ? |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
363 |
colNr := self xVisibleToColNr:(x-tabSpacing). |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
364 |
colNr notNil ifTrue:[ |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
365 |
col := columns at:colNr. |
1937 | 366 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
367 |
(col notNil and:[col isResizeable]) ifTrue:[ |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
368 |
x1 := self xVisibleOfColNr:(colNr + 1). |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
369 |
(x between:(x1-tabSpacing) and:(x1+tabSpacing)) |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
370 |
"/ x + tabSpacing > x1 |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
371 |
ifTrue:[ |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
372 |
self cursor:handleCursor. |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
373 |
^ self |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
374 |
]. |
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
375 |
]. |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
376 |
]. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
377 |
self cursor:(Cursor normal) |
3212 | 378 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
379 |
"Modified: / 26-03-2007 / 15:20:27 / cg" |
1491 | 380 |
! |
381 |
||
637 | 382 |
buttonPress:button x:x y:y |
824 | 383 |
"handle a button press event; checks whether the item under the mouse |
384 |
is selectable. If true, the selection is set to the item. |
|
637 | 385 |
" |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
386 |
|x1 colNr col| |
1491 | 387 |
|
2146 | 388 |
(enabled and:[shown]) ifFalse:[ |
1491 | 389 |
^ self |
390 |
]. |
|
391 |
||
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
392 |
"/ in the resize area ? |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
393 |
colNr := self xVisibleToColNr:(x-tabSpacing). |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
394 |
colNr notNil ifTrue:[ |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
395 |
col := columns at:colNr. |
1937 | 396 |
col isResizeable ifTrue:[ |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
397 |
x1 := self xVisibleOfColNr:(colNr + 1). |
3212 | 398 |
(x between:(x1-tabSpacing) and:(x1+tabSpacing)) ifTrue:[ |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
399 |
col := columns at:colNr ifAbsent:nil. |
1937 | 400 |
self cursor:handleCursor. |
401 |
||
402 |
lineDrag := LineDrag new. |
|
403 |
lineDrag column:col |
|
404 |
x:x |
|
405 |
y:margin |
|
406 |
h:(self height + dataSet height) |
|
407 |
minX:(x1 - col width + col minimumRequiredWidth) |
|
408 |
on:self. |
|
1939 | 409 |
(opaqueColumnResize ? (UserPreferences current opaqueTableColumnResizing == true)) ifFalse:[ |
410 |
lineDrag invertLine. |
|
411 |
]. |
|
3212 | 412 |
^ self |
1937 | 413 |
] |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
414 |
] |
1491 | 415 |
]. |
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
416 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
417 |
colNr := self xVisibleToColNr:x. |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
418 |
colNr notNil ifTrue:[ |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
419 |
col := columns at:colNr. |
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
420 |
col label isSelectable ifTrue:[ |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
421 |
self invalidateItemAt:(selection := colNr) |
3212 | 422 |
]. |
1585
b4f60b1a025b
fixed handle-fetch detection (handle is now easier to catch)
Claus Gittinger <cg@exept.de>
parents:
1525
diff
changeset
|
423 |
]. |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
424 |
self cursor:(Cursor normal). |
3212 | 425 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
426 |
"Modified: / 26-03-2007 / 15:21:00 / cg" |
542 | 427 |
! |
428 |
||
637 | 429 |
buttonRelease:button x:x y:y |
824 | 430 |
"handle a button press event; checks whether the item under the mouse |
431 |
is the selected item. If true, the application is informed. |
|
432 |
" |
|
3769 | 433 |
|selected column deltaX colNr| |
824 | 434 |
|
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
435 |
self cursor:(Cursor normal). |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
436 |
|
1487 | 437 |
selection isNil ifTrue:[ |
1933 | 438 |
lineDrag notNil ifTrue:[ |
1939 | 439 |
(opaqueColumnResize ? (UserPreferences current opaqueTableColumnResizing == true)) ifFalse:[ |
2150 | 440 |
lineDrag invertLine. |
1932 | 441 |
column := lineDrag column. |
442 |
deltaX := lineDrag deltaX. |
|
1491 | 443 |
|
1932 | 444 |
deltaX abs > 0 "2" ifTrue:[ |
445 |
dataSet changeWidthOfColumn:column deltaX:deltaX |
|
446 |
] |
|
447 |
]. |
|
1933 | 448 |
lineDrag := nil. |
4428 | 449 |
^ self. |
1491 | 450 |
]. |
3774 | 451 |
|
3769 | 452 |
((colNr := dataSet xVisibleToColNr:x) notNil |
453 |
and:[ (column := columns at:colNr) notNil |
|
454 |
and:[ column label isSortable ]]) ifTrue:[ |
|
455 |
indexOfSortColumn == colNr ifTrue:[ |
|
456 |
reverseSort := (reverseSort ? false) not |
|
457 |
] ifFalse:[ |
|
458 |
reverseSort := false. |
|
459 |
indexOfSortColumn := colNr. |
|
460 |
]. |
|
3774 | 461 |
self invalidateItemAt:colNr. |
462 |
dataSet updateList. |
|
3769 | 463 |
]. |
464 |
^ self. |
|
1085 | 465 |
]. |
3769 | 466 |
|
467 |
colNr := self xVisibleToSelectionIndex:x. |
|
468 |
selected := (colNr == selection). |
|
469 |
colNr := selection. |
|
1487 | 470 |
selection := nil. |
1085 | 471 |
|
3769 | 472 |
self invalidateItemAt:colNr. |
1487 | 473 |
|
474 |
selected ifTrue:[ |
|
3774 | 475 |
self sendClickMsgForColumnNr:colNr |
1085 | 476 |
] |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
477 |
! |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
478 |
|
5562 | 479 |
fontChanged |
480 |
"invoked after the font has changed" |
|
481 |
preferredHeight := nil. |
|
482 |
columns do:[:each| each label fontChangedOn:self]. |
|
483 |
! |
|
484 |
||
485 |
mouseWheelZoom:amount |
|
486 |
^ dataSet mouseWheelZoom:amount |
|
487 |
! |
|
488 |
||
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
489 |
pointerLeave:state |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
490 |
"mouse left view - restore cursor. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
491 |
" |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
492 |
self sensor anyButtonPressed ifFalse:[ |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
493 |
self cursor:(Cursor normal) |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
494 |
]. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
495 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
496 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
497 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
498 |
! |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
499 |
|
3774 | 500 |
sendClickMsgForColumnNr:colNr |
501 |
"inform the receiver of a button release notification" |
|
502 |
||
503 |
|receiver col description labelActionSelector| |
|
504 |
||
505 |
receiver := self application. |
|
506 |
receiver isNil ifTrue:[^ self]. |
|
507 |
||
508 |
col := columns at:colNr. |
|
509 |
description := col description. |
|
510 |
||
511 |
(labelActionSelector := description labelActionSelector) notNil ifTrue:[ |
|
512 |
receiver perform:labelActionSelector withOptionalArgument:(description labelActionArgument) and:colNr |
|
513 |
]. |
|
514 |
! |
|
515 |
||
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
516 |
xVisibleToColNr:x |
3212 | 517 |
"returns the column number for a physical x position. |
5078 | 518 |
Returns nil if x is beyond the last column." |
3212 | 519 |
|
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
520 |
|x0 x1| |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
521 |
|
2146 | 522 |
x1 := self xVisibleOfColNr:1. |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
523 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
524 |
columns keysAndValuesDo:[:index :aCol| |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
525 |
x0 := x1. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
526 |
x1 := x0 + aCol width. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
527 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
528 |
(x1 > x and:[x0 < x]) ifTrue:[ |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
529 |
^ index |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
530 |
] |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
531 |
]. |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
532 |
^ nil |
3212 | 533 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
534 |
"Modified: / 26-03-2007 / 15:21:37 / cg" |
824 | 535 |
! ! |
536 |
||
3188 | 537 |
!DSVLabelView methodsFor:'focus handling'! |
538 |
||
539 |
canTab |
|
540 |
^ false |
|
541 |
! |
|
542 |
||
543 |
wantsFocusWithButtonPress |
|
544 |
"never wants the focus - view which keeps the labels |
|
545 |
" |
|
546 |
^ false |
|
547 |
! ! |
|
548 |
||
3214 | 549 |
!DSVLabelView methodsFor:'help'! |
550 |
||
5674 | 551 |
helpTextAt:aPoint |
3214 | 552 |
"return the helpText for aPoint (i.e. when mouse-pointer is moved over an item)." |
553 |
||
554 |
|colNr col| |
|
555 |
||
556 |
columns isEmpty ifTrue:[^ nil]. |
|
557 |
colNr := self xVisibleToColNr:aPoint x. |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
558 |
colNr notNil ifTrue:[ |
3214 | 559 |
col := columns at:colNr. |
3523
26c2bafdd0fb
separate activeHelp for labels
Claus Gittinger <cg@exept.de>
parents:
3489
diff
changeset
|
560 |
^ col activeHelpTextForLabel. |
3214 | 561 |
]. |
562 |
^ nil |
|
563 |
||
564 |
"Created: / 26-03-2007 / 13:43:20 / cg" |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
565 |
"Modified: / 26-03-2007 / 15:21:07 / cg" |
3214 | 566 |
! ! |
567 |
||
2146 | 568 |
!DSVLabelView methodsFor:'initialization'! |
569 |
||
570 |
initStyle |
|
2924 | 571 |
<resource: #style (#'dataSet.labelView.level' |
572 |
#'dataSet.labelView.verticalSpace' |
|
573 |
)> |
|
574 |
||
2146 | 575 |
super initStyle. |
576 |
||
4990 | 577 |
handleCursor := (VariablePanel cursorForOrientation:#horizontal onDevice: device) onDevice: device. |
5238 | 578 |
gc font:self class defaultFont. |
2146 | 579 |
"/ self level:0. |
2924 | 580 |
self level:(styleSheet at:#'dataSet.labelView.level' default:-1). |
581 |
verticalLabelSpacing := (styleSheet at:#'dataSet.labelView.verticalSpace' default:2). |
|
2146 | 582 |
! |
583 |
||
584 |
initialize |
|
585 |
super initialize. |
|
586 |
"/ super level:(self defaultLevel). |
|
587 |
||
588 |
enabled := true. |
|
589 |
columns := #(). |
|
590 |
tabSpacing := self class tabSpacing. |
|
591 |
||
592 |
self enableMotionEvents. |
|
593 |
! ! |
|
594 |
||
824 | 595 |
!DSVLabelView methodsFor:'instance creation'! |
596 |
||
597 |
for:aColumnView |
|
598 |
"initialization |
|
599 |
" |
|
1491 | 600 |
dataSet := aColumnView. |
2146 | 601 |
"/ self level:(dataSet level). |
602 |
"/ self borderWidth:(dataSet borderWidth). |
|
1085 | 603 |
! |
604 |
||
1487 | 605 |
realize |
606 |
"recompute contents and fit columns to view |
|
607 |
" |
|
608 |
self bitGravity:#NorthWest. |
|
609 |
super realize. |
|
824 | 610 |
! ! |
611 |
||
1487 | 612 |
!DSVLabelView methodsFor:'queries'! |
824 | 613 |
|
3769 | 614 |
columnIndexOfDescription:aColumnDescription |
615 |
^ columns findFirst:[:col | col description == aColumnDescription] |
|
616 |
! |
|
617 |
||
1487 | 618 |
enabled |
619 |
"true, if widget is enabled |
|
620 |
" |
|
621 |
^ enabled |
|
622 |
! |
|
623 |
||
5446 | 624 |
enabled:aBoolean |
625 |
"true, if widget is enabled" |
|
626 |
||
627 |
enabled := aBoolean. |
|
628 |
||
629 |
"Modified (comment): / 04-02-2017 / 21:31:52 / cg" |
|
1487 | 630 |
! |
631 |
||
3766 | 632 |
indexOfLabel:aLabel |
633 |
^ columns findFirst:[:col | col label == aLabel]. |
|
634 |
! |
|
635 |
||
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
636 |
preferredExtent |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
637 |
|
3572
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
638 |
"/ If I have an explicit preferredExtent.. |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
639 |
explicitExtent notNil ifTrue:[ |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
640 |
^ explicitExtent |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
641 |
]. |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
642 |
|
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
643 |
"/ If I have a cached preferredExtent value.. |
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
644 |
preferredExtent notNil ifTrue:[ |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
645 |
^ preferredExtent |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
646 |
]. |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
647 |
|
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
648 |
^ 100 @ self preferredHeight |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
649 |
! |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
650 |
|
2146 | 651 |
preferredHeight |
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
652 |
|maxLabelHeight| |
2146 | 653 |
|
654 |
preferredHeight notNil ifTrue:[ |
|
655 |
^ preferredHeight |
|
656 |
]. |
|
1487 | 657 |
|
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
658 |
maxLabelHeight := |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
659 |
columns inject:0 into:[:maxSoFar :col | (col label preferredHeight) max:maxSoFar ]. |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
660 |
|
4621 | 661 |
^ ((self margin + verticalLabelSpacing) * 2) + maxLabelHeight |
2146 | 662 |
! |
663 |
||
664 |
xVisibleOfColNr:colNr |
|
665 |
"/ must adjust, because dataset includes its own margin, which might be different from ours |
|
666 |
||
667 |
^ (dataSet xVisibleOfColNr:colNr) - dataSet margin + margin |
|
824 | 668 |
! |
669 |
||
1487 | 670 |
xVisibleToSelectionIndex:x |
671 |
"returns the column number assigned to a physical x or nil. If |
|
672 |
the column exists but is not selectable nil is returned. |
|
824 | 673 |
" |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
674 |
|
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
675 |
|colNr column| |
824 | 676 |
|
2146 | 677 |
(shown and:[enabled]) ifTrue:[ |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
678 |
((colNr := dataSet xVisibleToColNr:x) notNil |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
679 |
and:[(column := columns at:colNr) notNil |
1487 | 680 |
and:[column label isSelectable]] |
681 |
) ifTrue:[ |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
682 |
^ colNr |
1487 | 683 |
] |
824 | 684 |
]. |
1487 | 685 |
^ nil |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
686 |
|
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
687 |
"Modified: / 26-03-2007 / 15:21:27 / cg" |
824 | 688 |
! ! |
689 |
||
1487 | 690 |
!DSVLabelView methodsFor:'scrolling'! |
824 | 691 |
|
1487 | 692 |
copyFromX:x0 y:y0 toX:x1 y:y1 width:w invalidateX:leftX |
824 | 693 |
|
2146 | 694 |
(shown) ifFalse:[^ self]. |
824 | 695 |
|
1487 | 696 |
(self sensor hasDamageFor:self) ifTrue:[ |
697 |
self invalidate |
|
698 |
] ifFalse:[ |
|
699 |
self copyFrom:self x:x0 y:y0 toX:x1 y:y1 width:w height:height async:false. |
|
700 |
self invalidate:(Rectangle left:leftX top:0 width:(width - w) height:height) |
|
701 |
repairNow:true |
|
702 |
] |
|
824 | 703 |
! ! |
704 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
705 |
!DSVLabelView::LineDrag methodsFor:'accessing'! |
1491 | 706 |
|
707 |
column |
|
708 |
"return the value of the instance variable 'column' (automatically generated)" |
|
709 |
||
1931 | 710 |
^ column |
711 |
! |
|
1491 | 712 |
|
713 |
deltaX |
|
714 |
"returns the distance x between the start and end action |
|
715 |
" |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
716 |
^ topX - startX |
1931 | 717 |
! |
718 |
||
719 |
resetDeltaX |
|
720 |
startX := topX |
|
1491 | 721 |
! ! |
722 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
723 |
!DSVLabelView::LineDrag methodsFor:'dragging'! |
1491 | 724 |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
725 |
invertLine |
3537 | 726 |
"invert current line |
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
727 |
" |
3537 | 728 |
self invertLinesMovingToX:nil. |
729 |
! |
|
2027
e61da28e7ffc
use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
730 |
|
3537 | 731 |
invertLinesMovingToX:viewX |
732 |
"invert current line |
|
733 |
if x notNil than change x position and invert new line" |
|
1939 | 734 |
|
3537 | 735 |
topView clippedByChildren:false. |
1491 | 736 |
|
3537 | 737 |
topView xoring:[ |
738 |
topView paint:color. |
|
739 |
topView lineWidth:2. |
|
740 |
topView displayLineFromX:topX y:topY toX:topX y:botY. |
|
2027
e61da28e7ffc
use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
741 |
|
3537 | 742 |
viewX notNil ifTrue:[ |
743 |
self moveToX:viewX. |
|
744 |
topView displayLineFromX:topX y:topY toX:topX y:botY. |
|
745 |
]. |
|
746 |
topView flush |
|
747 |
]. |
|
748 |
topView clippedByChildren:true. |
|
1491 | 749 |
! |
750 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
751 |
moveToX:viewX |
1939 | 752 |
topX := (minX max:viewX) + transX. |
1491 | 753 |
! ! |
754 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
755 |
!DSVLabelView::LineDrag methodsFor:'setup'! |
1491 | 756 |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
757 |
column:aColumn x:x y:y h:h minX:aMinX on:aView |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
758 |
|device point| |
1491 | 759 |
|
3537 | 760 |
column := aColumn. |
761 |
topView := aView topView. |
|
762 |
device := topView device. |
|
763 |
color := Color colorId:(device blackpixel bitXor:device whitepixel). |
|
764 |
point := device translatePoint:(x@y) fromView:aView toView:topView. |
|
765 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
766 |
topX := point x. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
767 |
topY := point y. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
768 |
botY := topY + h. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
769 |
minX := aMinX. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
770 |
startX := topX. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
771 |
transX := topX - x. |
1491 | 772 |
! ! |
773 |
||
542 | 774 |
!DSVLabelView class methodsFor:'documentation'! |
775 |
||
776 |
version |
|
4876 | 777 |
^ '$Header$' |
3766 | 778 |
! |
779 |
||
780 |
version_CVS |
|
4876 | 781 |
^ '$Header$' |
542 | 782 |
! ! |
4162 | 783 |