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