author | Stefan Vogel <sv@exept.de> |
Mon, 12 Sep 2016 15:02:30 +0200 | |
changeset 5238 | cebbdb8032de |
parent 5189 | ff07b0369121 |
child 5410 | 56776faa77eb |
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. |
824 | 172 |
self paint:bgColor. |
173 |
self fillRectangleX:x y:y width:w height:h. |
|
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. |
1940 | 199 |
self clippingRectangle:rect. |
200 |
||
3648 | 201 |
fg := (item foregroundColor) ? fgColor. |
1487 | 202 |
|
3648 | 203 |
(bg := item backgroundColor) notNil ifTrue:[ |
907 | 204 |
bg ~= bgColor ifTrue:[ |
205 |
self paint:bg. |
|
1524
b7f986aa45f4
visibility of label; show as button (yes/no)
Claus Gittinger <cg@exept.de>
parents:
1494
diff
changeset
|
206 |
self fillRectangleX:x0 y:margin width:wt height:lblH. |
907 | 207 |
] |
208 |
] ifFalse:[ |
|
209 |
bg := bgColor |
|
210 |
]. |
|
824 | 211 |
|
3648 | 212 |
self paint:fg on:bg. |
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:[ |
|
3467 | 277 |
self paint:separatorOneDColor. |
3464 | 278 |
self displayLineFromX:endOfTabX-1 y:0 toX:endOfTabX-1 y:h. |
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. |
|
295 |
self paint:separatorOneDColor. |
|
296 |
self 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:[ |
|
323 |
self paint:(dataSet backgroundColor). |
|
324 |
self fillRectangleX:x y:y width:w height:h. |
|
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 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
479 |
pointerLeave:state |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
480 |
"mouse left view - restore cursor. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
481 |
" |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
482 |
self sensor anyButtonPressed ifFalse:[ |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
483 |
self cursor:(Cursor normal) |
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 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
488 |
! |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
489 |
|
3774 | 490 |
sendClickMsgForColumnNr:colNr |
491 |
"inform the receiver of a button release notification" |
|
492 |
||
493 |
|receiver col description labelActionSelector| |
|
494 |
||
495 |
receiver := self application. |
|
496 |
receiver isNil ifTrue:[^ self]. |
|
497 |
||
498 |
col := columns at:colNr. |
|
499 |
description := col description. |
|
500 |
||
501 |
(labelActionSelector := description labelActionSelector) notNil ifTrue:[ |
|
502 |
receiver perform:labelActionSelector withOptionalArgument:(description labelActionArgument) and:colNr |
|
503 |
]. |
|
504 |
! |
|
505 |
||
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
506 |
xVisibleToColNr:x |
3212 | 507 |
"returns the column number for a physical x position. |
5078 | 508 |
Returns nil if x is beyond the last column." |
3212 | 509 |
|
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
510 |
|x0 x1| |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
511 |
|
2146 | 512 |
x1 := self xVisibleOfColNr:1. |
1525
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
513 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
514 |
columns keysAndValuesDo:[:index :aCol| |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
515 |
x0 := x1. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
516 |
x1 := x0 + aCol width. |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
517 |
|
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
518 |
(x1 > x and:[x0 < x]) ifTrue:[ |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
519 |
^ index |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
520 |
] |
1ab7703b29a9
change cursor if lineDrag is enabled
Claus Gittinger <cg@exept.de>
parents:
1524
diff
changeset
|
521 |
]. |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
522 |
^ nil |
3212 | 523 |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
524 |
"Modified: / 26-03-2007 / 15:21:37 / cg" |
824 | 525 |
! ! |
526 |
||
3188 | 527 |
!DSVLabelView methodsFor:'focus handling'! |
528 |
||
529 |
canTab |
|
530 |
^ false |
|
531 |
! |
|
532 |
||
533 |
wantsFocusWithButtonPress |
|
534 |
"never wants the focus - view which keeps the labels |
|
535 |
" |
|
536 |
^ false |
|
537 |
! ! |
|
538 |
||
3214 | 539 |
!DSVLabelView methodsFor:'help'! |
540 |
||
541 |
flyByHelpTextAt:aPoint |
|
542 |
"return the helpText for aPoint (i.e. when mouse-pointer is moved over an item)." |
|
543 |
||
544 |
|colNr col| |
|
545 |
||
546 |
columns isEmpty ifTrue:[^ nil]. |
|
547 |
colNr := self xVisibleToColNr:aPoint x. |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
548 |
colNr notNil ifTrue:[ |
3214 | 549 |
col := columns at:colNr. |
3523
26c2bafdd0fb
separate activeHelp for labels
Claus Gittinger <cg@exept.de>
parents:
3489
diff
changeset
|
550 |
^ col activeHelpTextForLabel. |
3214 | 551 |
]. |
552 |
^ nil |
|
553 |
||
554 |
"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
|
555 |
"Modified: / 26-03-2007 / 15:21:07 / cg" |
3214 | 556 |
! ! |
557 |
||
2146 | 558 |
!DSVLabelView methodsFor:'initialization'! |
559 |
||
560 |
initStyle |
|
2924 | 561 |
<resource: #style (#'dataSet.labelView.level' |
562 |
#'dataSet.labelView.verticalSpace' |
|
563 |
)> |
|
564 |
||
2146 | 565 |
super initStyle. |
566 |
||
4990 | 567 |
handleCursor := (VariablePanel cursorForOrientation:#horizontal onDevice: device) onDevice: device. |
5238 | 568 |
gc font:self class defaultFont. |
2146 | 569 |
"/ self level:0. |
2924 | 570 |
self level:(styleSheet at:#'dataSet.labelView.level' default:-1). |
571 |
verticalLabelSpacing := (styleSheet at:#'dataSet.labelView.verticalSpace' default:2). |
|
2146 | 572 |
! |
573 |
||
574 |
initialize |
|
575 |
super initialize. |
|
576 |
"/ super level:(self defaultLevel). |
|
577 |
||
578 |
enabled := true. |
|
579 |
columns := #(). |
|
580 |
tabSpacing := self class tabSpacing. |
|
581 |
||
582 |
self enableMotionEvents. |
|
583 |
! ! |
|
584 |
||
824 | 585 |
!DSVLabelView methodsFor:'instance creation'! |
586 |
||
587 |
for:aColumnView |
|
588 |
"initialization |
|
589 |
" |
|
1491 | 590 |
dataSet := aColumnView. |
2146 | 591 |
"/ self level:(dataSet level). |
592 |
"/ self borderWidth:(dataSet borderWidth). |
|
1085 | 593 |
! |
594 |
||
1487 | 595 |
realize |
596 |
"recompute contents and fit columns to view |
|
597 |
" |
|
598 |
self bitGravity:#NorthWest. |
|
599 |
super realize. |
|
824 | 600 |
! ! |
601 |
||
1487 | 602 |
!DSVLabelView methodsFor:'queries'! |
824 | 603 |
|
3769 | 604 |
columnIndexOfDescription:aColumnDescription |
605 |
^ columns findFirst:[:col | col description == aColumnDescription] |
|
606 |
! |
|
607 |
||
1487 | 608 |
enabled |
609 |
"true, if widget is enabled |
|
610 |
" |
|
611 |
^ enabled |
|
612 |
! |
|
613 |
||
614 |
enabled:aState |
|
615 |
"true, if widget is enabled |
|
542 | 616 |
" |
1487 | 617 |
enabled := aState. |
618 |
! |
|
619 |
||
3766 | 620 |
indexOfLabel:aLabel |
621 |
^ columns findFirst:[:col | col label == aLabel]. |
|
622 |
! |
|
623 |
||
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
624 |
preferredExtent |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
625 |
|
3572
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
626 |
"/ If I have an explicit preferredExtent.. |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
627 |
explicitExtent notNil ifTrue:[ |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
628 |
^ explicitExtent |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
629 |
]. |
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
630 |
|
5d45b98c9c38
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3537
diff
changeset
|
631 |
"/ If I have a cached preferredExtent value.. |
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
632 |
preferredExtent notNil ifTrue:[ |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
633 |
^ preferredExtent |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
634 |
]. |
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 |
^ 100 @ self preferredHeight |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
637 |
! |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
638 |
|
2146 | 639 |
preferredHeight |
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
640 |
|maxLabelHeight| |
2146 | 641 |
|
642 |
preferredHeight notNil ifTrue:[ |
|
643 |
^ preferredHeight |
|
644 |
]. |
|
1487 | 645 |
|
3489
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
646 |
maxLabelHeight := |
f2f5a8273044
preferredExtent changes & fixes (ubs)
Claus Gittinger <cg@exept.de>
parents:
3467
diff
changeset
|
647 |
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
|
648 |
|
4621 | 649 |
^ ((self margin + verticalLabelSpacing) * 2) + maxLabelHeight |
2146 | 650 |
! |
651 |
||
652 |
xVisibleOfColNr:colNr |
|
653 |
"/ must adjust, because dataset includes its own margin, which might be different from ours |
|
654 |
||
655 |
^ (dataSet xVisibleOfColNr:colNr) - dataSet margin + margin |
|
824 | 656 |
! |
657 |
||
1487 | 658 |
xVisibleToSelectionIndex:x |
659 |
"returns the column number assigned to a physical x or nil. If |
|
660 |
the column exists but is not selectable nil is returned. |
|
824 | 661 |
" |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
662 |
|
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
663 |
|colNr column| |
824 | 664 |
|
2146 | 665 |
(shown and:[enabled]) ifTrue:[ |
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
666 |
((colNr := dataSet xVisibleToColNr:x) notNil |
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
667 |
and:[(column := columns at:colNr) notNil |
1487 | 668 |
and:[column label isSelectable]] |
669 |
) ifTrue:[ |
|
3216
18f104700621
xVisibleToSelectionIndex:x different return value confusion
Claus Gittinger <cg@exept.de>
parents:
3214
diff
changeset
|
670 |
^ colNr |
1487 | 671 |
] |
824 | 672 |
]. |
1487 | 673 |
^ nil |
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 |
"Modified: / 26-03-2007 / 15:21:27 / cg" |
824 | 676 |
! ! |
677 |
||
1487 | 678 |
!DSVLabelView methodsFor:'scrolling'! |
824 | 679 |
|
1487 | 680 |
copyFromX:x0 y:y0 toX:x1 y:y1 width:w invalidateX:leftX |
824 | 681 |
|
2146 | 682 |
(shown) ifFalse:[^ self]. |
824 | 683 |
|
1487 | 684 |
(self sensor hasDamageFor:self) ifTrue:[ |
685 |
self invalidate |
|
686 |
] ifFalse:[ |
|
687 |
self copyFrom:self x:x0 y:y0 toX:x1 y:y1 width:w height:height async:false. |
|
688 |
self invalidate:(Rectangle left:leftX top:0 width:(width - w) height:height) |
|
689 |
repairNow:true |
|
690 |
] |
|
824 | 691 |
! ! |
692 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
693 |
!DSVLabelView::LineDrag methodsFor:'accessing'! |
1491 | 694 |
|
695 |
column |
|
696 |
"return the value of the instance variable 'column' (automatically generated)" |
|
697 |
||
1931 | 698 |
^ column |
699 |
! |
|
1491 | 700 |
|
701 |
deltaX |
|
702 |
"returns the distance x between the start and end action |
|
703 |
" |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
704 |
^ topX - startX |
1931 | 705 |
! |
706 |
||
707 |
resetDeltaX |
|
708 |
startX := topX |
|
1491 | 709 |
! ! |
710 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
711 |
!DSVLabelView::LineDrag methodsFor:'dragging'! |
1491 | 712 |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
713 |
invertLine |
3537 | 714 |
"invert current line |
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
715 |
" |
3537 | 716 |
self invertLinesMovingToX:nil. |
717 |
! |
|
2027
e61da28e7ffc
use new #translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
718 |
|
3537 | 719 |
invertLinesMovingToX:viewX |
720 |
"invert current line |
|
721 |
if x notNil than change x position and invert new line" |
|
1939 | 722 |
|
3537 | 723 |
topView clippedByChildren:false. |
1491 | 724 |
|
3537 | 725 |
topView xoring:[ |
726 |
topView paint:color. |
|
727 |
topView lineWidth:2. |
|
728 |
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
|
729 |
|
3537 | 730 |
viewX notNil ifTrue:[ |
731 |
self moveToX:viewX. |
|
732 |
topView displayLineFromX:topX y:topY toX:topX y:botY. |
|
733 |
]. |
|
734 |
topView flush |
|
735 |
]. |
|
736 |
topView clippedByChildren:true. |
|
1491 | 737 |
! |
738 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
739 |
moveToX:viewX |
1939 | 740 |
topX := (minX max:viewX) + transX. |
1491 | 741 |
! ! |
742 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
743 |
!DSVLabelView::LineDrag methodsFor:'setup'! |
1491 | 744 |
|
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
745 |
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
|
746 |
|device point| |
1491 | 747 |
|
3537 | 748 |
column := aColumn. |
749 |
topView := aView topView. |
|
750 |
device := topView device. |
|
751 |
color := Color colorId:(device blackpixel bitXor:device whitepixel). |
|
752 |
point := device translatePoint:(x@y) fromView:aView toView:topView. |
|
753 |
||
1494
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
754 |
topX := point x. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
755 |
topY := point y. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
756 |
botY := topY + h. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
757 |
minX := aMinX. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
758 |
startX := topX. |
096845be5d75
draw tabulatorLine on the tootView; do not use a SimpleView
Claus Gittinger <cg@exept.de>
parents:
1491
diff
changeset
|
759 |
transX := topX - x. |
1491 | 760 |
! ! |
761 |
||
542 | 762 |
!DSVLabelView class methodsFor:'documentation'! |
763 |
||
764 |
version |
|
4876 | 765 |
^ '$Header$' |
3766 | 766 |
! |
767 |
||
768 |
version_CVS |
|
4876 | 769 |
^ '$Header$' |
542 | 770 |
! ! |
4162 | 771 |