author | Claus Gittinger <cg@exept.de> |
Mon, 23 Jan 2006 23:18:58 +0100 | |
changeset 2886 | c7dd9972a292 |
parent 2885 | 72bacd36ba5b |
child 2907 | c4a8cac87053 |
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 |
" |
|
12 |
||
13 |
||
14 |
||
15 |
||
1754 | 16 |
"{ Package: 'stx:libwidg2' }" |
17 |
||
542 | 18 |
View subclass:#DSVColumnView |
2482
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
19 |
instanceVariableNames:'labelView listHolder editValue editView multipleSelectOk useIndex |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
20 |
selectedColIndex selectedRowIndex selectRowOnDefault |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
21 |
buttonMotionAction buttonReleaseAction rowHeight minRowHeight |
2482
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
22 |
columnDescriptors viewOrigin colorMap rowFontAscent lockRowIndex |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
23 |
rowIfAbsentBlock columnHolder registererImages list fgColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
24 |
separatorSize catchChangeEvents beDependentOfRows bgColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
25 |
actionBlock builder tabIntern doubleClickActionBlock |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
26 |
verticalSpacing horizontalSpacing rowSelectorForm |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
27 |
buttonLightColor buttonShadowColor buttonHalfLightColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
28 |
buttonHalfShadowColor checkToggleExtent checkToggleForm |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
29 |
checkToggleActiveImage checkTogglePassiveImage checkToggleLevel |
2886 | 30 |
comboButtonExtent comboButtonForm comboButtonLevel dropSource |
31 |
columnAdaptor tabAtEndAction tabAtStartAction modifiedChannel |
|
32 |
autoScroll autoScrollBlock needFitColumns scrollWhenUpdating |
|
33 |
separatorOneDColor selectionForegroundColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
34 |
selectionBackgroundColor previousExtent selectConditionBlock |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
35 |
scrollRowWise' |
2482
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
36 |
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
37 |
DefaultHilightForegroundColor DefaultHilightBackgroundColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
38 |
ButtonLightColor ButtonShadowColor CheckToggleActiveImage |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
39 |
CheckTogglePassiveImage ButtonHalfLightColor |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
40 |
ButtonHalfShadowColor ButtonEdgeStyle CheckToggleForm |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
41 |
CheckToggleLevel CheckToggleExtent ComboButtonForm |
2791 | 42 |
ComboButtonLevel ComboButtonExtent StopRedrawSignal |
43 |
DragMotionDistance' |
|
2482
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
44 |
poolDictionaries:'' |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
45 |
category:'Views-DataSet' |
542 | 46 |
! |
47 |
||
48 |
!DSVColumnView class methodsFor:'documentation'! |
|
49 |
||
50 |
copyright |
|
51 |
" |
|
52 |
COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG |
|
53 |
All Rights Reserved |
|
54 |
||
55 |
This software is furnished under a license and may be used |
|
56 |
only in accordance with the terms of that license and with the |
|
57 |
inclusion of the above copyright notice. This software may not |
|
58 |
be provided or otherwise made available to, or used by, any |
|
59 |
other person. No title to or ownership of the software is |
|
60 |
hereby transferred. |
|
61 |
" |
|
62 |
||
63 |
||
64 |
||
65 |
! |
|
66 |
||
67 |
documentation |
|
68 |
" |
|
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
69 |
ColumnView part of a DataSetView. |
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
70 |
implements a scrollable selection view based on rows and columns. |
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
71 |
Used as the contents-part of a DataSetView. |
542 | 72 |
|
73 |
[Instance variables:] |
|
74 |
||
75 |
editValue <Model> current editing model |
|
76 |
editView <View> current editing component |
|
1087 | 77 |
|
2398 | 78 |
buttonReleaseAction <Action or nil> called if the mouse button is released |
79 |
buttonMotionAction <Action or nil> called during mouse motion with one |
|
80 |
argument the point under the mouse. |
|
81 |
||
1087 | 82 |
multipleSelectOk <Boolean> multiple selection enabled/disabled |
83 |
||
542 | 84 |
selectedColIndex <Integer> selected column index or 0 |
1087 | 85 |
selectedRowIndex <Integer> selected row index or 0 |
86 |
||
542 | 87 |
rowHeight <Integer> maximum height of any row |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
88 |
minRowHeight <Integer> minimum height of all displayed labels |
1087 | 89 |
|
542 | 90 |
columnDescriptors <SequancableCollection> list of column descriptors |
1087 | 91 |
|
92 |
viewOrigin <Point> current view origin |
|
93 |
||
94 |
colorMap <Dictionary> store and register used colors on device |
|
95 |
||
96 |
rowFontAscent <SmallInteger> inset of a printable text in a row |
|
97 |
including separator and font ascent. |
|
98 |
||
99 |
lockRowIndex <SmallInteger> internal used to indicate a row which has |
|
100 |
changed its contents but no redraw should be |
|
101 |
done( at:put: ). |
|
102 |
||
103 |
columnHolder <ValueHolder> holder which keeps the list of column descriptors. |
|
104 |
||
105 |
registererImages <IdentityDictionary> list of images registered on the device |
|
106 |
||
542 | 107 |
list <SequancableCollection> list of rows |
1087 | 108 |
|
109 |
||
110 |
catchChangeEvents <Boolean> internal used to discard change notifications |
|
111 |
||
112 |
beDependentOfRows <Boolean> keep rows dependent; on default is disabled. |
|
567 | 113 |
in case of enabled a row can raise a change |
114 |
notification whithout a parameter which |
|
115 |
will force a redraw of the row or the |
|
116 |
readSelector of the column which will |
|
117 |
redraw the cell in the row only. |
|
542 | 118 |
|
1087 | 119 |
fgColor <Color> foreground color |
120 |
bgColor <Color> background color |
|
121 |
hgLgFgColor <Color> highlight foreground color (selected) |
|
122 |
hgLgBgColor <Color> highlight background color (selected) |
|
123 |
||
124 |
buttonLightColor <Color> LightColor ( drawing the edge of a button ) |
|
125 |
buttonShadowColor <Color> ShadowColor ( drawing the edge of a button ) |
|
126 |
buttonHalfLightColor <Color> HalfLightColor ( drawing the edge of a button ) |
|
127 |
buttonHalfShadowColor <Color> HalfShadowColor ( drawing the edge of a button ) |
|
128 |
||
129 |
actionBlock <a OneArgBlock> action block performed on select |
|
130 |
doubleClickActionBlock <a OneArgBlock> action block performed on double click |
|
131 |
rowIfAbsentBlock <a OneArgBlock> this block is performed on an emty list entry |
|
132 |
to retrive the item from the application. The |
|
133 |
argument to the block is the index into the list. |
|
134 |
The block should return the row instance which |
|
135 |
is put to the list under the index. |
|
136 |
||
137 |
builder <UIBuilder> builder set by application |
|
138 |
||
139 |
verticalSpacing <SmallInteger> vertical row spacing( top & bottom ) |
|
140 |
horizontalSpacing <SmallInteger> horizontal row spacing( left & right ) |
|
141 |
separatorSize <SmallInteger> line width of a vertical or horizontal separator |
|
142 |
||
143 |
rowSelectorForm <Form> form used by a row selector |
|
144 |
||
145 |
checkToggleForm <Form> form used by a checkToggle |
|
146 |
checkToggleExtent <Point> extent of a checkToggle |
|
147 |
checkToggleLevel <SmallInteger> level used to draw a check toggle |
|
148 |
||
149 |
comboButtonForm <Form> form used by a comboList or -Box |
|
150 |
comboButtonExtent <Point> extent of a comboList or -Box |
|
151 |
comboButtonLevel <SmallInteger> level used to draw a comboList or -Box |
|
152 |
||
153 |
dropTarget <DropTarget> drag & drop target |
|
154 |
dropSource <DropSource> drag & drop source |
|
155 |
||
542 | 156 |
[author:] |
157 |
Claus Atzkern |
|
158 |
||
159 |
[see also:] |
|
160 |
DataSetColumnSpec |
|
161 |
DataSetColumn |
|
162 |
DataSetView |
|
163 |
" |
|
164 |
! ! |
|
165 |
||
647 | 166 |
!DSVColumnView class methodsFor:'defaults'! |
607 | 167 |
|
1844 | 168 |
defaultFont |
169 |
^ SelectionInListView defaultFont |
|
170 |
! |
|
171 |
||
563 | 172 |
horizontalSpacing |
1087 | 173 |
"returns the default horizontal space between rows |
174 |
" |
|
563 | 175 |
^ 4 |
176 |
||
177 |
! |
|
178 |
||
542 | 179 |
updateStyleCache |
2777 | 180 |
"extract values from the styleSheet and cache them in class variables" |
181 |
||
2146 | 182 |
<resource: #style (#textForegroundColor |
183 |
#'scrollableView.backgroundColor' |
|
2777 | 184 |
#'button.lightColor' |
185 |
#'button.shadowColor' |
|
186 |
#'button.halfLightColor' |
|
187 |
#'button.halfShadowColor' |
|
188 |
#'button.edgeStyle' |
|
189 |
#'checkToggle.activeImage' |
|
190 |
#'checkToggle.passiveImage' |
|
582 | 191 |
#'selection.hilightForegroundColor' |
192 |
#'selection.hilightBackgroundColor' )> |
|
542 | 193 |
|
1333 | 194 |
DefaultForegroundColor := StyleSheet colorAt:#'textForegroundColor' default:(Color black). |
195 |
DefaultBackgroundColor := StyleSheet colorAt:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor. |
|
196 |
||
197 |
DefaultHilightForegroundColor := StyleSheet colorAt:#'selection.hilightForegroundColor' default:DefaultBackgroundColor. |
|
198 |
DefaultHilightBackgroundColor := StyleSheet colorAt:#'selection.hilightBackgroundColor' default:DefaultForegroundColor. |
|
607 | 199 |
|
647 | 200 |
DefaultHilightForegroundColor = DefaultHilightBackgroundColor ifTrue:[ |
988 | 201 |
DefaultHilightBackgroundColor := Color black |
647 | 202 |
]. |
1333 | 203 |
ButtonLightColor := StyleSheet colorAt:#'button.lightColor'. |
204 |
ButtonShadowColor := StyleSheet colorAt:#'button.shadowColor'. |
|
205 |
ButtonHalfLightColor := StyleSheet colorAt:#'button.halfLightColor'. |
|
206 |
ButtonHalfShadowColor := StyleSheet colorAt:#'button.halfShadowColor'. |
|
207 |
ButtonEdgeStyle := StyleSheet at:#'button.edgeStyle'. |
|
208 |
CheckToggleActiveImage := StyleSheet at:#'checkToggle.activeImage'. |
|
1100 | 209 |
|
210 |
CheckToggleActiveImage isNil ifTrue:[ |
|
211 |
CheckTogglePassiveImage := nil |
|
212 |
] ifFalse:[ |
|
1333 | 213 |
CheckTogglePassiveImage := StyleSheet at:#'checkToggle.passiveImage'. |
1100 | 214 |
|
215 |
CheckTogglePassiveImage isNil ifTrue:[ |
|
216 |
CheckToggleActiveImage := nil |
|
217 |
] |
|
218 |
]. |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
219 |
ComboButtonForm := nil. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
220 |
ComboButtonLevel := nil. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
221 |
ComboButtonExtent := nil. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
222 |
|
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
223 |
CheckToggleForm := nil. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
224 |
CheckToggleLevel := nil. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
225 |
CheckToggleExtent := nil. |
647 | 226 |
|
2777 | 227 |
" |
228 |
self updateStyleCache. |
|
229 |
" |
|
542 | 230 |
|
582 | 231 |
"Modified: / 26.10.1997 / 17:09:07 / cg" |
563 | 232 |
! |
233 |
||
234 |
verticalSpacing |
|
1087 | 235 |
"returns the default vertical space between rows |
236 |
" |
|
563 | 237 |
^ 2 |
238 |
||
542 | 239 |
! ! |
240 |
||
2711 | 241 |
!DSVColumnView class methodsFor:'image specs'! |
809 | 242 |
|
243 |
dragIconMulti |
|
988 | 244 |
"This resource specification was automatically generated |
245 |
by the ImageEditor of ST/X." |
|
246 |
||
247 |
"Do not manually edit this!! If it is corrupted, |
|
248 |
the ImageEditor may not be able to read the specification." |
|
249 |
||
809 | 250 |
" |
988 | 251 |
self dragIconMulti inspect |
252 |
ImageEditor openOnClass:self andSelector:#dragIconMulti |
|
809 | 253 |
" |
254 |
||
255 |
<resource: #image> |
|
256 |
||
257 |
^Icon |
|
258 |
constantNamed:#'DSVColumnView dragIconMulti' |
|
1926
9bcb6b59ea37
if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
259 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O?<0@C??L@@<@@@@O@@@@C3??L@<??3@OO?<<C3??O@<??0@OO?<@C3???0<???<OO???C3???0<???<OO???@C???0@???<@O???@C???0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@O??<@C???@@???<@O???@C????@????0O????C????0?????O????3?????????????????????????????????????????????????????@????0O???<C????@????0@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
9bcb6b59ea37
if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
260 |
! |
809 | 261 |
|
262 |
dragIconSingle |
|
988 | 263 |
"This resource specification was automatically generated |
264 |
by the ImageEditor of ST/X." |
|
265 |
||
266 |
"Do not manually edit this!! If it is corrupted, |
|
267 |
the ImageEditor may not be able to read the specification." |
|
268 |
||
809 | 269 |
" |
988 | 270 |
self dragIconSingle inspect |
271 |
ImageEditor openOnClass:self andSelector:#dragIconSingle |
|
809 | 272 |
" |
273 |
||
274 |
<resource: #image> |
|
275 |
||
276 |
^Icon |
|
277 |
constantNamed:#'DSVColumnView dragIconSingle' |
|
1926
9bcb6b59ea37
if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
278 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O?<0@C??L@@??30@O?<<@C??@@@??0@@O???@C???0@???<@O???@C???0@???<@O???@C???0@???<@O???@C???0@???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@O??<@C???@@???<@O???@C???<@????@O???<C????@????0O???<C????@????0O???<C????@????0O???<C????@????0O???<C????@????0O???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
2711 | 279 |
! |
280 |
||
281 |
rowSelectorImage |
|
282 |
"This resource specification was automatically generated |
|
283 |
by the ImageEditor of ST/X." |
|
284 |
||
285 |
"Do not manually edit this!! If it is corrupted, |
|
286 |
the ImageEditor may not be able to read the specification." |
|
287 |
||
288 |
" |
|
289 |
self rowSelectorImage inspect |
|
290 |
ImageEditor openOnClass:self andSelector:#rowSelectorImage |
|
291 |
Icon flushCachedIcons |
|
292 |
" |
|
293 |
||
294 |
<resource: #image> |
|
295 |
||
296 |
^Icon |
|
297 |
constantNamed:#'DSVColumnView class rowSelectorImage' |
|
298 |
ifAbsentPut:[(Depth2Image new) width: 11; height: 11; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@0@@@1@@?1P@@A4@EW=@G?? O?:@@C(@?2 @@2@@@0@@') ; colorMapFromArray:#[0 0 0 255 255 255 127 127 127 170 170 170]; mask:((Depth1Image new) width: 11; height: 11; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'C@@N@@<@?8C?0O? ?<C? @<@C @L@@@a') ; yourself); yourself] |
|
1926
9bcb6b59ea37
if never set, the default menuPerformer is
Claus Gittinger <cg@exept.de>
parents:
1844
diff
changeset
|
299 |
! ! |
809 | 300 |
|
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
301 |
!DSVColumnView class methodsFor:'signal constants'! |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
302 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
303 |
stopRedrawSignal |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
304 |
"returns the signal which is raised during drawing if the |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
305 |
required label height is less than the current rowHeight |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
306 |
" |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
307 |
StopRedrawSignal isNil ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
308 |
StopRedrawSignal := Notification newSignalMayProceed:true. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
309 |
StopRedrawSignal nameClass:self message:#stopRedrawSignal. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
310 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
311 |
^ StopRedrawSignal |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
312 |
! ! |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
313 |
|
886 | 314 |
!DSVColumnView methodsFor:'accessing'! |
315 |
||
1042 | 316 |
builder |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
317 |
"get the builder (UIBuilder or nil)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
318 |
|
1042 | 319 |
^ builder |
320 |
! |
|
321 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
322 |
builder:aBuilder |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
323 |
"set the builder (UIBuilder or nil)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
324 |
|
1042 | 325 |
builder := aBuilder |
326 |
! |
|
327 |
||
886 | 328 |
columnView |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
329 |
"returns self" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
330 |
|
886 | 331 |
^ self |
1067
c66188014600
keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
332 |
! |
c66188014600
keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
333 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
334 |
heightOfContents |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
335 |
"return the height of the contents in pixels" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
336 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
337 |
preferredExtent isNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
338 |
self preferredExtent |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
339 |
]. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
340 |
^ preferredExtent y |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
341 |
! |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
342 |
|
2695 | 343 |
labelView |
344 |
||
345 |
^labelView |
|
346 |
! |
|
347 |
||
1487 | 348 |
labelView:aView |
349 |
labelView := aView for:self. |
|
350 |
||
2146 | 351 |
labelView layout:(LayoutFrame |
352 |
leftFraction:0 offset:0 |
|
353 |
rightFraction:1 offset:0 |
|
354 |
topFraction:0 offset:0 |
|
355 |
bottomFraction:0 offset:[self preferredLabelViewHeight]). |
|
1067
c66188014600
keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
356 |
! |
c66188014600
keep a reference to my dataSetView.
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
357 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
358 |
level:aLevel |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
359 |
"change the level and thus the level of the labelView" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
360 |
|
1487 | 361 |
aLevel ~~ level ifTrue:[ |
362 |
super level:aLevel. |
|
2146 | 363 |
"/ labelView level:aLevel. |
1487 | 364 |
] |
1087 | 365 |
! |
366 |
||
1661 | 367 |
modifiedChannel |
368 |
^ modifiedChannel |
|
369 |
||
370 |
"Created: / 30.1.2000 / 12:10:57 / cg" |
|
371 |
! |
|
372 |
||
373 |
modifiedChannel:something |
|
374 |
modifiedChannel := something. |
|
375 |
||
376 |
"Created: / 30.1.2000 / 12:10:57 / cg" |
|
377 |
! |
|
378 |
||
2146 | 379 |
preferredLabelViewHeight |
380 |
^ labelView preferredHeight + (labelView margin + self verticalSpacing * 2). |
|
381 |
! |
|
382 |
||
1087 | 383 |
rowFontAscent |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
384 |
"returns the inset of a printable text in a row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
385 |
|
1087 | 386 |
^ rowFontAscent |
886 | 387 |
! ! |
388 |
||
1818 | 389 |
!DSVColumnView methodsFor:'accessing-actions'! |
542 | 390 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
391 |
action:aOneArgAction |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
392 |
"set the action block to be performed on select" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
393 |
|
542 | 394 |
actionBlock := aOneArgAction |
395 |
! |
|
396 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
397 |
doubleClickAction:aOneArgAction |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
398 |
"set the action block to be performed on doubleclick" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
399 |
|
809 | 400 |
doubleClickActionBlock := aOneArgAction |
401 |
! |
|
402 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
403 |
rowIfAbsent:aOneArgAction |
809 | 404 |
"set the action block to be performed on each 'nil' entry into the |
405 |
list. The argument to the block is the index into the list. The |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
406 |
block returns the row which is put to the list" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
407 |
|
809 | 408 |
rowIfAbsentBlock := aOneArgAction |
1416 | 409 |
! |
410 |
||
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
411 |
selectConditionBlock |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
412 |
"get the select-conditionBlock; this block is evaluated before |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
413 |
any selection change is performed (passing the to-be-changed row number |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
414 |
index as arg). |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
415 |
The change will not be done, if the block returns false. " |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
416 |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
417 |
^ selectConditionBlock |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
418 |
! |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
419 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
420 |
selectConditionBlock:aOneArgBlockOrNil |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
421 |
"set the select-conditionBlock; this block is evaluated before |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
422 |
any selection change is performed (passing the to-be-changed row number |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
423 |
index as arg). |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
424 |
The change will not be done, if the block returns false. " |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
425 |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
426 |
selectConditionBlock := aOneArgBlockOrNil. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
427 |
! |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
428 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
429 |
tabAtEndAction:aNoneArgAction |
1416 | 430 |
"set the action, called without any argument at end of the list entering |
431 |
tab next. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
432 |
The default is to give the focus to the view after self in the focusSequence" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
433 |
|
1416 | 434 |
tabAtEndAction := aNoneArgAction |
435 |
! |
|
436 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
437 |
tabAtStartAction:aNoneArgAction |
1416 | 438 |
"set the action, called without any argument at start of the list entering |
439 |
tab previous. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
440 |
The default is to give the focus to the view before self in the focusSequence" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
441 |
|
1416 | 442 |
tabAtStartAction := aNoneArgAction |
809 | 443 |
! ! |
444 |
||
1818 | 445 |
!DSVColumnView methodsFor:'accessing-behavior'! |
809 | 446 |
|
542 | 447 |
beDependentOfRows |
448 |
"make myself dependent of any row; in this case any change notification |
|
449 |
raised by a row is catched and the cell identified by the 'readSelector' |
|
450 |
is redrawn. In case of a nil readSelector, the whole raw is redrawn. |
|
451 |
-> row changed:'what' |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
452 |
By default, the attribute is set to false (disabled)." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
453 |
|
542 | 454 |
^ beDependentOfRows |
455 |
! |
|
456 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
457 |
beDependentOfRows:aBool |
542 | 458 |
"make myself dependent of any row; in this case any change notification |
459 |
raised by a row is catched and the cell identified by the 'readSelector' |
|
460 |
is redrawn. In case of a nil readSelector, the whole raw is redrawn. |
|
461 |
-> row changed:'what' |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
462 |
By default, the attribute is set to false (disabled)." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
463 |
|
542 | 464 |
aBool ~~ beDependentOfRows ifTrue:[ |
618 | 465 |
beDependentOfRows := aBool. |
2836 | 466 |
aBool ifTrue:[ |
467 |
self makeDependentOfRows |
|
468 |
] ifFalse:[ |
|
469 |
self makeIndependentOfRows |
|
470 |
]. |
|
618 | 471 |
] |
607 | 472 |
! |
473 |
||
1805 | 474 |
enableChannel:aChannel |
475 |
enableChannel notNil ifTrue:[ |
|
476 |
enableChannel removeDependent:self |
|
477 |
]. |
|
478 |
(enableChannel := aChannel) notNil ifTrue:[ |
|
479 |
enableChannel addDependent:self |
|
480 |
]. |
|
481 |
! |
|
482 |
||
2836 | 483 |
makeDependentOfRows |
484 |
"make myself dependent of any row" |
|
485 |
||
486 |
list size ~~ 0 ifTrue:[ |
|
487 |
list do:[:aRow | |
|
488 |
aRow notNil ifTrue:[ |
|
489 |
aRow addDependent:self |
|
490 |
] |
|
491 |
] |
|
492 |
] |
|
493 |
! |
|
494 |
||
495 |
makeIndependentOfRows |
|
496 |
"make myself independent of any row" |
|
497 |
||
498 |
list size ~~ 0 ifTrue:[ |
|
499 |
list do:[:aRow | |
|
500 |
aRow notNil ifTrue:[ |
|
501 |
aRow removeDependent:self |
|
502 |
] |
|
503 |
] |
|
504 |
] |
|
505 |
! |
|
506 |
||
607 | 507 |
multipleSelectOk |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
508 |
"allow/disallow multiple row selections; the default is false" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
509 |
|
607 | 510 |
^ multipleSelectOk |
511 |
! |
|
512 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
513 |
multipleSelectOk:aState |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
514 |
"allow/disallow multiple row selections; the default is false" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
515 |
|
607 | 516 |
aState == multipleSelectOk ifFalse:[ |
517 |
multipleSelectOk := aState. |
|
518 |
self deselect |
|
519 |
] |
|
1112 | 520 |
! |
521 |
||
1938 | 522 |
opaqueColumnResize |
523 |
^ labelView opaqueColumnResize |
|
524 |
! |
|
525 |
||
526 |
opaqueColumnResize:aBoolean |
|
527 |
labelView opaqueColumnResize:aBoolean |
|
528 |
! |
|
529 |
||
1946
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
530 |
scrollWhenUpdating |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
531 |
"return the scroll behavior, when I get a new text |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
532 |
(via the model or the #contents/#list) |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
533 |
Possible returnValues are: |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
534 |
#keep / nil -> no change |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
535 |
#endOfText -> scroll to the end |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
536 |
#beginOfText -> scroll to the top |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
537 |
The default is #beginOfText. |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
538 |
This may be useful for fields which get new values assigned from |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
539 |
the program (i.e. not from the user)" |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
540 |
|
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
541 |
^ scrollWhenUpdating |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
542 |
! |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
543 |
|
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
544 |
scrollWhenUpdating:aSymbolOrNil |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
545 |
"define how to scroll, when I get a new text |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
546 |
(via the model or the #contents/#list) |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
547 |
Allowed arguments are: |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
548 |
#keep / nil -> no change |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
549 |
#endOfText -> scroll to the end |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
550 |
#beginOfText -> scroll to the top |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
551 |
The default is #beginOfText. |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
552 |
This may be useful for fields which get new values assigned from |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
553 |
the program (i.e. not from the user)" |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
554 |
|
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
555 |
scrollWhenUpdating := aSymbolOrNil |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
556 |
! |
0738b9f8c19f
preps for scrollWhenUpdating flag
Claus Gittinger <cg@exept.de>
parents:
1941
diff
changeset
|
557 |
|
1112 | 558 |
selectRowOnDefault |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
559 |
"in case of selecting a none selectable cell, the row is selected" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
560 |
|
1112 | 561 |
^ selectRowOnDefault |
562 |
! |
|
563 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
564 |
selectRowOnDefault:aBool |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
565 |
"in case of selecting a none selectable cell, the row is selected" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
566 |
|
1112 | 567 |
selectRowOnDefault := aBool |
1487 | 568 |
! |
569 |
||
1668 | 570 |
tabIntern |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
571 |
"returns true if tabing is supported in the widget" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
572 |
|
1668 | 573 |
^ tabIntern |
574 |
! |
|
575 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
576 |
tabIntern:aBool |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
577 |
"returns true if tabing is supported in the widget" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
578 |
|
1668 | 579 |
tabIntern := aBool ? true |
580 |
! |
|
581 |
||
1487 | 582 |
useIndex |
583 |
"specify, if the selected components value or its index in the |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
584 |
list should be sent to the model. The default is its index." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
585 |
|
1487 | 586 |
^ useIndex |
587 |
! |
|
588 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
589 |
useIndex:aBool |
1487 | 590 |
"specify, if the selected components value or its index in the |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
591 |
list should be sent to the model. The default is its index." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
592 |
|
1487 | 593 |
useIndex := aBool |
542 | 594 |
! ! |
595 |
||
1818 | 596 |
!DSVColumnView methodsFor:'accessing-colors'! |
824 | 597 |
|
598 |
backgroundColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
599 |
"get the background color of the rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
600 |
|
824 | 601 |
^ bgColor |
602 |
! |
|
603 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
604 |
backgroundColor:aColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
605 |
"set the background color of the rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
606 |
|
824 | 607 |
bgColor ~~ aColor ifTrue:[ |
608 |
super viewBackground:bgColor. |
|
609 |
self realized ifTrue:[ |
|
1480 | 610 |
bgColor := aColor onDevice:device. |
824 | 611 |
self invalidate |
612 |
] ifFalse:[ |
|
613 |
bgColor := aColor |
|
614 |
] |
|
615 |
] |
|
616 |
! |
|
617 |
||
618 |
foregroundColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
619 |
"return the foreground color of the rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
620 |
|
824 | 621 |
^ fgColor |
622 |
! |
|
623 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
624 |
foregroundColor:aColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
625 |
"set the foreground color of the rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
626 |
|
824 | 627 |
fgColor ~~ aColor ifTrue:[ |
628 |
self realized ifTrue:[ |
|
1480 | 629 |
fgColor := aColor onDevice:device. |
824 | 630 |
self invalidate |
631 |
] ifFalse:[ |
|
632 |
fgColor := aColor |
|
633 |
] |
|
634 |
] |
|
635 |
! |
|
636 |
||
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
637 |
selectionBackgroundColor |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
638 |
"returns the background color of a selected row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
639 |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
640 |
^ selectionBackgroundColor |
824 | 641 |
! |
642 |
||
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
643 |
selectionForegroundColor |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
644 |
"returns the foreground color of a selected row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
645 |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
646 |
^ selectionForegroundColor |
824 | 647 |
! |
648 |
||
649 |
separatorDarkColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
650 |
"returns the dark color used for drawing a shadowed separator (3D)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
651 |
|
824 | 652 |
^ shadowColor |
653 |
! |
|
654 |
||
655 |
separatorLightColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
656 |
"returns the light color used for drawing a shadowed separator (3D)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
657 |
|
824 | 658 |
^ lightColor |
2637 | 659 |
! |
660 |
||
661 |
separatorOneDColor |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
662 |
"returns the color used for drawing a oneD separator" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
663 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
664 |
separatorOneDColor isNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
665 |
^ fgColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
666 |
]. |
2637 | 667 |
^ separatorOneDColor |
668 |
! |
|
669 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
670 |
separatorOneDColor:aColorOrNil |
2637 | 671 |
"set the color used for drawing a oneD separator; if the color |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
672 |
is nil, the current forgroundColor is used" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
673 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
674 |
separatorOneDColor = aColorOrNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
675 |
^ self |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
676 |
]. |
2637 | 677 |
separatorOneDColor := aColorOrNil. |
678 |
self realized ifTrue:[ |
|
679 |
separatorOneDColor notNil ifTrue:[ |
|
680 |
separatorOneDColor := separatorOneDColor onDevice:device. |
|
681 |
]. |
|
682 |
self invalidate. |
|
683 |
]. |
|
824 | 684 |
! ! |
685 |
||
1818 | 686 |
!DSVColumnView methodsFor:'accessing-columns'! |
542 | 687 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
688 |
columnAt:anIndex |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
689 |
"returns the column at an index" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
690 |
|
1112 | 691 |
^ columnDescriptors at:anIndex ifAbsent:nil |
542 | 692 |
! |
693 |
||
886 | 694 |
columnDescriptors |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
695 |
"returns list of column descriptors" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
696 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
697 |
^ columnDescriptors collect:[:aCol | aCol description ] |
886 | 698 |
! |
699 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
700 |
columnDescriptors:aColumnDescriptionList |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
701 |
"set the columnDescriptors; scroll to top and deselect" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
702 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
703 |
|delta| |
612 | 704 |
|
886 | 705 |
self deselect. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
706 |
(viewOrigin x ~~ 0 or:[ viewOrigin y ~~ 0 ]) ifTrue:[ |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
707 |
delta := viewOrigin negated. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
708 |
viewOrigin := 0 @ 0. |
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
709 |
self originChanged:delta |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
710 |
]. |
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
711 |
self setColumnDescriptors:aColumnDescriptionList |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
712 |
! |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
713 |
|
2703 | 714 |
dataSetColumns |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
715 |
"returns the list of DataSetColumns; each column represents a DataSetColumnSpec" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
716 |
|
2703 | 717 |
^ columnDescriptors |
718 |
! |
|
719 |
||
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
720 |
firstColumn |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
721 |
"returns the first column" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
722 |
|
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
723 |
^ columnDescriptors at:1 |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
724 |
! |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
725 |
|
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
726 |
lastColumn |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
727 |
"returns the last column" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
728 |
|
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
729 |
^ columnDescriptors last |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
730 |
! |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
731 |
|
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
732 |
setColumnDescriptors:aColumnDescriptionList |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
733 |
"set the columnDescriptors; dont deselect and do not scroll to top" |
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
734 |
|cid| |
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
735 |
|
1487 | 736 |
cid := 0. |
737 |
columnDescriptors := aColumnDescriptionList ? #(). |
|
738 |
||
2835 | 739 |
columnDescriptors := columnDescriptors |
740 |
collect: |
|
741 |
[:el||dsc lbl| |
|
742 |
dsc := el isSequenceable |
|
743 |
ifTrue:[DataSetColumnSpec new fromLiteralArrayEncoding:el] |
|
744 |
ifFalse:[el]. |
|
745 |
cid := cid + 1. |
|
746 |
lbl := DataSetLabel new description:dsc builder:builder on:labelView. |
|
747 |
DataSetColumn new on:self description:dsc columnNumber:cid label:lbl |
|
748 |
]. |
|
1487 | 749 |
|
750 |
preferredExtent := nil. |
|
751 |
labelView columns:columnDescriptors. |
|
542 | 752 |
|
612 | 753 |
shown ifTrue:[ |
1487 | 754 |
self fitColumns. |
563 | 755 |
]. |
542 | 756 |
! ! |
757 |
||
1818 | 758 |
!DSVColumnView methodsFor:'accessing-interactors'! |
809 | 759 |
|
1100 | 760 |
checkToggleActiveImage |
761 |
^ checkToggleActiveImage |
|
762 |
! |
|
763 |
||
809 | 764 |
checkToggleExtent |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
765 |
"returns the extent of a checkToggle" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
766 |
|
809 | 767 |
^ checkToggleExtent |
768 |
! |
|
769 |
||
770 |
checkToggleForm |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
771 |
"returns the form of a checkToggle" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
772 |
|
809 | 773 |
^ checkToggleForm |
774 |
! |
|
775 |
||
776 |
checkToggleLevel |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
777 |
"returns the level of a checkToggle button" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
778 |
|
809 | 779 |
^ checkToggleLevel |
780 |
! |
|
781 |
||
1100 | 782 |
checkTogglePassiveImage |
783 |
^ checkTogglePassiveImage |
|
784 |
! |
|
785 |
||
809 | 786 |
comboButtonExtent |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
787 |
"returns the extent of a comboList or -Box" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
788 |
|
809 | 789 |
^ comboButtonExtent |
790 |
! |
|
791 |
||
792 |
comboButtonForm |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
793 |
"returns the form of a comboList or -Box" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
794 |
|
809 | 795 |
^ comboButtonForm |
796 |
! |
|
797 |
||
798 |
comboButtonLevel |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
799 |
"returns the level of a comboList or -Box button" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
800 |
|
809 | 801 |
^ comboButtonLevel |
802 |
! |
|
803 |
||
804 |
rowSelectorExtent |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
805 |
"returns the bitmap of a selected row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
806 |
|
809 | 807 |
^ rowSelectorForm extent |
808 |
! |
|
809 |
||
810 |
rowSelectorForm |
|
2711 | 811 |
"returns the (arrow-) image shown for a selected row. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
812 |
(the arrow shown in the first column)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
813 |
|
809 | 814 |
^ rowSelectorForm |
815 |
! ! |
|
816 |
||
1818 | 817 |
!DSVColumnView methodsFor:'accessing-mvc'! |
612 | 818 |
|
1008
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
819 |
columnAdaptor |
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
820 |
"return the value of the instance variable 'columnAdaptor' (automatically generated)" |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
821 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
822 |
columnAdaptor isValueModel ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
823 |
^ columnAdaptor value |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
824 |
]. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
825 |
^ columnAdaptor |
1711 | 826 |
! |
1008
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
827 |
|
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
828 |
columnAdaptor:something |
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
829 |
"set the value of the instance variable 'columnAdaptor' (automatically generated)" |
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
830 |
|
1711 | 831 |
columnAdaptor isValueModel ifTrue:[ |
832 |
columnAdaptor removeDependent:self |
|
833 |
]. |
|
834 |
(columnAdaptor := something) isValueModel ifTrue:[ |
|
835 |
columnAdaptor addDependent:self |
|
836 |
]. |
|
837 |
! |
|
1008
7874385db982
changes to support columnAdaptors
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
838 |
|
612 | 839 |
columnHolder |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
840 |
"get the valueHolder, which keeps the list of column descriptions" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
841 |
|
612 | 842 |
^ columnHolder |
843 |
! |
|
844 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
845 |
columnHolder:aValueHolder |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
846 |
"set the valueHolder, which keeps the list of column descriptions" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
847 |
|
612 | 848 |
|columns| |
849 |
||
850 |
columnHolder notNil ifTrue:[ |
|
851 |
columnHolder removeDependent:self |
|
852 |
]. |
|
853 |
(columnHolder := aValueHolder) notNil ifTrue:[ |
|
854 |
columnHolder addDependent:self. |
|
855 |
columns := columnHolder value. |
|
856 |
columns notNil ifTrue:[ |
|
857 |
self columnDescriptors:columns |
|
858 |
] |
|
859 |
]. |
|
1487 | 860 |
! |
861 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
862 |
listAt:index put:newElement |
1487 | 863 |
"kludge callback, when an element hs to be replaced |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
864 |
due to a col-adaptor returning a new row element" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
865 |
|
1487 | 866 |
|list| |
867 |
||
868 |
(list := listHolder value) notNil ifTrue:[ |
|
869 |
list at:index put:newElement |
|
870 |
] |
|
871 |
! |
|
872 |
||
2318 | 873 |
listHolder |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
874 |
"get the valueHolder which holds the list of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
875 |
|
2318 | 876 |
^ listHolder |
877 |
! |
|
878 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
879 |
listHolder:aListHolder |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
880 |
"set the valueHolder which holds the list of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
881 |
|
1487 | 882 |
listHolder ~~ aListHolder ifTrue:[ |
883 |
listHolder notNil ifTrue:[ |
|
884 |
listHolder removeDependent:self |
|
885 |
]. |
|
886 |
(listHolder := aListHolder) notNil ifTrue:[ |
|
887 |
listHolder addDependent:self |
|
888 |
] |
|
889 |
]. |
|
890 |
self pushEvent:#list: with:(listHolder value). |
|
891 |
! |
|
892 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
893 |
model:aModel |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
894 |
"set the valueHolder which holds the selection and maybe the list of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
895 |
|
1487 | 896 |
model notNil ifTrue:[ |
897 |
model removeDependent:self. |
|
898 |
(model respondsTo:#list) ifTrue:[ |
|
899 |
(model list == listHolder) ifTrue:[ |
|
900 |
self listHolder:nil |
|
901 |
] |
|
902 |
] |
|
903 |
]. |
|
904 |
(model := aModel) notNil ifTrue:[ |
|
905 |
model addDependent:self. |
|
906 |
(aModel respondsTo:#list) ifTrue:[ |
|
907 |
self listHolder:model list |
|
908 |
] |
|
909 |
] |
|
612 | 910 |
! ! |
911 |
||
1818 | 912 |
!DSVColumnView methodsFor:'accessing-rows'! |
542 | 913 |
|
914 |
at:aRowNr |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
915 |
"return the row at an index, aRowNr" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
916 |
|
618 | 917 |
|row| |
918 |
||
919 |
(row := list at:aRowNr) isNil ifTrue:[ |
|
920 |
lockRowIndex := aRowNr. |
|
921 |
||
1034
bd02c4cd7582
care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
922 |
(rowIfAbsentBlock notNil |
bd02c4cd7582
care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
923 |
and:[(row := rowIfAbsentBlock value:aRowNr) notNil]) ifTrue:[ |
618 | 924 |
list at:aRowNr put:row. |
925 |
beDependentOfRows ifTrue:[row addDependent:self]. |
|
926 |
]. |
|
927 |
||
928 |
lockRowIndex := 0 |
|
929 |
]. |
|
930 |
^ row |
|
1034
bd02c4cd7582
care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
931 |
|
bd02c4cd7582
care for nonexisting rowIfAbsentBlock when a nil-row is encountered.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
932 |
"Modified: / 31.7.1998 / 01:07:46 / cg" |
542 | 933 |
! |
934 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
935 |
at:aRowNr ifAbsent:exceptionBlock |
607 | 936 |
"return the row at a aRowNr. If the index is invalid, return the |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
937 |
result of evaluating the exceptionblock" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
938 |
|
1497 | 939 |
(aRowNr between:1 and:list size) ifTrue:[ |
618 | 940 |
^ self at:aRowNr |
941 |
]. |
|
942 |
^ exceptionBlock value |
|
542 | 943 |
! |
944 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
945 |
at:aRowNr put:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
946 |
"change the row at an index. The added row is returned" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
947 |
|
1956 | 948 |
lockRowIndex ~~ aRowNr ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
949 |
(aRowNr <= list size and:[ (list at:aRowNr) == aRow ]) ifTrue:[ |
1956 | 950 |
self invalidateRowAt:aRowNr |
951 |
] ifFalse:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
952 |
self |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
953 |
replaceFrom:aRowNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
954 |
to:aRowNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
955 |
with:(Array with:aRow) |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
956 |
startingAt:1. |
618 | 957 |
] |
542 | 958 |
]. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
959 |
^ aRow |
542 | 960 |
! |
961 |
||
962 |
first |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
963 |
"return the first row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
964 |
|
618 | 965 |
^ self at:1 |
966 |
! |
|
967 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
968 |
identityIndexOfRow:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
969 |
"returns index of a row or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
970 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
971 |
(list size ~~ 0 and:[ aRow notNil ]) ifTrue:[ |
618 | 972 |
^ list identityIndexOf:aRow |
973 |
]. |
|
974 |
^ 0 |
|
542 | 975 |
! |
976 |
||
977 |
last |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
978 |
"return the last row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
979 |
|
1497 | 980 |
^ self at:(list size) |
542 | 981 |
! |
982 |
||
983 |
list |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
984 |
"get the list of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
985 |
|
542 | 986 |
^ list |
987 |
! |
|
988 |
||
989 |
list:aList |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
990 |
"set the list of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
991 |
|
2836 | 992 |
|selectionHasChanged| |
656 | 993 |
|
618 | 994 |
"/ remove selection without redraw |
622 | 995 |
|
1259 | 996 |
selectionHasChanged := self hasSelection. |
997 |
||
1111 | 998 |
self destroyEditView. |
622 | 999 |
|
618 | 1000 |
selectedColIndex := 0. |
1001 |
selectedRowIndex := multipleSelectOk ifTrue:[nil] ifFalse:[0]. |
|
542 | 1002 |
|
612 | 1003 |
shown ifFalse:[ |
1004 |
preferredExtent := nil |
|
1005 |
] ifTrue:[ |
|
2834 | 1006 |
aList size == 0 ifTrue:[ |
1007 |
"/ keep old column-width information |
|
1008 |
] ifFalse:[ |
|
2524 | 1009 |
columnDescriptors notNil ifTrue:[ |
1010 |
columnDescriptors do:[:aCol| aCol invalidate ]. |
|
1011 |
]. |
|
612 | 1012 |
preferredExtent := nil. |
618 | 1013 |
] |
542 | 1014 |
]. |
1015 |
||
2836 | 1016 |
beDependentOfRows ifTrue:[ |
1017 |
self makeIndependentOfRows |
|
656 | 1018 |
]. |
643 | 1019 |
|
2834 | 1020 |
aList size == 0 ifTrue:[ |
1948
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1021 |
list := nil. |
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1022 |
viewOrigin := 0 @ 0. |
2834 | 1023 |
] ifFalse:[ |
1024 |
list := OrderedCollection withAll:aList. |
|
1025 |
"/ list := OrderedCollection new:(aList size). |
|
1026 |
"/ aList do:[:el| list add:el ]. |
|
2836 | 1027 |
beDependentOfRows ifTrue:[ |
1028 |
self makeDependentOfRows |
|
1029 |
]. |
|
542 | 1030 |
]. |
1031 |
||
612 | 1032 |
shown ifTrue:[ |
1484 | 1033 |
self fitColumns |
1949 | 1034 |
] ifFalse:[ |
1035 |
needFitColumns := true |
|
637 | 1036 |
]. |
1259 | 1037 |
selectionHasChanged ifTrue:[ |
1038 |
self selectionChanged. |
|
1039 |
]. |
|
2044
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
1040 |
self contentsChanged. |
542 | 1041 |
! ! |
1042 |
||
1818 | 1043 |
!DSVColumnView methodsFor:'accessing-visibility'! |
542 | 1044 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1045 |
font:aFont |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1046 |
"set the font for all shown rows." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1047 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1048 |
(aFont notNil and:[ aFont ~~ font ]) ifTrue:[ |
1480 | 1049 |
super font:(aFont onDevice:device). |
542 | 1050 |
realized ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1051 |
columnDescriptors do:[:aCol | |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1052 |
aCol invalidate |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1053 |
]. |
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1054 |
self preferredExtentChanged. |
542 | 1055 |
self invalidate. |
1056 |
self contentsChanged |
|
1842 | 1057 |
]. |
1058 |
labelView notNil ifTrue:[ |
|
1059 |
labelView font:font |
|
1060 |
]. |
|
542 | 1061 |
] |
1062 |
! |
|
1063 |
||
607 | 1064 |
has3Dseparators |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1065 |
"returns true if shown in 3D mode" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1066 |
|
607 | 1067 |
^ separatorSize ~~ 1 |
542 | 1068 |
! |
1069 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1070 |
has3Dseparators:aBool |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1071 |
"enable or disable 3D mode" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1072 |
|
607 | 1073 |
|newSepSize| |
542 | 1074 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1075 |
newSepSize := aBool ifTrue:2 ifFalse:1. |
607 | 1076 |
newSepSize ~~ separatorSize ifTrue:[ |
1077 |
separatorSize := newSepSize. |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1078 |
realized ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1079 |
columnDescriptors do:[:aCol | |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1080 |
aCol invalidate |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1081 |
]. |
1136 | 1082 |
self preferredExtentChanged. |
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1083 |
self invalidate. |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1084 |
self contentsChanged |
647 | 1085 |
] |
542 | 1086 |
] |
1087 |
! |
|
1088 |
||
1089 |
horizontalSpacing |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1090 |
"horizontal spacing used by columns" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1091 |
|
563 | 1092 |
^ horizontalSpacing |
1093 |
! |
|
1094 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1095 |
horizontalSpacing:aNumber |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1096 |
"horizontal spacing used by columns" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1097 |
|
563 | 1098 |
horizontalSpacing ~~ aNumber ifTrue:[ |
1099 |
horizontalSpacing := aNumber. |
|
1100 |
self preferredExtentChanged. |
|
1101 |
]. |
|
542 | 1102 |
! |
1103 |
||
1487 | 1104 |
showLabels |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1105 |
"control the labels view to be visible or unvisible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1106 |
|
1487 | 1107 |
^ labelView isVisible |
1108 |
! |
|
1109 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1110 |
showLabels:aState |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1111 |
"control the labels view to be visible or unvisible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1112 |
|
1487 | 1113 |
labelView isVisible:aState |
1114 |
! |
|
1115 |
||
542 | 1116 |
verticalSpacing |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1117 |
"vertical spacing used by columns" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1118 |
|
563 | 1119 |
^ verticalSpacing |
1120 |
! |
|
1121 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1122 |
verticalSpacing:aNumber |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1123 |
"vertical spacing used by columns" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1124 |
|
563 | 1125 |
verticalSpacing ~~ aNumber ifTrue:[ |
1126 |
verticalSpacing := aNumber. |
|
1127 |
self preferredExtentChanged. |
|
1128 |
]. |
|
542 | 1129 |
! ! |
1130 |
||
1131 |
!DSVColumnView methodsFor:'adding & removing rows'! |
|
1132 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1133 |
add:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1134 |
"insert row at end" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1135 |
|
1497 | 1136 |
^ self add:aRow beforeIndex:(1 + list size) |
542 | 1137 |
! |
1138 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1139 |
add:aRow afterIndex:aRowNr |
542 | 1140 |
"add a new row after slot aRowNr and redisplay; returns nil in case |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1141 |
of an invalid index or the row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1142 |
|
542 | 1143 |
^ self add:aRow beforeIndex:(aRowNr + 1) |
1144 |
! |
|
1145 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1146 |
add:aRow beforeIndex:aRowNr |
542 | 1147 |
"add a new row before slot aRowNr and redisplay; returns nil in case |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1148 |
of an invalid index or the row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1149 |
|
861 | 1150 |
self addAll:(Array with:aRow) beforeIndex:aRowNr. |
1151 |
^ aRow. |
|
1152 |
! |
|
1153 |
||
1154 |
addAll:aList beforeIndex:start |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1155 |
"add a collection of rows before slot start and redisplay" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1156 |
|
861 | 1157 |
|y0 y1 yD h dH size noSel| |
1158 |
||
1159 |
(size := aList size) == 0 ifTrue:[ |
|
1160 |
^ self |
|
1161 |
]. |
|
1162 |
||
2834 | 1163 |
list isNil ifTrue:[ |
1164 |
self list:aList. |
|
1165 |
^ self |
|
618 | 1166 |
]. |
2834 | 1167 |
"/ cg: disabled - to keep old list. |
1168 |
"/ list size == 0 ifTrue:[ |
|
1169 |
"/ self list:aList. |
|
1170 |
"/ ^ self |
|
1171 |
"/ ]. |
|
643 | 1172 |
|
618 | 1173 |
beDependentOfRows ifTrue:[ |
861 | 1174 |
aList do:[:aRow| aRow notNil ifTrue:[aRow addDependent:self]] |
542 | 1175 |
]. |
637 | 1176 |
|
861 | 1177 |
noSel := self numberOfSelections. |
1178 |
||
1179 |
noSel ~~ 0 ifTrue:[ |
|
1180 |
multipleSelectOk ifFalse:[ |
|
1181 |
selectedRowIndex >= start ifTrue:[ |
|
1182 |
selectedRowIndex := selectedRowIndex + size |
|
1183 |
] |
|
1184 |
] ifTrue:[ |
|
1185 |
1 to:noSel do:[:i||v| |
|
1186 |
(v := selectedRowIndex at:i) >= start ifTrue:[ |
|
1187 |
selectedRowIndex at:i put:(v + size) |
|
607 | 1188 |
] |
1189 |
] |
|
1190 |
] |
|
542 | 1191 |
]. |
861 | 1192 |
list addAll:aList beforeIndex:start. |
1193 |
self recomputeHeightOfContents. |
|
1194 |
||
1195 |
y0 := (start - 1) * rowHeight. |
|
1196 |
yD := size * rowHeight. |
|
1197 |
y1 := y0 + yD. |
|
542 | 1198 |
|
1199 |
y0 < viewOrigin y ifTrue:[ |
|
1200 |
self originWillChange. |
|
1948
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1201 |
viewOrigin := viewOrigin x @ (yD + viewOrigin y). |
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1202 |
"/ viewOrigin y:(yD + viewOrigin y). |
861 | 1203 |
self originChanged:(0 @ yD). |
1204 |
]. |
|
1205 |
||
1206 |
(shown not or:[self sensor hasDamageFor:self]) ifTrue:[ |
|
2044
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
1207 |
self invalidate. |
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
1208 |
self contentsChanged. |
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
1209 |
^ self |
542 | 1210 |
]. |
645
53c78cc2ee08
redraw twice in case of expose event during adding a new entry
ca
parents:
643
diff
changeset
|
1211 |
|
861 | 1212 |
y0 := self yVisibleOfRowNr:start. |
1258 | 1213 |
h := height - margin. |
1214 |
y1 := y0 + yD min:h. |
|
1215 |
||
1216 |
(y1 > margin and:[y0 < h]) ifTrue:[ |
|
1952 | 1217 |
"/ cg: if I have a non-solid background color, |
1218 |
"/ or individual items have a bgColor selector, |
|
1219 |
"/ invalidate the area (and readraw) instead of a scroll. |
|
1220 |
(viewBackground isImageOrForm |
|
1221 |
or:[ self anyColumnHasPotentialNonConstantBackground ]) |
|
1222 |
ifTrue:[ |
|
1223 |
"/ do not scroll but invalidate ... |
|
1224 |
self invalidateX:margin y:y0 width:width - margin - margin height:(height - y0). |
|
1225 |
] ifFalse:[ |
|
1226 |
h := h - y1. |
|
1227 |
y0 := y0 max:margin. |
|
1228 |
dH := y1 - y0. |
|
1229 |
||
1230 |
start == list size ifFalse:[ |
|
1231 |
self copyFrom:self x:0 y:y0 toX:0 y:y1 width:width height:h async:false |
|
1232 |
]. |
|
1233 |
self invalidateX:margin y:y0 width:width - margin - margin height:dH. |
|
1234 |
] |
|
542 | 1235 |
]. |
1236 |
self contentsChanged. |
|
567 | 1237 |
! |
1238 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1239 |
addFirst:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1240 |
"insert a row at start" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1241 |
|
542 | 1242 |
^ self add:aRow beforeIndex:1 |
1243 |
! |
|
1244 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1245 |
remove:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1246 |
"remove a row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1247 |
|
1487 | 1248 |
|idx| |
1249 |
||
1250 |
idx := list identityIndexOf:aRow. |
|
1251 |
idx ~~ 0 ifTrue:[ |
|
1252 |
self removeFrom:idx to:idx. |
|
1253 |
]. |
|
1254 |
^ aRow |
|
1255 |
! |
|
1256 |
||
542 | 1257 |
removeFirst |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1258 |
"remove first row; returns the removed row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1259 |
|
1112 | 1260 |
^ self removeIndex:1 |
542 | 1261 |
! |
1262 |
||
861 | 1263 |
removeFrom:startIndex to:stopIndex |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1264 |
"remove rows from start to stop" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1265 |
|
861 | 1266 |
|coll noRedraw |
1267 |
noSel "{ Class: SmallInteger }" |
|
1268 |
size "{ Class: SmallInteger }" |
|
1269 |
start "{ Class: SmallInteger }" |
|
1270 |
stop "{ Class: SmallInteger }" |
|
1271 |
y0 "{ Class: SmallInteger }" |
|
1272 |
y1 "{ Class: SmallInteger }" |
|
1273 |
oY "{ Class: SmallInteger }" |
|
1274 |
dY "{ Class: SmallInteger }" |
|
1275 |
yB "{ Class: SmallInteger }" |
|
1276 |
h "{ Class: SmallInteger }" |
|
1277 |
| |
|
1278 |
||
1279 |
( (start := startIndex) < 1 |
|
1280 |
or:[(stop := stopIndex) > list size] |
|
1281 |
) ifTrue:[ |
|
1282 |
^ self subscriptBoundsError:start |
|
618 | 1283 |
]. |
861 | 1284 |
size := stop - start + 1. |
1285 |
||
1286 |
beDependentOfRows ifTrue:[ |
|
1287 |
list from:start to:stop do:[:r| r notNil ifTrue:[r removeDependent:self]]. |
|
1288 |
]. |
|
1289 |
noSel := self numberOfSelections. |
|
1290 |
||
1291 |
noSel ~~ 0 ifTrue:[ |
|
1292 |
noSel == 1 ifTrue:[ |
|
1293 |
noSel := self firstIndexSelected. |
|
1294 |
||
1295 |
noSel < start ifFalse:[ |
|
1296 |
noSel > stop ifTrue:[ |
|
1297 |
noSel := noSel - size. |
|
1298 |
||
1299 |
multipleSelectOk ifFalse:[selectedRowIndex := noSel] |
|
1300 |
ifTrue:[selectedRowIndex at:1 put:noSel] |
|
1301 |
] ifFalse:[ |
|
637 | 1302 |
editValue notNil ifTrue:[ |
1303 |
editValue removeDependent:self. |
|
1304 |
editValue := nil. |
|
1305 |
]. |
|
861 | 1306 |
self deselect. |
637 | 1307 |
] |
607 | 1308 |
] |
1309 |
] ifFalse:[ |
|
861 | 1310 |
coll := OrderedCollection new:noSel. |
1311 |
||
1312 |
selectedRowIndex do:[:i| |
|
1313 |
i < start ifTrue:[ |
|
1314 |
coll add:i |
|
1315 |
] ifFalse:[ |
|
1316 |
i > stop ifTrue:[ |
|
1317 |
coll add:(i - size) |
|
1318 |
] |
|
1319 |
] |
|
1320 |
]. |
|
1321 |
coll size == 0 ifTrue:[ |
|
1322 |
self deselect |
|
1323 |
] ifFalse:[ |
|
1324 |
selectedRowIndex := coll |
|
1325 |
] |
|
542 | 1326 |
] |
1327 |
]. |
|
861 | 1328 |
list removeFrom:start to:stop. |
1329 |
||
1330 |
y0 := start - 1 * rowHeight. |
|
1331 |
dY := size * rowHeight. |
|
1332 |
y1 := dY + y0. |
|
542 | 1333 |
yB := y1 + margin - viewOrigin y. |
1334 |
self recomputeHeightOfContents. |
|
1335 |
||
1336 |
y0 < (oY := viewOrigin y) ifTrue:[ |
|
1337 |
(noRedraw := y1 <= oY) ifFalse:[dY := y0 - oY] |
|
861 | 1338 |
ifTrue:[dY := dY negated]. |
542 | 1339 |
self originWillChange. |
1948
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1340 |
viewOrigin := viewOrigin x @ (dY + oY). |
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
1341 |
"/ viewOrigin y:(dY + oY). |
542 | 1342 |
self originChanged:(0 @ dY). |
1343 |
] ifFalse:[ |
|
1344 |
noRedraw := y0 > (height + viewOrigin y) |
|
1345 |
]. |
|
1346 |
||
1483 | 1347 |
(shown not or:[self sensor hasDamageFor:self]) ifTrue:[ |
1348 |
self invalidate. |
|
1349 |
^ self contentsChanged. |
|
1350 |
]. |
|
1351 |
||
542 | 1352 |
(noRedraw or:[shown not]) ifFalse:[ |
861 | 1353 |
y0 := self yVisibleOfRowNr:start. |
542 | 1354 |
y0 := y0 max:margin. |
1355 |
||
1951 | 1356 |
"/ cg: if I have a non-solid background color, |
1357 |
"/ or individual items have a bgColor selector, |
|
1358 |
"/ invalidate the area (and readraw) instead of a scroll. |
|
1359 |
(viewBackground isImageOrForm |
|
1360 |
or:[ self anyColumnHasPotentialNonConstantBackground ]) |
|
1361 |
ifTrue:[ |
|
1362 |
"/ do not scroll but invalidate ... |
|
1363 |
] ifFalse:[ |
|
1364 |
y1 := yB. |
|
1365 |
h := height - margin - yB. |
|
1366 |
||
1367 |
h > 0 ifTrue:[ |
|
1368 |
self copyFrom:self x:0 y:yB toX:0 y:y0 width:width height:h async:false |
|
1369 |
]. |
|
1370 |
y0 := y0 + h. |
|
561 | 1371 |
]. |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1372 |
self invalidateX:margin y:y0 width:width - margin - margin height:(height - y0). |
542 | 1373 |
]. |
1374 |
self contentsChanged. |
|
861 | 1375 |
! |
1376 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1377 |
removeIndex:aRowNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1378 |
"remove row at an index; returns the removed row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1379 |
|
861 | 1380 |
|row| |
1381 |
||
1382 |
row := list at:aRowNr ifAbsent:nil. |
|
1383 |
self removeFrom:aRowNr to:aRowNr. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1384 |
^ row |
542 | 1385 |
! |
1386 |
||
1387 |
removeLast |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1388 |
"remove last row; the row is returned" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1389 |
|
1497 | 1390 |
^ self removeIndex:(list size) |
1956 | 1391 |
! |
1392 |
||
1393 |
replaceFrom:start to:stop with:aCollection startingAt:repStart |
|
1394 |
"replace elements in the receiver between index start and stop, |
|
1395 |
with elements taken from replacementCollection starting at repStart. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1396 |
Return the receiver." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1397 |
|
2032 | 1398 |
|inSelList listSize repStop run| |
1956 | 1399 |
|
1400 |
inSelList := OrderedCollection new. |
|
1401 |
listSize := list size. |
|
1402 |
repStop := repStart + (stop - start). |
|
1403 |
||
1404 |
list isNil ifTrue:[ |
|
1405 |
list := OrderedCollection new |
|
1406 |
]. |
|
1407 |
||
1408 |
[listSize < stop] whileTrue:[ list add:nil. listSize := listSize + 1 ]. |
|
1409 |
||
1410 |
start to:stop do:[:i| |aRow| |
|
1411 |
aRow := list at:i ifAbsent:nil. |
|
1412 |
||
1413 |
aRow notNil ifTrue:[ |
|
1414 |
beDependentOfRows ifTrue:[aRow removeDependent:self]. |
|
1415 |
||
1416 |
(self isInSelection:i) ifTrue:[ |
|
1417 |
inSelList add:i |
|
1418 |
]. |
|
1419 |
list at:i put:nil. |
|
1420 |
] |
|
1421 |
]. |
|
1422 |
||
1423 |
beDependentOfRows ifTrue:[ |
|
1424 |
aCollection from:repStart to:repStop do:[:aRow| |
|
1425 |
aRow notNil ifTrue:[aRow addDependent:self] |
|
1426 |
] |
|
1427 |
]. |
|
1428 |
||
1429 |
run := start. |
|
1430 |
aCollection from:repStart to:repStop do:[:aRow| |
|
1431 |
list at:run put:aRow. |
|
1432 |
run := run + 1. |
|
1433 |
]. |
|
1434 |
self invalidateRowsFrom:start to:stop. |
|
1435 |
||
1436 |
inSelList size ~~ 0 ifTrue:[ |
|
1437 |
self numberOfSelections == inSelList size ifTrue:[ |
|
1438 |
self deselect |
|
1439 |
] ifFalse:[ |
|
1440 |
selectedRowIndex := selectedRowIndex select:[:i| (inSelList identityIndexOf:i) == 0 ]. |
|
1441 |
self selectionChanged. |
|
1442 |
] |
|
1443 |
]. |
|
542 | 1444 |
! ! |
1445 |
||
1446 |
!DSVColumnView methodsFor:'change & update'! |
|
1447 |
||
1492 | 1448 |
changeWidthOfColumn:aColumn deltaX:aDeltaX |
1449 |
||
1450 |
aColumn setDescWidth:(aColumn width + aDeltaX). |
|
1451 |
preferredExtent notNil ifTrue:[self fitColumns] |
|
1452 |
! |
|
1453 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1454 |
update:what with:aPara from:chgObj |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1455 |
"one of my rows/cells changed its value" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1456 |
|
2695 | 1457 |
|row listHoldersList arg1 arg2 col| |
1487 | 1458 |
|
1459 |
chgObj == columnHolder ifTrue:[ |
|
2776 | 1460 |
self columnDescriptors:(columnHolder value). |
1461 |
^ self. |
|
622 | 1462 |
]. |
1711 | 1463 |
chgObj == columnAdaptor ifTrue:[ |
1464 |
col := columnAdaptor value. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1465 |
columnDescriptors do:[:aCol | |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1466 |
aCol columnAdaptor:col |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1467 |
]. |
2776 | 1468 |
self invalidate. |
1469 |
^ self |
|
1711 | 1470 |
]. |
1487 | 1471 |
chgObj == editValue ifTrue:[ |
2695 | 1472 |
self updateColumnFromEditValue. |
1227 | 1473 |
^ self |
622 | 1474 |
]. |
1487 | 1475 |
chgObj == model ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1476 |
(what == #selectionIndex or:[ what == #selection ]) ifTrue:[ |
2776 | 1477 |
self selectRowIndex:(model selectionIndex copy). |
1478 |
^ self. |
|
1487 | 1479 |
]. |
1480 |
what == #list ifTrue:[ |
|
2776 | 1481 |
self listHolder:model list. |
1482 |
^ self. |
|
1487 | 1483 |
]. |
1484 |
what == #value ifTrue:[ |
|
1485 |
model == listHolder ifTrue:[ |
|
1486 |
self list:(listHolder value) |
|
1487 |
] ifFalse:[ |
|
1488 |
self selectRowIndex:model value |
|
2776 | 1489 |
]. |
1490 |
^ self |
|
1487 | 1491 |
]. |
1492 |
^ self |
|
1493 |
]. |
|
1494 |
chgObj == listHolder ifTrue:[ |
|
1953
9190339e9fad
lost dependents in row bug fix (when changing lists contents with #contents:)
Claus Gittinger <cg@exept.de>
parents:
1952
diff
changeset
|
1495 |
listHoldersList := listHolder value. |
1487 | 1496 |
what == #value ifTrue:[ |
2776 | 1497 |
self list:listHoldersList. ^ self. |
1487 | 1498 |
]. |
1499 |
aPara isCollection ifTrue:[ |
|
1500 |
arg1 := aPara at:1. |
|
1501 |
arg2 := aPara at:2. |
|
1502 |
] ifFalse:[ |
|
1503 |
arg1 := arg2 := aPara |
|
1504 |
]. |
|
1505 |
what == #at: ifTrue:[ |
|
2776 | 1506 |
self at:arg1 put:(listHoldersList at:arg1). |
1507 |
^ self. |
|
1487 | 1508 |
]. |
1509 |
what == #insert: ifTrue:[ |
|
2776 | 1510 |
self add:(listHoldersList at:arg1) beforeIndex:arg1. |
1511 |
^ self. |
|
1487 | 1512 |
]. |
1513 |
what == #remove: ifTrue:[ |
|
2776 | 1514 |
self removeFrom:arg1 to:arg1. |
1515 |
^ self. |
|
1487 | 1516 |
]. |
1517 |
what == #removeFrom: ifTrue:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1518 |
listHoldersList size == 0 ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1519 |
self list:nil |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1520 |
] ifFalse:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1521 |
self removeFrom:arg1 to:arg2 |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1522 |
]. |
1487 | 1523 |
^ self |
1524 |
]. |
|
1525 |
what == #insertCollection: ifTrue:[ |
|
1526 |
arg2 ~~ 0 ifTrue:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1527 |
self addAll:(listHoldersList copyFrom:arg1 to:(arg1 + arg2 - 1)) |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1528 |
beforeIndex:arg1 |
1487 | 1529 |
]. |
1530 |
^ self. |
|
1531 |
]. |
|
1532 |
what == #replace: ifTrue:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1533 |
self |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1534 |
replaceFrom:arg1 |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1535 |
to:arg2 |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1536 |
with:listHoldersList |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1537 |
startingAt:arg1. |
2537 | 1538 |
^ self |
1487 | 1539 |
]. |
2537 | 1540 |
self list:listHoldersList. |
1487 | 1541 |
^ self |
1542 |
]. |
|
1593 | 1543 |
arg1 := aPara ? what. |
2816 | 1544 |
row := (what isNumber) ifTrue:[what] ifFalse:[chgObj]. |
2190 | 1545 |
self invalidateVisibleRow:row readSelector:arg1. |
2695 | 1546 |
editView notNil ifTrue:[ |
1547 |
(self isInSelection:(self identityIndexOfRow:row)) ifTrue:[ |
|
1548 |
self updateEditorFromChangedRow |
|
1549 |
] |
|
1550 |
]. |
|
1551 |
||
1661 | 1552 |
"Modified: / 30.1.2000 / 12:16:49 / cg" |
2695 | 1553 |
! |
1554 |
||
1555 |
updateColumnFromEditValue |
|
1556 |
|editValueBefore firstSelectedIndex newValue realValue col| |
|
1557 |
||
1558 |
editValueBefore := editValue. |
|
1559 |
||
1560 |
firstSelectedIndex := self firstIndexSelected. |
|
1561 |
newValue := editValue value. |
|
1562 |
||
1563 |
col := self selectedColumn. |
|
1564 |
col at:firstSelectedIndex put:newValue. |
|
1565 |
realValue := col at:firstSelectedIndex. |
|
1566 |
||
1567 |
(realValue ~= newValue) ifTrue:[ |
|
1568 |
"/ some validation by the row-object; the stored value |
|
1569 |
"/ is different from what I think. |
|
1570 |
"/ update my input fields modelValue |
|
1571 |
||
1572 |
"/ just in case someone nilled or changed the editValue |
|
1573 |
"/ Q: is this CA's paranoia or could this really be done in the at:put: above ??? |
|
1574 |
(editValueBefore == editValue) ifTrue:[ |
|
1575 |
editValue value:realValue. |
|
1576 |
] |
|
1577 |
]. |
|
1578 |
||
1579 |
modifiedChannel notNil ifTrue:[ |
|
1580 |
modifiedChannel value:true. |
|
1581 |
]. |
|
1582 |
! |
|
1583 |
||
1584 |
updateEditorFromChangedRow |
|
1585 |
|rowsValue rowNr| |
|
1586 |
||
1587 |
(rowNr := selectedRowIndex) isNumber ifFalse:[ |
|
1588 |
rowNr := rowNr first. |
|
1589 |
]. |
|
1590 |
rowsValue := (self columnAt:selectedColIndex) at:rowNr. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1591 |
(editValue notNil and:[ editValue value ~= rowsValue ]) ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1592 |
editValue value:rowsValue withoutNotifying:self. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1593 |
editView |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1594 |
withAllSubViewsDo:[:v | |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1595 |
v isInputField ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1596 |
v flash. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1597 |
] |
2695 | 1598 |
] |
2702 | 1599 |
]. |
809 | 1600 |
! ! |
1601 |
||
1602 |
!DSVColumnView methodsFor:'drag & drop'! |
|
1603 |
||
824 | 1604 |
canDrag |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1605 |
"returns true if dragging is enabled" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1606 |
|
824 | 1607 |
^ dropSource notNil |
1608 |
! |
|
1609 |
||
2575 | 1610 |
dragAutoScroll:aContext |
1611 |
"called by the DragAndDropManager to scroll during a drag/drop operation |
|
1612 |
if necassery (decided by the widget itself); If a scroll is done return |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1613 |
true otherwise false (used to restore the background)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1614 |
|
2575 | 1615 |
|yInset absLnNr y| |
1616 |
||
1617 |
y := aContext targetPoint y. |
|
1618 |
yInset := margin + rowHeight. |
|
1619 |
y > yInset ifTrue:[ |
|
1620 |
y >= (height - yInset) ifFalse:[^ false]. |
|
1621 |
]. |
|
1622 |
||
1623 |
absLnNr := self yVisibleToRowNr:y. |
|
1624 |
absLnNr isNil ifTrue:[^ false]. |
|
1625 |
||
1626 |
(absLnNr > 1 and:[absLnNr < self size]) ifFalse:[ |
|
1627 |
^ false |
|
1628 |
]. |
|
1629 |
aContext contentsWillChange. |
|
1630 |
||
2580 | 1631 |
y > yInset |
1632 |
ifTrue:[self scrollDown:rowHeight] |
|
1633 |
ifFalse:[self scrollUp:rowHeight]. |
|
2575 | 1634 |
|
1635 |
^ true |
|
1636 |
! |
|
1637 |
||
824 | 1638 |
dropSource |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1639 |
"returns the dropSource or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1640 |
|
824 | 1641 |
^ dropSource |
1642 |
! |
|
1643 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1644 |
dropSource:aDropSourceOrNil |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1645 |
"set the dropSource or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1646 |
|
824 | 1647 |
dropSource := aDropSourceOrNil. |
809 | 1648 |
! |
1649 |
||
824 | 1650 |
startDragAt:aPoint |
2398 | 1651 |
|
1652 |
dropSource notNil ifTrue:[ |
|
1653 |
dropSource startDragIn:self at:aPoint. |
|
1654 |
buttonReleaseAction := buttonMotionAction := nil. |
|
809 | 1655 |
] |
542 | 1656 |
! ! |
1657 |
||
637 | 1658 |
!DSVColumnView methodsFor:'drawing'! |
1659 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1660 |
colorOnDevice:aColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1661 |
"returns color on device" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1662 |
|
637 | 1663 |
|col| |
1664 |
||
641 | 1665 |
aColor = Color noColor ifFalse:[ |
1666 |
col := colorMap at:aColor ifAbsent:nil. |
|
1667 |
col isNil ifTrue:[ |
|
1480 | 1668 |
colorMap at:aColor put:(col := aColor onDevice:device) |
641 | 1669 |
]. |
1670 |
^ col |
|
637 | 1671 |
]. |
641 | 1672 |
^ bgColor |
637 | 1673 |
! |
1674 |
||
1675 |
forceRedraw |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1676 |
"a redraw forced by any other component" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1677 |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1678 |
shown ifTrue:[ |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1679 |
self invalidate |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1680 |
] |
637 | 1681 |
! |
1682 |
||
1683 |
invalidate |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1684 |
"recompute extent before repair range" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1685 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1686 |
self recomputeHeightOfContents. |
637 | 1687 |
super invalidate. |
1688 |
! |
|
1689 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1690 |
invalidateRowAt:aRowNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1691 |
"redraw total row at an index" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1692 |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1693 |
self invalidateRowAt:aRowNr colAt:0 |
637 | 1694 |
! |
1695 |
||
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1696 |
invalidateRowAt:aRowNr colAt:aColNr |
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1697 |
"redraw either a single column in a row, |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1698 |
or the complete visible row (in case of aColNr == 0). |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1699 |
If the row/column is hidden, no redraw is done" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1700 |
|
1497 | 1701 |
|x "{ Class:SmallInteger }" |
1702 |
y "{ Class:SmallInteger }" |
|
1703 |
h "{ Class:SmallInteger }" |
|
1704 |
w "{ Class:SmallInteger }" |
|
2523
a7d71e57632f
care for non-existing column
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
1705 |
col| |
1497 | 1706 |
|
1707 |
(shown and:[aRowNr notNil and:[aRowNr between:1 and:list size]]) ifTrue:[ |
|
1131 | 1708 |
h := rowHeight. |
1497 | 1709 |
y := self yVisibleOfRowNr:aRowNr. |
1710 |
||
1711 |
y < margin ifTrue:[ |
|
637 | 1712 |
(h := h + y) <= margin ifTrue:[ |
1713 |
^ self |
|
1714 |
]. "/ row not visible |
|
1715 |
h := h - margin. |
|
1716 |
y := margin. |
|
1717 |
] ifFalse:[ |
|
1718 |
y >= height ifTrue:[^ self]. |
|
1719 |
]. |
|
1720 |
aColNr ~~ 0 ifTrue:[ "/ redraw column in row |
|
2523
a7d71e57632f
care for non-existing column
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
1721 |
col := (self columnAt:aColNr). |
a7d71e57632f
care for non-existing column
Claus Gittinger <cg@exept.de>
parents:
2500
diff
changeset
|
1722 |
w := col isNil ifTrue:0 ifFalse:[col width]. |
1497 | 1723 |
x := self xVisibleOfColNr:aColNr. |
1724 |
||
1725 |
x < margin ifTrue:[ |
|
637 | 1726 |
(w := w + x) <= margin ifTrue:[ |
1727 |
^ self |
|
1728 |
]. "/ column not visible |
|
1729 |
w := w - margin. |
|
1730 |
x := margin. |
|
1731 |
] ifFalse:[ |
|
1732 |
x >= width ifTrue:[^ self]. |
|
1733 |
] |
|
1734 |
] ifFalse:[ "/ redraw whole row |
|
1735 |
x := margin. |
|
1736 |
w := width. |
|
1737 |
]. |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1738 |
self invalidateX:x y:y width:w height:h |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1739 |
] |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1740 |
! |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1741 |
|
2469
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1742 |
invalidateRows:aCollection |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1743 |
"redraw some visible rows" |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1744 |
|
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1745 |
shown ifTrue:[ |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1746 |
aCollection do:[:rowIndex | |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1747 |
self invalidateRowAt:rowIndex |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1748 |
] |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1749 |
] |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1750 |
! |
a6e3ffd6df94
Avoid duplicate computations (sv, cg)
Stefan Vogel <sv@exept.de>
parents:
2458
diff
changeset
|
1751 |
|
1956 | 1752 |
invalidateRowsFrom:aStart to:aStop |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1753 |
"redraw visible row from start to stop" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1754 |
|
1956 | 1755 |
|size start stop y0 y1| |
1756 |
||
1757 |
shown ifTrue:[ |
|
1758 |
size := list size. |
|
1759 |
start := aStart notNil ifTrue:[aStart max:1] ifFalse:[1]. |
|
1760 |
stop := aStop notNil ifTrue:[aStop min:size] ifFalse:[size]. |
|
1761 |
||
1762 |
start <= stop ifTrue:[ |
|
1763 |
y0 := (self yVisibleOfRowNr:start) max:margin. |
|
1764 |
y1 := ((self yVisibleOfRowNr:stop) + rowHeight) min:height. |
|
1765 |
||
1766 |
y0 < y1 ifTrue:[ |
|
1767 |
self invalidateX:margin y:y0 width:width height:(y1 - y0) |
|
1768 |
] |
|
1769 |
] |
|
1770 |
] |
|
1771 |
! |
|
1772 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1773 |
invalidateVisibleRow:aRow |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1774 |
"redraw row if visible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1775 |
|
2190 | 1776 |
self invalidateVisibleRow:aRow colAt:0 |
809 | 1777 |
! |
1778 |
||
2190 | 1779 |
invalidateVisibleRow:aRow colAt:aColNr |
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1780 |
"redraw either a single column in a row, |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1781 |
or the complete visible row (in case of aColNr == 0). |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1782 |
If the row/column is hidden, no redraw is done" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1783 |
|
637 | 1784 |
|start "{ Class:SmallInteger }" |
1785 |
stop "{ Class:SmallInteger }" |
|
1786 |
| |
|
1787 |
||
1788 |
(start := self indexOfFirstRowShown) ~~ 0 ifTrue:[ |
|
1497 | 1789 |
stop := (start + (height // rowHeight)) min:(list size). |
637 | 1790 |
|
1791 |
aRow isNumber ifTrue:[ |
|
1792 |
(aRow between:start and:stop) ifTrue:[ |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1793 |
self invalidateRowAt:aRow colAt:aColNr |
637 | 1794 |
] |
1795 |
] ifFalse:[ |
|
1796 |
start to:stop do:[:i| |
|
1797 |
(self at:i) == aRow ifTrue:[ |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
1798 |
^ self invalidateRowAt:i colAt:aColNr |
637 | 1799 |
] |
1800 |
] |
|
1801 |
] |
|
1802 |
] |
|
809 | 1803 |
! |
1804 |
||
2190 | 1805 |
invalidateVisibleRow:aRow readSelector:aSelector |
809 | 1806 |
"redraw a column identified by its read selector; if no column with |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1807 |
the specified read selector is detected, the whole line is drawn." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1808 |
|
809 | 1809 |
|row idx| |
1810 |
||
1811 |
aSelector isNil ifTrue:[ |
|
1812 |
idx := 0 |
|
1813 |
] ifFalse:[ |
|
1814 |
(row := aRow) isNumber ifTrue:[ |
|
1815 |
(row := self at:aRow) isNil ifTrue:[ ^ self ] |
|
1816 |
]. |
|
1817 |
idx := columnDescriptors findFirst:[:aCol||desc| |
|
1818 |
aCol description readSelector == aSelector |
|
1819 |
] |
|
1820 |
]. |
|
2190 | 1821 |
self invalidateVisibleRow:aRow colAt:idx |
637 | 1822 |
! |
1823 |
||
1824 |
redrawX:x y:y width:w height:h |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1825 |
"redraw part of myself immediately, given logical coordinates " |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1826 |
|
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1827 |
|c0 savClip stopRedraw |
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1828 |
start "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1829 |
stop "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1830 |
x0 "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1831 |
x1 "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1832 |
maxX "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1833 |
yTop "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1834 |
yBot "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1835 |
clHg "{ Class:SmallInteger }" |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1836 |
size "{ Class:SmallInteger }" |
637 | 1837 |
| |
1838 |
||
1839 |
shown ifFalse:[^ self]. |
|
1840 |
self paint:bgColor. |
|
1115 | 1841 |
|
1842 |
columnDescriptors isEmpty ifTrue:[ |
|
1843 |
^ self fillRectangleX:x y:y width:w height:h |
|
1844 |
]. |
|
1131 | 1845 |
size := list size. |
1115 | 1846 |
yTop := margin - viewOrigin y. |
1847 |
c0 := y - yTop max:0. |
|
1848 |
start := (c0 // rowHeight) + 1. |
|
1131 | 1849 |
stop := (c0 + h - 1 // rowHeight + 1) min:size. |
1115 | 1850 |
|
1851 |
stop < start ifTrue:[ |
|
1852 |
^ self fillRectangleX:x y:y width:w height:h |
|
1853 |
]. |
|
1854 |
savClip := clipRect. |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1855 |
|
1115 | 1856 |
maxX := (x + w) min:(width - margin). |
1857 |
x0 := margin - viewOrigin x. |
|
1858 |
yTop := yTop + ((start - 1) * rowHeight). |
|
1131 | 1859 |
clHg := (stop - start + 1) * rowHeight. |
1860 |
yBot := yTop + clHg. |
|
1861 |
||
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1862 |
stopRedraw := false. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1863 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1864 |
self class stopRedrawSignal handle:[:ex| |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1865 |
stopRedraw := true. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1866 |
] do:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1867 |
columnDescriptors do:[:aCol| |cw| |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1868 |
x1 := x0 + aCol width. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1869 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1870 |
(x1 > x and:[x0 < maxX]) ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1871 |
|left right rect| |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1872 |
left := x0 max:x. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1873 |
right := x1 min:maxX. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1874 |
rect := Rectangle left:left top:y width:(right - left) height:h. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1875 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1876 |
clipRect := nil. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1877 |
self clippingRectangle:rect. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1878 |
aCol redrawX:x0 y:yTop h:clHg from:start to:stop. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1879 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1880 |
x0 := x1 |
1115 | 1881 |
]. |
1882 |
]. |
|
1131 | 1883 |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1884 |
"/ restore old clipping rectangle |
1115 | 1885 |
self clippingRectangle:savClip. |
1131 | 1886 |
|
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1887 |
stopRedraw ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1888 |
self invalidate. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1889 |
self makeSelectionVisible. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1890 |
^ self |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1891 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1892 |
|
1131 | 1893 |
stop == size ifTrue:[ |
1115 | 1894 |
yTop := y + h. |
1895 |
yBot < (yTop - margin) ifTrue:[ |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1896 |
"/ clear to bottom of screen |
1115 | 1897 |
self paint:bgColor. |
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1898 |
self fillRectangleX:x y:yBot width:w height:(yTop - yBot). |
1112 | 1899 |
] |
1136 | 1900 |
]. |
1901 |
||
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1902 |
(c0 := w + x- x1) > 0 ifTrue:[ |
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1903 |
"/ clear to right of screen |
1136 | 1904 |
self paint:bgColor. |
1905 |
self fillRectangleX:x1 y:y width:c0 height:h. |
|
1906 |
]. |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1907 |
|
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1908 |
"/ draw the selection in the right part, after the last column |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1909 |
x1 < (width-margin) ifTrue:[ |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1910 |
self hasRowSelection ifTrue:[ |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1911 |
self selectionIndicesDo:[:selIdx | |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1912 |
|y| |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1913 |
|
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1914 |
y := self yVisibleOfRowNr:selIdx. |
2154
cb22be939082
split strings; some refactoring
Claus Gittinger <cg@exept.de>
parents:
2152
diff
changeset
|
1915 |
self paint:selectionBackgroundColor. |
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1916 |
self |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1917 |
fillRectangleX:x1 y:y |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1918 |
width:(width-margin-x1) height:rowHeight. |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1919 |
]. |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1920 |
]. |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
1921 |
]. |
1112 | 1922 |
! ! |
1923 |
||
1924 |
!DSVColumnView methodsFor:'drawing interactors'! |
|
1925 |
||
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1926 |
displayLabel:aLabel x:xLeft y:yTop |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1927 |
"display the label at x y; test whether the height of the label matches to the current |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1928 |
rowHeight. If not, an exception is raised and the rowHeight is recomputed" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1929 |
|
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1930 |
|y h | |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1931 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1932 |
aLabel notNil ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1933 |
aLabel isString ifTrue:[ |
2593
24ddc48c5ad4
bugfix: recomputation of rowHeight if label is heigher than current rowHeight
ca
parents:
2592
diff
changeset
|
1934 |
y := yTop + self rowFontAscent. |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1935 |
] ifFalse:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1936 |
h := aLabel heightOn:self. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1937 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1938 |
h > minRowHeight ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1939 |
minRowHeight := h. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1940 |
|
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1941 |
preferredExtent notNil ifTrue:[ |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1942 |
rowHeight := (minRowHeight + separatorSize + verticalSpacing + verticalSpacing + 1) // 2 * 2. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1943 |
preferredExtent := preferredExtent copy. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1944 |
preferredExtent y: (list size * rowHeight). |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1945 |
self contentsChanged. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1946 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1947 |
self class stopRedrawSignal raiseRequest. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1948 |
]. |
2593
24ddc48c5ad4
bugfix: recomputation of rowHeight if label is heigher than current rowHeight
ca
parents:
2592
diff
changeset
|
1949 |
y := yTop + (aLabel ascentOn:self). |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1950 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1951 |
aLabel displayOn:self x:xLeft y:y. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1952 |
]. |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1953 |
! |
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
1954 |
|
1131 | 1955 |
drawCheckToggleAtX:xTop y:yTop w:rowWidth state:aState |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1956 |
"draw a check toggle button" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1957 |
|
1112 | 1958 |
|e form |
1959 |
y "{ Class:SmallInteger }" |
|
1960 |
x "{ Class:SmallInteger }" |
|
1961 |
h "{ Class:SmallInteger }" |
|
1962 |
w "{ Class:SmallInteger }" |
|
1963 |
| |
|
1964 |
w := checkToggleExtent x. |
|
1965 |
h := checkToggleExtent y. |
|
1966 |
y := yTop + (rowHeight - h // 2). |
|
1967 |
x := xTop + (rowWidth - w // 2). |
|
1529 | 1968 |
h odd ifTrue:[y := y + 1]. |
1112 | 1969 |
|
1970 |
(form := checkToggleActiveImage) isNil ifTrue:[ |
|
1131 | 1971 |
self paint:bgColor. |
1972 |
self fillRectangleX:x y:y width:w height:h. |
|
1973 |
self drawEdgesAtX:x y:y width:w height:h level:checkToggleLevel on:self. |
|
1974 |
||
2695 | 1975 |
aState isBoolean ifFalse:[^ self]. |
1976 |
||
1112 | 1977 |
aState ifFalse:[ |
1978 |
^ self |
|
1979 |
]. |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
1980 |
self paint:fgColor on:bgColor. |
1112 | 1981 |
form := checkToggleForm |
1982 |
] ifFalse:[ |
|
1983 |
aState ifFalse:[form := checkTogglePassiveImage] |
|
859 | 1984 |
]. |
1112 | 1985 |
e := (checkToggleExtent - form extent) // 2. |
1986 |
self displayForm:form x:(x + e x) y:(y + e y). |
|
1987 |
! |
|
1988 |
||
1131 | 1989 |
drawComboButtonAtX:xTop y:yTop w:rowWidth |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1990 |
"draw a combo button" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
1991 |
|
1112 | 1992 |
|e |
1993 |
x "{ Class:SmallInteger }" |
|
1994 |
y "{ Class:SmallInteger }" |
|
1995 |
h "{ Class:SmallInteger }" |
|
1996 |
w "{ Class:SmallInteger }" |
|
1997 |
| |
|
1998 |
w := comboButtonExtent x. |
|
1999 |
h := comboButtonExtent y. |
|
2000 |
y := yTop + (rowHeight - h // 2). |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
2001 |
x := xTop + (rowWidth - w - separatorSize - 1). |
1112 | 2002 |
e := (comboButtonExtent - comboButtonForm extent) // 2. |
2003 |
||
1131 | 2004 |
self paint:bgColor. |
2005 |
self fillRectangleX:x y:y width:w height:h. |
|
2006 |
self drawEdgesAtX:x y:y width:w height:h level:comboButtonLevel on:self. |
|
1136 | 2007 |
self paint:fgColor on:bgColor. |
1112 | 2008 |
self displayForm:comboButtonForm x:(x + e x) y:(y + e y) |
2009 |
! |
|
2010 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2011 |
drawEdgesAtX:x y:y width:w height:h level:aLevel on:aGC |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2012 |
"draw edges for a cell or label" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2013 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2014 |
aGC |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2015 |
drawEdgesForX:x |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2016 |
y:y |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2017 |
width:w |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2018 |
height:h |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2019 |
level:aLevel |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2020 |
shadow:buttonShadowColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2021 |
light:buttonLightColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2022 |
halfShadow:buttonHalfShadowColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2023 |
halfLight:buttonHalfLightColor |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2024 |
style:ButtonEdgeStyle. |
637 | 2025 |
! ! |
2026 |
||
542 | 2027 |
!DSVColumnView methodsFor:'enumerating columns'! |
2028 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2029 |
columnsDo:aOneArgBlock |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2030 |
"evaluate the argument, aOneArgBlock for every column" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2031 |
|
542 | 2032 |
columnDescriptors do:aOneArgBlock |
2033 |
! |
|
2034 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2035 |
columnsFrom:start to:stop do:aOneArgBlock |
542 | 2036 |
"evaluate the argument, aOneArgBlock for the columns with index start to |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2037 |
stop in the collection of column descriptors" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2038 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2039 |
columnDescriptors |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2040 |
from:start |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2041 |
to:stop |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2042 |
do:aOneArgBlock |
542 | 2043 |
! ! |
2044 |
||
2045 |
!DSVColumnView methodsFor:'event handling'! |
|
2046 |
||
2398 | 2047 |
buttonControlPressAtRowNr:aStartRow |
2048 |
|isSelected prvRow doAdd chgSet| |
|
2049 |
||
2050 |
buttonMotionAction := nil. |
|
2051 |
isSelected := self isInSelection:aStartRow. |
|
2052 |
||
2053 |
isSelected ifTrue:[ self removeRowFromSelection:aStartRow ] |
|
2054 |
ifFalse:[ self addRowToSelection:aStartRow ]. |
|
2055 |
||
2056 |
multipleSelectOk ifFalse:[ ^ self ]. |
|
2057 |
||
2058 |
prvRow := aStartRow. |
|
2059 |
chgSet := IdentitySet new. |
|
2060 |
doAdd := isSelected not. |
|
2061 |
||
2062 |
buttonMotionAction := [:p| |rowNr mustRestore step f| |
|
2063 |
rowNr := self yVisibleToRowNr:(p y). |
|
2064 |
||
2065 |
(rowNr notNil and:[rowNr ~~ prvRow]) ifTrue:[ |
|
2066 |
rowNr == aStartRow ifTrue:[ |
|
2067 |
mustRestore := true |
|
2068 |
] ifFalse:[ |
|
2069 |
rowNr > aStartRow ifTrue:[ mustRestore := (rowNr < prvRow) ] |
|
2070 |
ifFalse:[ mustRestore := (rowNr > prvRow) ]. |
|
2071 |
]. |
|
2072 |
prvRow > rowNr ifTrue:[ step := -1 ] |
|
2073 |
ifFalse:[ step := 1 ]. |
|
2074 |
mustRestore ifTrue:[ |
|
2075 |
[ prvRow ~~ rowNr ] whileTrue:[ |
|
2076 |
(chgSet removeIdentical:prvRow ifAbsent:nil) notNil ifTrue:[ |
|
2077 |
doAdd ifFalse:[ self addRowToSelection:prvRow ] |
|
2078 |
ifTrue:[ self removeRowFromSelection:prvRow ]. |
|
2079 |
]. |
|
2080 |
prvRow := prvRow + step. |
|
2081 |
]. |
|
2082 |
] ifFalse:[ |
|
2083 |
[ prvRow ~~ rowNr ] whileTrue:[ |
|
2084 |
prvRow := prvRow + step. |
|
2085 |
||
2086 |
doAdd ~~ (self isInSelection:rowNr) ifTrue:[ |
|
2087 |
chgSet add:prvRow. |
|
2088 |
||
2089 |
doAdd ifTrue:[ self addRowToSelection:prvRow ] |
|
2090 |
ifFalse:[ self removeRowFromSelection:prvRow ]. |
|
2091 |
] |
|
2092 |
]. |
|
2093 |
]. |
|
2094 |
]. |
|
2095 |
]. |
|
2096 |
! |
|
2097 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2098 |
buttonMotion:buttonMask x:x y:y |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2099 |
"mouse-move while button was pressed - handle multiple selection changes" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2100 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2101 |
self isEnabled ifFalse:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2102 |
^ self |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2103 |
]. |
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2104 |
|
2398 | 2105 |
buttonMotionAction notNil ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2106 |
buttonMotionAction value:(x @ y). |
2398 | 2107 |
buttonMotionAction notNil ifTrue:[ |
2108 |
autoScroll ifTrue:[ |
|
2109 |
"/ if moved outside of view, start autoscroll |
|
2110 |
(y < 0) ifTrue:[ |
|
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
2111 |
^ self startAutoScroll:#scrollUp distance:y. |
2398 | 2112 |
]. |
2113 |
(y > height) ifTrue:[ |
|
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
2114 |
^ self startAutoScroll:#scrollDown distance:(y - height). |
2398 | 2115 |
]. |
2116 |
] |
|
607 | 2117 |
] |
2118 |
]. |
|
2398 | 2119 |
self stopAutoScroll. |
607 | 2120 |
! |
2121 |
||
542 | 2122 |
buttonMultiPress:button x:x y:y |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2123 |
"a button was pressed twice - handle doubleclick here" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2124 |
|
2398 | 2125 |
buttonMotionAction := buttonReleaseAction := nil. |
2126 |
||
1805 | 2127 |
self isEnabled ifFalse:[^ self]. |
2128 |
||
542 | 2129 |
((button == 1) or:[button == #select]) ifFalse:[ |
2130 |
^ super buttonMultiPress:button x:x y:y |
|
2131 |
]. |
|
607 | 2132 |
self numberOfSelections == 1 ifTrue:[ |
2133 |
self firstIndexSelected == (self yVisibleToRowNr:y) ifTrue:[ |
|
2134 |
( selectedColIndex == 0 |
|
2135 |
or:[selectedColIndex == (self xVisibleToColNr:x)] |
|
2136 |
) ifTrue:[ |
|
2137 |
self doubleClicked |
|
2138 |
] |
|
542 | 2139 |
] |
2140 |
] |
|
2141 |
! |
|
2142 |
||
2143 |
buttonPress:button x:x y:y |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2144 |
"a button was pressed - handle selection here" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2145 |
|
2858
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2146 |
|oldView rowNr colNr firstRowNr menu sensor clickPoint clickedIntoSelection| |
2398 | 2147 |
|
2802 | 2148 |
clickPoint := x @ y. |
2858
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2149 |
oldView := editView. |
2802 | 2150 |
|
2398 | 2151 |
buttonMotionAction := buttonReleaseAction := nil. |
542 | 2152 |
|
1805 | 2153 |
self isEnabled ifFalse:[^ self]. |
2154 |
||
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2155 |
sensor := self sensor. |
809 | 2156 |
|
667 | 2157 |
((button == 2) or:[button == #menu]) ifTrue:[ |
2398 | 2158 |
menu := self findMenuForSelection. |
2159 |
||
2160 |
menu notNil ifTrue:[ self startUpMenu:menu ] |
|
2161 |
ifFalse:[ super buttonPress:button x:x y:y ]. |
|
2162 |
^ self |
|
2163 |
]. |
|
2164 |
||
2804
8204b926377d
oops - firstRow could be nil
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
2165 |
firstRowNr := rowNr := self yVisibleToRowNr:y. |
8204b926377d
oops - firstRow could be nil
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
2166 |
colNr := self xVisibleToColNr:x. |
8204b926377d
oops - firstRow could be nil
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
2167 |
|
8204b926377d
oops - firstRow could be nil
Claus Gittinger <cg@exept.de>
parents:
2802
diff
changeset
|
2168 |
(rowNr isNil or:[colNr isNil]) ifTrue:[ |
2722 | 2169 |
self deselect. |
2398 | 2170 |
super buttonPress:button x:x y:y. |
2171 |
^ self |
|
2172 |
]. |
|
2173 |
||
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2174 |
(self isRowSelectable:rowNr) ifFalse:[^ self ]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2175 |
|
2813 | 2176 |
clickedIntoSelection := self isInSelection:rowNr. |
2177 |
||
2398 | 2178 |
sensor shiftDown ifTrue:[ |
2179 |
(multipleSelectOk and:[selectedRowIndex size ~~ 0]) ifTrue:[ |
|
2180 |
self selectRowFrom:(selectedRowIndex min min:rowNr) |
|
2181 |
to:(selectedRowIndex max max:rowNr). |
|
2182 |
] ifFalse:[ |
|
2183 |
self selectColIndex:0 rowIndex:rowNr. |
|
2184 |
]. |
|
2185 |
^ self |
|
2186 |
]. |
|
2187 |
||
2802 | 2188 |
sensor ctrlDown ifTrue:[ |
2189 |
self buttonControlPressAtRowNr:rowNr. |
|
2190 |
"/ ^ self |
|
2813 | 2191 |
] ifFalse:[ |
2802 | 2192 |
(self isInSelection:rowNr) ifTrue:[ |
2193 |
buttonReleaseAction := |
|
2194 |
[ |
|
2195 |
self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
|
2196 |
] |
|
2197 |
] ifFalse:[ |
|
2198 |
self selectRowAt:rowNr colAt:colNr atPoint:clickPoint. |
|
2199 |
] |
|
2200 |
]. |
|
2858
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2201 |
(editView notNil and:[oldView ~~ editView]) ifTrue:[ |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2202 |
"/ disable motion actions |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2203 |
buttonMotionAction := nil. |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2204 |
^ self. |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2205 |
]. |
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2206 |
|
2813 | 2207 |
clickedIntoSelection ifTrue:[ |
2858
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2208 |
self canDrag ifTrue:[ |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2209 |
buttonMotionAction := [:p| |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2210 |
self canDrag ifTrue:[ |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2211 |
(((p x dist:clickPoint x) > (UserPreferences current motionDistanceToStartDrag)) |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2212 |
or:[p x < -5 or:[p x > (width+5)]]) ifTrue:[ |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2213 |
buttonReleaseAction := buttonMotionAction := nil. |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2214 |
self startDragAt:p |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2215 |
] |
46f4f913da0a
A1046: CheckBoxes in DSV-Table reagieren manchmal erst auf 2. click
ca
parents:
2836
diff
changeset
|
2216 |
]. |
2813 | 2217 |
]. |
2218 |
]. |
|
2219 |
^ self. |
|
2220 |
]. |
|
2221 |
||
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2222 |
buttonMotionAction := [:p| |
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2223 |
|r2| |
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2224 |
|
2813 | 2225 |
(self bounds containsPoint:p) ifTrue:[ |
2226 |
multipleSelectOk ifTrue:[ |
|
2227 |
r2 := self yVisibleToRowNr:(p y). |
|
2228 |
r2 notNil ifTrue:[ |
|
2811
60ac5678c188
fixed start multiple-draw bug
Claus Gittinger <cg@exept.de>
parents:
2807
diff
changeset
|
2229 |
"/ r2 ~~ self lastIndexSelected ifTrue:[ |
2813 | 2230 |
self selectRowFrom:firstRowNr to:r2. |
2231 |
clickPoint := p. |
|
2811
60ac5678c188
fixed start multiple-draw bug
Claus Gittinger <cg@exept.de>
parents:
2807
diff
changeset
|
2232 |
"/ ]. |
2813 | 2233 |
]. |
2234 |
]. |
|
2235 |
]. |
|
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2236 |
|
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2237 |
self canDrag ifTrue:[ |
2792 | 2238 |
(((p x dist:clickPoint x) > (UserPreferences current motionDistanceToStartDrag)) |
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2239 |
or:[p x < -5 or:[p x > (width+5)]]) ifTrue:[ |
2398 | 2240 |
buttonReleaseAction := buttonMotionAction := nil. |
2788
8f45f2da80fa
selection/multiSelection/startDrag
Claus Gittinger <cg@exept.de>
parents:
2777
diff
changeset
|
2241 |
self startDragAt:p |
2398 | 2242 |
] |
2243 |
]. |
|
2244 |
]. |
|
542 | 2245 |
! |
2246 |
||
643 | 2247 |
buttonRelease:button x:x y:y |
2248 |
||
2398 | 2249 |
buttonMotionAction := nil. |
1749 | 2250 |
self stopAutoScroll. |
2251 |
||
2398 | 2252 |
buttonReleaseAction notNil ifTrue:[ |
2253 |
buttonReleaseAction value. |
|
2254 |
buttonReleaseAction := nil. |
|
643 | 2255 |
]. |
2256 |
super buttonRelease:button x:x y:y |
|
2257 |
! |
|
2258 |
||
809 | 2259 |
characterPress:aChar x:x y:y |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2260 |
"search row in column at x/y starting its printable label with cahracter." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2261 |
|
809 | 2262 |
|colNr rowNr lsize found column| |
2263 |
||
2445
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2264 |
lsize := list size. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2265 |
|
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2266 |
"/ (rowIfAbsentBlock notNil |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2267 |
"/ or:[x isNil |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2268 |
"/ or:[(colNr := self xVisibleToColNr:x) isNil]]) ifTrue:[ |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2269 |
"/ ^ self |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2270 |
"/ ]. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2271 |
colNr := self findFirstColumnWithStringFrom:1 to:lsize. |
2535 | 2272 |
colNr isNil ifTrue:[ ^ self ]. |
2273 |
||
809 | 2274 |
rowNr := self lastIndexSelected. |
2275 |
column := self columnAt:colNr. |
|
2276 |
found := 0. |
|
2277 |
||
2278 |
lsize > rowNr ifTrue:[ |
|
2445
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2279 |
"/ search to end |
809 | 2280 |
found := column findRowNrStartingWithChar:aChar start:(rowNr + 1) stop:lsize. |
2281 |
]. |
|
2282 |
||
2283 |
(found == 0 and:[rowNr > 1]) ifTrue:[ |
|
2284 |
"/ search from begin |
|
2285 |
found := column findRowNrStartingWithChar:aChar start:1 stop:(rowNr - 1) |
|
2286 |
]. |
|
2287 |
found ~~ 0 ifTrue:[ |
|
2288 |
self selectColIndex:colNr rowIndex:found. |
|
2289 |
]. |
|
2290 |
||
896
aa07612a7c04
care for redirected messages in characterPress:
Claus Gittinger <cg@exept.de>
parents:
892
diff
changeset
|
2291 |
"Modified: / 21.5.1998 / 03:30:22 / cg" |
809 | 2292 |
! |
2293 |
||
542 | 2294 |
contentsChanged |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2295 |
"contents changed - move origin up if possible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2296 |
|
542 | 2297 |
|y| |
2298 |
||
2299 |
shown ifTrue:[ |
|
2300 |
self recomputeHeightOfContents. |
|
2301 |
y := self maxViewOriginY. |
|
2302 |
viewOrigin y > y ifTrue:[ |
|
1948
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
2303 |
scrollWhenUpdating ~~ false ifTrue:[ |
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
2304 |
self scrollTo:(viewOrigin x @ y) |
9ed8131d94bb
viewOrigin fix (when list is set to nil while not shown);
Claus Gittinger <cg@exept.de>
parents:
1947
diff
changeset
|
2305 |
] |
542 | 2306 |
] ifFalse:[ |
2307 |
self updateEditViewOrigin. |
|
2308 |
] |
|
2309 |
]. |
|
2310 |
super contentsChanged |
|
2311 |
! |
|
2312 |
||
2816 | 2313 |
cursorKey:aKey rawKey:rawKey |
2314 |
|hasSelectables step start minSelRowNr maxSelRowNr selColNr selRowNr listSize| |
|
2315 |
||
2316 |
hasSelectables := self hasSelectables. |
|
2317 |
listSize := list size. |
|
2318 |
||
2319 |
(hasSelectables or:[selectRowOnDefault]) ifFalse:[ ^ self ]. |
|
2320 |
||
2321 |
minSelRowNr := self minIndexSelected. |
|
2322 |
maxSelRowNr := self maxIndexSelected. |
|
2323 |
||
2324 |
selColNr := hasSelectables ifFalse:[0] ifTrue:[selectedColIndex]. |
|
2325 |
||
2326 |
aKey == #CursorUp ifTrue:[ |
|
2327 |
selRowNr := minSelRowNr > 1 ifTrue:[minSelRowNr - 1] ifFalse:[listSize]. |
|
2328 |
step := -1. |
|
2329 |
] ifFalse:[ |
|
2330 |
aKey == #CursorDown ifTrue:[ |
|
2331 |
selRowNr := maxSelRowNr < listSize ifTrue:[maxSelRowNr + 1] ifFalse:[1]. |
|
2332 |
step := 1. |
|
2333 |
] ifFalse:[ |
|
2334 |
("aKey == #BeginOfLine or:[" rawKey == #Home "]") ifTrue:[ |
|
2335 |
selRowNr := 1. |
|
2336 |
step := 1. |
|
2337 |
] ifFalse:[ |
|
2338 |
(rawKey == #End) ifTrue:[ |
|
2339 |
selRowNr := listSize. |
|
2340 |
step := -1. |
|
2341 |
] |
|
2342 |
] |
|
2343 |
] |
|
2344 |
]. |
|
2345 |
start := selRowNr. |
|
2346 |
||
2347 |
[ self isRowSelectable:selRowNr ] whileFalse:[ |
|
2348 |
selRowNr := selRowNr + step. |
|
2349 |
||
2350 |
selRowNr == 0 ifTrue:[ |
|
2351 |
selRowNr := listSize. |
|
2352 |
] ifFalse:[ |
|
2353 |
selRowNr > listSize ifTrue:[ |
|
2354 |
selRowNr := 1. |
|
2355 |
]. |
|
2356 |
]. |
|
2357 |
selRowNr == start ifTrue:[^ self ]. |
|
2358 |
]. |
|
2359 |
||
2360 |
((aKey == #CursorUp) or:[aKey == #CursorDown]) ifTrue:[ |
|
2361 |
(multipleSelectOk and:[self sensor shiftDown]) ifTrue:[ |
|
2362 |
self addRowToSelection:selRowNr. |
|
2363 |
||
2364 |
aKey == #CursorDown ifTrue:[ |
|
2365 |
self makeLineVisible:((selRowNr+1) min:listSize) |
|
2366 |
] ifFalse:[ |
|
2367 |
self makeLineVisible:((selRowNr-1) max:1) |
|
2368 |
]. |
|
2369 |
^ self |
|
2370 |
] |
|
2371 |
]. |
|
2372 |
self selectColIndex:selColNr rowIndex:selRowNr |
|
2373 |
! |
|
2374 |
||
2375 |
dispatchEvent:event withFocusOn:focusViewOrNil delegate:delegated |
|
2376 |
event isKeyEvent ifTrue:[ |
|
2377 |
event view == editView ifTrue:[ |
|
2378 |
self halt. |
|
2379 |
]. |
|
2380 |
]. |
|
2381 |
super dispatchEvent:event withFocusOn:focusViewOrNil delegate:delegated |
|
2382 |
! |
|
2383 |
||
542 | 2384 |
doubleClicked |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2385 |
"handle a double click" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2386 |
|
637 | 2387 |
|col sel idx| |
2388 |
||
2389 |
self hasSelection ifTrue:[ |
|
2390 |
idx := self firstIndexSelected. |
|
2391 |
col := self selectedColumn. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2392 |
(col notNil and:[ (sel := col doubleClickedSelector) notNil ]) ifTrue:[ |
2074 | 2393 |
col doubleClickOn:idx |
637 | 2394 |
] ifFalse:[ |
2395 |
doubleClickActionBlock notNil ifTrue:[ |
|
2396 |
doubleClickActionBlock value:idx |
|
2397 |
] |
|
2398 |
] |
|
2399 |
] |
|
542 | 2400 |
! |
2401 |
||
2445
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2402 |
findFirstColumnWithStringFrom:start to:stop |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2403 |
start to:stop do:[:eachNr| |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2404 |
|row lbl| |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2405 |
row := self at:eachNr. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2406 |
columnDescriptors keysAndValuesDo:[:colNr :col | |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2407 |
lbl := col shownValueForRow:row rowNr:eachNr. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2408 |
|
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2409 |
(lbl isSequenceable and:[lbl isString not]) ifTrue:[ |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2410 |
lbl := lbl at:1 ifAbsent:nil |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2411 |
]. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2412 |
|
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2413 |
(lbl respondsTo:#string) ifTrue:[ |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2414 |
lbl := lbl string. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2415 |
]. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2416 |
(lbl size > 0 and:[(lbl at:1) isCharacter]) ifTrue:[ |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2417 |
^ colNr |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2418 |
] |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2419 |
] |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2420 |
]. |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2421 |
^ nil |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2422 |
! |
df54aa1128b3
charcter search: first column which contains a string is searched for
penk
parents:
2398
diff
changeset
|
2423 |
|
667 | 2424 |
findMenuForSelection |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2425 |
"find the middle button menu for the current selection; returns the menu or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2426 |
|
667 | 2427 |
|col row menu| |
2428 |
||
2429 |
self numberOfSelections == 1 ifTrue:[ |
|
2430 |
row := self at:(self firstIndexSelected). |
|
2431 |
col := self selectedColumn. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2432 |
(col notNil |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2433 |
and:[ (menu := col menuForRow:row orAdaptor:columnAdaptor) notNil ]) |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2434 |
ifTrue:[ ^ menu ]. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2435 |
col := columnDescriptors |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2436 |
detect:[:c | c rendererType == #rowSelector ] |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2437 |
ifNone:[ nil ]. |
667 | 2438 |
col notNil ifTrue:[ |
1223
176702811314
kludge: when asking for an itemMenu, pass application to
tm
parents:
1215
diff
changeset
|
2439 |
^ col menuForRow:row inApplication:(self application) |
667 | 2440 |
] |
2441 |
]. |
|
2442 |
^ nil |
|
2443 |
! |
|
2444 |
||
1111 | 2445 |
keyPress:aKey x:x y:y |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2446 |
"a key was pressed - handle page-keys here" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2447 |
|
542 | 2448 |
<resource: #keyboard (#PreviousPage #NextPage #HalfPageUp #HalfPageDown |
809 | 2449 |
#BeginOfText #EndOfText #ScrollUp #ScrollDown |
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2450 |
#CursorUp #CursorDown #CursorRight #CursorLeft #SelectAll)> |
542 | 2451 |
|
2816 | 2452 |
|maxColNr firstSelRowNr selRowNr selColNr |
2470 | 2453 |
key column isTab listSize hasSelectables rawKey| |
1111 | 2454 |
|
1805 | 2455 |
self isEnabled ifFalse:[^ self]. |
2456 |
||
1416 | 2457 |
(listSize := list size) == 0 ifTrue:[ |
2458 |
^ super keyPress:aKey x:x y:y |
|
2459 |
]. |
|
1776 | 2460 |
aKey isCharacter ifTrue:[ |
2461 |
^ self characterPress:aKey x:x y:y |
|
542 | 2462 |
]. |
1111 | 2463 |
|
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2464 |
(aKey == #SelectAll) ifTrue:[ |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2465 |
multipleSelectOk ifTrue:[ |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2466 |
self selectAllRows. |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2467 |
]. |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2468 |
^ self |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2469 |
]. |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
2470 |
|
1776 | 2471 |
aKey == #PreviousPage ifTrue:[^ self pageUp]. |
2472 |
aKey == #NextPage ifTrue:[^ self pageDown]. |
|
2473 |
aKey == #HalfPageUp ifTrue:[^ self halfPageUp]. |
|
2474 |
aKey == #HalfPageDown ifTrue:[^ self halfPageDown]. |
|
2475 |
aKey == #BeginOfText ifTrue:[^ self scrollToTop]. |
|
2476 |
aKey == #EndOfText ifTrue:[^ self scrollToBottom]. |
|
2477 |
aKey == #ScrollUp ifTrue:[^ self scrollUp]. |
|
2478 |
aKey == #ScrollDown ifTrue:[^ self scrollDown]. |
|
2479 |
||
2816 | 2480 |
aKey == #Return ifTrue:[ |
2481 |
editView notNil ifTrue:[ |
|
2482 |
(self selectedRowIndex size == 1 |
|
2483 |
and:[self selectedRowIndex first == listSize]) ifTrue:[ |
|
2484 |
self selectRowIndex:nil. |
|
2485 |
] ifFalse:[ |
|
2486 |
self cursorKey:#CursorDown rawKey:#CursorDown. |
|
2487 |
]. |
|
2488 |
^ self |
|
2489 |
]. |
|
2490 |
self numberOfSelections == 1 ifTrue:[ |
|
2491 |
self doubleClicked |
|
2492 |
]. |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
2493 |
^ self |
542 | 2494 |
]. |
1111 | 2495 |
|
2816 | 2496 |
hasSelectables := self hasSelectables. |
2470 | 2497 |
|
2498 |
rawKey := (WindowGroup lastEventQuerySignal query) rawKey. |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
2499 |
|
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
2500 |
(aKey == #CursorUp |
2816 | 2501 |
or:[aKey == #CursorDown |
2502 |
or:[rawKey == #Home |
|
2503 |
or:[rawKey == #End]]]) |
|
2504 |
ifTrue:[ |
|
2505 |
self cursorKey:aKey rawKey:rawKey. |
|
1776 | 2506 |
^ self |
2507 |
]. |
|
1668 | 2508 |
|
2509 |
hasSelectables ifFalse:[ |
|
2510 |
^ super keyPress:aKey x:x y:y |
|
2511 |
]. |
|
2512 |
||
1776 | 2513 |
"/ CURSOR LEFT/RIGHT or TABING |
2470 | 2514 |
(aKey == #CursorLeft or:[aKey == #CursorRight]) ifTrue:[ |
2515 |
isTab := false. |
|
2516 |
key := aKey. |
|
2517 |
] ifFalse:[ |
|
1668 | 2518 |
tabIntern ifFalse:[ |
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2519 |
^ super keyPress:aKey x:x y:y |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2520 |
]. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2521 |
|
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2522 |
(aKey includesString:'Tab') ifTrue:[ |
2482
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
2523 |
key := (self sensor shiftDown or:[aKey includesString:'Left']) |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
2524 |
ifTrue:[#CursorLeft] |
13acaaf02528
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2470
diff
changeset
|
2525 |
ifFalse:[#CursorRight] |
1416 | 2526 |
] ifFalse:[ |
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2527 |
(aKey == #FocusPrevious or:[aKey == #FocusNext]) ifFalse:[ |
1416 | 2528 |
^ super keyPress:aKey x:x y:y |
2529 |
]. |
|
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2530 |
key := aKey == #FocusPrevious ifTrue:[#CursorLeft] ifFalse:[#CursorRight]. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2531 |
]. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2532 |
isTab := true. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2533 |
]. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2534 |
|
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2535 |
maxColNr := self numberOfColumns. |
1776 | 2536 |
selColNr := selectedColIndex. |
612 | 2537 |
|
2470 | 2538 |
firstSelRowNr := self firstIndexSelected. |
2539 |
||
1111 | 2540 |
key == #CursorLeft ifTrue:[ |
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
2541 |
selRowNr := firstSelRowNr. |
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2542 |
selRowNr == 0 ifTrue:[selRowNr := listSize]. |
1776 | 2543 |
selColNr == 0 ifTrue:[selColNr := maxColNr + 1]. |
2544 |
||
2545 |
[true] whileTrue:[ |
|
2546 |
(selColNr := selColNr - 1) == 0 ifTrue:[ |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2547 |
[ selRowNr := selRowNr - 1. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2548 |
selRowNr == 0 ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2549 |
isTab ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2550 |
tabAtStartAction notNil ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2551 |
tabAtStartAction value |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2552 |
] ifFalse:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2553 |
self deselect. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2554 |
self windowGroup focusPreviousFrom:self |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2555 |
] |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2556 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2557 |
^ self |
1416 | 2558 |
]. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2559 |
(self isRowSelectable:selRowNr) |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2560 |
] whileFalse. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2561 |
|
1776 | 2562 |
selColNr := maxColNr |
1111 | 2563 |
]. |
1776 | 2564 |
column := self columnAt:selColNr. |
1416 | 2565 |
|
1111 | 2566 |
(column rendererType ~~ #rowSelector and:[column canSelect:selRowNr]) ifTrue:[ |
1776 | 2567 |
^ self selectColIndex:selColNr rowIndex:selRowNr. |
1111 | 2568 |
] |
2569 |
] |
|
542 | 2570 |
]. |
1776 | 2571 |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
2572 |
selRowNr := firstSelRowNr. |
1776 | 2573 |
selRowNr == 0 ifTrue:[selRowNr := 1]. |
2574 |
||
2575 |
[true] whileTrue:[ |
|
2576 |
(selColNr := selColNr + 1) > maxColNr ifTrue:[ |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2577 |
[ selRowNr := selRowNr + 1. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2578 |
selRowNr > listSize ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2579 |
isTab ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2580 |
tabAtEndAction notNil ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2581 |
tabAtEndAction value |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2582 |
] ifFalse:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2583 |
self deselect. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2584 |
self windowGroup focusNextFrom:self |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2585 |
] |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2586 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2587 |
^ self |
1776 | 2588 |
]. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2589 |
(self isRowSelectable:selRowNr) |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2590 |
] whileFalse. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
2591 |
|
1776 | 2592 |
selColNr := 1 |
2593 |
]. |
|
2594 |
column := self columnAt:selColNr. |
|
2595 |
||
2596 |
(column rendererType ~~ #rowSelector and:[column canSelect:selRowNr]) ifTrue:[ |
|
2597 |
^ self selectColIndex:selColNr rowIndex:selRowNr |
|
2598 |
] |
|
2599 |
]. |
|
542 | 2600 |
! |
2601 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2602 |
originChanged:delta |
542 | 2603 |
"this one is sent, after the origin of my contents has changed - |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2604 |
tell dependents (i.e. scrollers) about this" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2605 |
|
542 | 2606 |
super originChanged:delta. |
2607 |
self updateEditViewOrigin. |
|
2276
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2608 |
! |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2609 |
|
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2610 |
sizeChanged:how |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2611 |
"size changed - move origin up if possible |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2612 |
change the layout of the labelView dependent on my layout" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2613 |
|
2276
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2614 |
|selectionWasVisible| |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2615 |
|
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2616 |
selectionWasVisible := self isSelectionVisibleIn:(previousExtent ? self extent). |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2617 |
|
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2618 |
previousExtent := self extent. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2619 |
super sizeChanged:how. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2620 |
|
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2621 |
"/ no - must compute even if not visible. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2622 |
"/ (could be invisible in a notebook ...) |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2623 |
realized ifTrue:[ "used to be: shown" |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2624 |
"/ labelView isVisible ifTrue:[ |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2625 |
"/ lyt := labelView layout. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2626 |
"/ lyt leftOffset:(layout leftOffset). |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2627 |
"/ lyt rightOffset:(layout rightOffset). |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2628 |
"/ labelView layout:lyt. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2629 |
"/ ]. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2630 |
self fitColumns. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2631 |
selectionWasVisible ifTrue:[ |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2632 |
self makeSelectionVisible. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2633 |
] |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
2634 |
]. |
542 | 2635 |
! ! |
2636 |
||
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2637 |
!DSVColumnView methodsFor:'focus handling'! |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2638 |
|
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2639 |
canTab |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2640 |
super canTab ifTrue:[ |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2641 |
^ editView isNil |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2642 |
]. |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2643 |
^ false |
2101 | 2644 |
! |
2645 |
||
2646 |
wantsFocusWithPointerEnter |
|
2647 |
"views which like to take the keyboard focus |
|
2648 |
when the pointer enters can do so by redefining this |
|
2649 |
to return true" |
|
2650 |
||
2651 |
|pref| |
|
2652 |
||
2237 | 2653 |
editView ifNotNil:[^ false]. |
2654 |
||
2101 | 2655 |
pref := UserPreferences current focusFollowsMouse. |
2656 |
(pref ~~ false |
|
2657 |
and:[(styleSheet at:#'selection.requestFocusOnPointerEnter' default:true) |
|
2658 |
]) ifTrue:[ |
|
2659 |
list size > 0 ifTrue:[ |
|
2660 |
^ true |
|
2661 |
] |
|
2662 |
]. |
|
2663 |
^ false |
|
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2664 |
! ! |
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
2665 |
|
542 | 2666 |
!DSVColumnView methodsFor:'gc operations'! |
2667 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2668 |
imageOnMyDevice:anImage |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2669 |
"associate image to device and clear pixel mask; returns the new image." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2670 |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2671 |
|deviceImage| |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2672 |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2673 |
anImage isNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2674 |
^ anImage |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2675 |
]. |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2676 |
deviceImage := anImage onDevice:device. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2677 |
deviceImage isImage ifTrue:[ |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2678 |
deviceImage clearMaskedPixels. |
1100 | 2679 |
]. |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2680 |
^ deviceImage |
1100 | 2681 |
! |
2682 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2683 |
registerImage:anImage key:aKey |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2684 |
"any row can register an image with a unique identifier a key symbol" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2685 |
|
542 | 2686 |
|img| |
2687 |
||
2688 |
(img := registererImages at:aKey ifAbsent:nil) notNil ifTrue:[ |
|
2689 |
^ img |
|
2690 |
]. |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2691 |
img := self imageOnMyDevice:anImage. |
567 | 2692 |
registererImages at:aKey put:img. |
2693 |
^ img |
|
542 | 2694 |
! |
2695 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2696 |
registeredImageAt:aKey |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2697 |
"any row can register an image with a unique identifier" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2698 |
|
542 | 2699 |
^ registererImages at:aKey ifAbsent:nil |
2700 |
! |
|
2701 |
||
2702 |
releaseAllRegisteredImages |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2703 |
"release all registered images" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2704 |
|
542 | 2705 |
registererImages := IdentityDictionary new. |
2706 |
! ! |
|
2707 |
||
2500 | 2708 |
!DSVColumnView methodsFor:'initialization & release'! |
542 | 2709 |
|
2710 |
create |
|
2711 |
super create. |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
2712 |
|
1480 | 2713 |
fgColor := fgColor onDevice:device. |
2714 |
bgColor := bgColor onDevice:device. |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
2715 |
selectionForegroundColor := selectionForegroundColor onDevice:device. |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
2716 |
selectionBackgroundColor := selectionBackgroundColor onDevice:device. |
1480 | 2717 |
|
2718 |
buttonShadowColor := buttonShadowColor onDevice:device. |
|
2719 |
buttonLightColor := buttonLightColor onDevice:device. |
|
809 | 2720 |
|
2721 |
buttonHalfShadowColor notNil ifTrue:[ |
|
1480 | 2722 |
buttonHalfShadowColor := buttonHalfShadowColor onDevice:device |
809 | 2723 |
]. |
2724 |
||
2725 |
buttonHalfLightColor notNil ifTrue:[ |
|
1480 | 2726 |
buttonHalfLightColor := buttonHalfLightColor onDevice:device |
809 | 2727 |
]. |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2728 |
rowSelectorForm := self imageOnMyDevice:rowSelectorForm. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2729 |
checkToggleActiveImage := self imageOnMyDevice:checkToggleActiveImage. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2730 |
checkTogglePassiveImage := self imageOnMyDevice:checkTogglePassiveImage. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2731 |
comboButtonForm := self imageOnMyDevice:comboButtonForm. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2487
diff
changeset
|
2732 |
checkToggleForm := self imageOnMyDevice:checkToggleForm. |
542 | 2733 |
! |
2734 |
||
2735 |
initStyle |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2736 |
"setup colors, etc." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2737 |
|
1100 | 2738 |
|button widget| |
809 | 2739 |
|
542 | 2740 |
super initStyle. |
2741 |
||
2742 |
DefaultForegroundColor isNil ifTrue:[ |
|
2743 |
self class updateStyleCache |
|
2744 |
]. |
|
2745 |
fgColor := DefaultForegroundColor. |
|
2746 |
bgColor := DefaultBackgroundColor. |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
2747 |
selectionForegroundColor := DefaultHilightForegroundColor. |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
2748 |
selectionBackgroundColor := DefaultHilightBackgroundColor. |
809 | 2749 |
|
2750 |
shadowColor isNil ifTrue:[ |
|
2751 |
shadowColor := Color grayPercent:40. |
|
2752 |
]. |
|
2753 |
||
2754 |
lightColor isNil ifTrue:[ |
|
2755 |
lightColor := Color grayPercent:75 |
|
2756 |
]. |
|
2757 |
||
2758 |
buttonLightColor := ButtonLightColor ? lightColor. |
|
2759 |
buttonShadowColor := ButtonShadowColor ? shadowColor. |
|
2760 |
||
2761 |
(ButtonEdgeStyle == #soft) ifTrue:[ |
|
2762 |
buttonHalfShadowColor := ButtonHalfShadowColor. |
|
2763 |
buttonHalfLightColor := ButtonHalfLightColor. |
|
2764 |
||
2765 |
buttonHalfShadowColor isNil ifTrue:[ |
|
2766 |
buttonHalfShadowColor := buttonShadowColor lightened |
|
2767 |
] |
|
2768 |
]. |
|
1490 | 2769 |
|
2770 |
buttonHalfShadowColor isNil ifTrue:[ |
|
2771 |
buttonHalfShadowColor := Color gray |
|
2772 |
]. |
|
2773 |
||
2711 | 2774 |
rowSelectorForm := self class rowSelectorImage. |
1100 | 2775 |
checkToggleActiveImage := CheckToggleActiveImage. |
2776 |
checkTogglePassiveImage := CheckTogglePassiveImage. |
|
2777 |
||
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2778 |
ComboButtonForm isNil ifTrue:[ |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2779 |
widget := ComboListView new. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2780 |
button := widget menuButton. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2781 |
ComboButtonForm := button label. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2782 |
ComboButtonLevel := button offLevel. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2783 |
ComboButtonExtent := (button preferredExtent x) @ (widget preferredExtent y). |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2784 |
]. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2785 |
|
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2786 |
CheckToggleForm isNil ifTrue:[ |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2787 |
widget := CheckToggle new. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2788 |
CheckToggleForm := widget label. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2789 |
CheckToggleLevel := widget offLevel. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2790 |
CheckToggleExtent := widget preferredExtent. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2791 |
]. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2792 |
comboButtonForm := ComboButtonForm. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2793 |
comboButtonLevel := ComboButtonLevel. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2794 |
comboButtonExtent := ComboButtonExtent. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2795 |
|
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2796 |
checkToggleForm := CheckToggleForm. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2797 |
checkToggleLevel := CheckToggleLevel. |
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
2798 |
checkToggleExtent := CheckToggleExtent. |
542 | 2799 |
! |
2800 |
||
2801 |
initialize |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2802 |
"set default attributes" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2803 |
|
542 | 2804 |
super initialize. |
1487 | 2805 |
self lineWidth:0. |
2806 |
||
1668 | 2807 |
tabIntern := true. |
1487 | 2808 |
useIndex := true. |
1112 | 2809 |
viewOrigin := 0@0. |
1480 | 2810 |
font := font onDevice:device. |
1112 | 2811 |
rowHeight := font height. |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
2812 |
minRowHeight := rowHeight. |
1112 | 2813 |
multipleSelectOk := false. "/ multiselect disabled |
2814 |
selectedRowIndex := selectedColIndex := 0. "/ no selection |
|
1778
51bbd960baf9
change registeredIcons from IdentityDictionary to Dictionary
ca
parents:
1776
diff
changeset
|
2815 |
registererImages := Dictionary new. |
1112 | 2816 |
columnDescriptors := #(). |
2817 |
beDependentOfRows := false. |
|
2818 |
verticalSpacing := self class verticalSpacing. |
|
2819 |
horizontalSpacing := self class horizontalSpacing. |
|
2820 |
colorMap := Dictionary new. |
|
2821 |
catchChangeEvents := false. |
|
2822 |
rowFontAscent := 1. "/ dummy initialization |
|
2823 |
separatorSize := 1. "/ separators mode 2D |
|
2824 |
selectRowOnDefault := true. |
|
1749 | 2825 |
autoScroll := true. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2826 |
scrollRowWise := false. |
705 | 2827 |
! |
2828 |
||
2807 | 2829 |
mapped |
2830 |
"set selection (if any) after mapping" |
|
2831 |
||
2832 |
|idx| |
|
2833 |
||
2834 |
super mapped. |
|
2835 |
needFitColumns == true ifTrue:[ |
|
2836 |
self fitColumns |
|
2837 |
]. |
|
2838 |
(idx := self firstIndexSelected) ~~ 0 ifTrue:[ |
|
2839 |
self scrollToRowAt:idx colAt:0. |
|
2840 |
]. |
|
2841 |
! |
|
2842 |
||
542 | 2843 |
realize |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2844 |
"recompute contents and fit columns to view" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2845 |
|
1487 | 2846 |
|selection| |
2847 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2848 |
self bitGravity:#NorthWest. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2849 |
self recomputeHeightOfContents. |
1487 | 2850 |
selection := 0. |
2851 |
model notNil ifTrue:[ |
|
2852 |
(model respondsTo:#selectionIndex) ifTrue:[ |
|
2853 |
selection := model selectionIndex |
|
2854 |
] ifFalse:[ |
|
2855 |
model == listHolder ifFalse:[ |
|
2856 |
selection := model value |
|
2857 |
] |
|
2858 |
] |
|
2859 |
]. |
|
2860 |
self selectRowIndex:selection. |
|
542 | 2861 |
super realize. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2862 |
self fitColumns. |
2011
128778a6a31d
dont scroll to top on mapped
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
2863 |
! |
128778a6a31d
dont scroll to top on mapped
Claus Gittinger <cg@exept.de>
parents:
1971
diff
changeset
|
2864 |
|
2157 | 2865 |
release |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2866 |
"remove dependencies" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2867 |
|
2157 | 2868 |
self columnHolder:nil. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2869 |
listHolder removeDependent:self. |
2157 | 2870 |
columnAdaptor isValueModel ifTrue:[ |
2871 |
columnAdaptor removeDependent:self |
|
2872 |
]. |
|
2836 | 2873 |
beDependentOfRows ifTrue:[self makeIndependentOfRows]. |
2157 | 2874 |
super release |
607 | 2875 |
! ! |
2876 |
||
2877 |
!DSVColumnView methodsFor:'obsolete'! |
|
2878 |
||
2879 |
has3Dsepartors |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2880 |
"shouldn't be used any more" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2881 |
|
607 | 2882 |
^ self has3Dseparators |
2883 |
! |
|
2884 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2885 |
has3Dsepartors:aBool |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2886 |
"shouldn't be used any more" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2887 |
|
607 | 2888 |
self has3Dseparators:aBool |
542 | 2889 |
! ! |
2890 |
||
2891 |
!DSVColumnView methodsFor:'private'! |
|
2892 |
||
1951 | 2893 |
anyColumnHasBackground |
2894 |
columnDescriptors isNil ifTrue:[^ false]. |
|
2895 |
columnDescriptors do:[:eachCol | |
|
2896 |
|bg| |
|
2897 |
||
2898 |
bg := eachCol backgroundColor. |
|
2899 |
(bg notNil and:[bg isImageOrForm]) ifTrue:[^ true]. |
|
2900 |
eachCol bgSelector notNil ifTrue:[^ true]. |
|
2901 |
]. |
|
2902 |
^ false. |
|
2903 |
! |
|
2904 |
||
2905 |
anyColumnHasPotentialNonConstantBackground |
|
2906 |
columnDescriptors isNil ifTrue:[^ false]. |
|
2907 |
columnDescriptors do:[:eachCol | eachCol hasPotentialNonConstantBackground ifTrue:[^ true]]. |
|
2908 |
^ false. |
|
2909 |
! |
|
2910 |
||
1111 | 2911 |
destroyEditView |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2912 |
"destroy the edit view; release KeyboardForwarder" |
2730 | 2913 |
|
2914 |
|wg| |
|
2915 |
||
2695 | 2916 |
editValue notNil ifTrue:[ |
2917 |
editValue removeDependent:self. |
|
2918 |
editValue := nil |
|
2919 |
]. |
|
1111 | 2920 |
editView notNil ifTrue:[ |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2921 |
editView withAllSubViewsDo:[:aView | aView delegate:nil ]. |
1111 | 2922 |
editView destroy. |
2923 |
editView := nil. |
|
2730 | 2924 |
|
2925 |
wg := self windowGroup. |
|
2926 |
wg notNil ifTrue:[ |
|
2927 |
wg focusView:nil. |
|
2928 |
] |
|
1111 | 2929 |
]. |
2930 |
! |
|
2931 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2932 |
detectViewAt:aPoint in:aView |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2933 |
"returns the view at a point" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2934 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2935 |
aView isNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2936 |
^ nil |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2937 |
]. |
2019
0d2757149700
extracted common code to detectViewAt:aPoint.
Claus Gittinger <cg@exept.de>
parents:
2011
diff
changeset
|
2938 |
^ aView detectViewAt:aPoint. |
637 | 2939 |
! |
2940 |
||
542 | 2941 |
fitColumns |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2942 |
"fit columns to view; " |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
2943 |
|
2319
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
2944 |
|selectedColumn list width changed dX sz oldOrgX newOrgX| |
1487 | 2945 |
|
2946 |
preferredExtent isNil ifTrue:[ |
|
2947 |
self preferredExtent. |
|
2948 |
]. |
|
1484 | 2949 |
|
2950 |
columnDescriptors isEmpty ifTrue:[ |
|
2951 |
^ self |
|
2952 |
]. |
|
1492 | 2953 |
width := 0. |
2954 |
list := OrderedCollection new. |
|
1484 | 2955 |
|
2956 |
columnDescriptors do:[:aCol| |
|
2957 |
aCol canResize ifTrue:[ |
|
2958 |
changed := true. |
|
2959 |
aCol invalidate. |
|
1492 | 2960 |
aCol hasRelativeWidth ifFalse:[list add:aCol]. |
1484 | 2961 |
]. |
1492 | 2962 |
width := width + aCol minWidth. |
1484 | 2963 |
]. |
1492 | 2964 |
preferredExtent x:width. |
2965 |
width := self innerWidth - width. |
|
2966 |
||
2967 |
(list notEmpty and:[width > 0]) ifTrue:[ |
|
2968 |
sz := list size. |
|
2969 |
width >= sz ifTrue:[ |
|
2970 |
dX := width // sz. |
|
1484 | 2971 |
list do:[:aCol|aCol growWidth:dX]. |
1492 | 2972 |
width := width - (dX * sz). |
1484 | 2973 |
]. |
1492 | 2974 |
width ~~ 0 ifTrue:[list last growWidth:width]. |
1484 | 2975 |
]. |
1492 | 2976 |
|
612 | 2977 |
shown ifTrue:[ |
1492 | 2978 |
self invalidate. |
1487 | 2979 |
labelView invalidate. |
542 | 2980 |
|
1498 | 2981 |
(oldOrgX := viewOrigin x) ~~ 0 ifTrue:[ |
2982 |
"/ UPDATE VIEW-ORIGIN X |
|
2983 |
||
2984 |
width := preferredExtent x. |
|
2985 |
newOrgX := (width - self innerWidth) max:0. |
|
2986 |
||
2987 |
newOrgX < oldOrgX ifTrue:[ |
|
2988 |
self originWillChange. |
|
2989 |
viewOrigin := newOrgX @ (viewOrigin y). |
|
2990 |
self originChanged:((newOrgX - oldOrgX) @ 0). |
|
2991 |
] |
|
2992 |
]. |
|
2993 |
||
1930
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
2994 |
"/ cg: do not scroll to selection when a column-size is changed |
2319
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
2995 |
|
1930
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
2996 |
"/ self hasSelection ifTrue:[ |
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
2997 |
"/ editView notNil ifTrue:[ |
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
2998 |
"/ editView width:(self selectedColumn width - (2 * separatorSize)). |
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
2999 |
"/ ]. |
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
3000 |
"/ self scrollToSelection. |
31274c3264d6
do not scroll to selection when a column-size is changed
Claus Gittinger <cg@exept.de>
parents:
1926
diff
changeset
|
3001 |
"/ ]. |
2319
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3002 |
|
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3003 |
"/ ca: but resize the editView |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3004 |
|
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3005 |
editView notNil ifTrue:[ |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3006 |
selectedColumn := self selectedColumn. |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3007 |
selectedColumn notNil ifTrue:[ |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3008 |
editView width:(selectedColumn width - (2 * separatorSize)). |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3009 |
] |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3010 |
]. |
b75af47412ff
bug fix; if columns extent changed, update extent of editView
ca
parents:
2318
diff
changeset
|
3011 |
|
1498 | 3012 |
self contentsChanged. |
542 | 3013 |
]. |
3014 |
! |
|
3015 |
||
2816 | 3016 |
hasSelectables |
3017 |
columnDescriptors do:[:aCol| |
|
3018 |
(aCol rendererType == #rowSelector) ifFalse:[ |
|
3019 |
(aCol description canSelect) ifTrue:[^ true]. |
|
3020 |
] |
|
3021 |
]. |
|
3022 |
^ false. |
|
3023 |
! |
|
3024 |
||
542 | 3025 |
maxViewOriginY |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3026 |
"returns the maximum possible y of the view origin" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3027 |
|
542 | 3028 |
|y| |
3029 |
||
3030 |
y := self heightOfContents - self innerHeight. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3031 |
^ y max:0 |
542 | 3032 |
! |
3033 |
||
3034 |
updateEditViewOrigin |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3035 |
"update origin of the editView" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3036 |
|
542 | 3037 |
|x y| |
3038 |
||
3039 |
editView notNil ifTrue:[ |
|
607 | 3040 |
y := self yVisibleOfRowNr:(self firstIndexSelected). |
1498 | 3041 |
x := self xVisibleOfColNr:selectedColIndex. |
1112 | 3042 |
editView origin:(x @ y + separatorSize). |
542 | 3043 |
]. |
3044 |
! |
|
3045 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3046 |
xVisibleOfColNr:aColNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3047 |
"returns visible x assigned to a column number" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3048 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3049 |
|x |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3050 |
end "{ Class:SmallInteger }"| |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3051 |
|
542 | 3052 |
x := margin - viewOrigin x. |
1498 | 3053 |
aColNr > 1 ifTrue:[ |
1497 | 3054 |
end := aColNr - 1. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3055 |
columnDescriptors |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3056 |
from:1 |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3057 |
to:end |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3058 |
do:[:aCol | x := x + aCol width ] |
1497 | 3059 |
]. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3060 |
^ x |
542 | 3061 |
! |
3062 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3063 |
xVisibleToColNr:x |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3064 |
"returns the column number assigned to a physical x or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3065 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3066 |
|x0 |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3067 |
nr "{ Class:SmallInteger }"| |
542 | 3068 |
|
3069 |
x0 := x + viewOrigin x - margin. |
|
3070 |
nr := 1. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3071 |
columnDescriptors do:[:aCol | |
1951 | 3072 |
x0 := x0 - aCol width. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3073 |
x0 <= 0 ifTrue:[ ^ nr ]. |
542 | 3074 |
nr := nr + 1. |
3075 |
]. |
|
3076 |
^ nil. |
|
3077 |
! |
|
3078 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3079 |
yVisibleOfRowNr:aRowNr |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3080 |
"returns visible y assigned to the row number" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3081 |
|
542 | 3082 |
^ (aRowNr - 1) * rowHeight + margin - viewOrigin y |
3083 |
! |
|
3084 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3085 |
yVisibleToRowNr:y |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3086 |
"returns the row number assigned to a physical y or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3087 |
|
2398 | 3088 |
|rowNr| |
3089 |
||
3090 |
rowNr := (y + viewOrigin y - margin) // rowHeight + 1. |
|
3091 |
(rowNr between:1 and:(list size)) ifTrue:[ |
|
3092 |
^ rowNr |
|
3093 |
]. |
|
3094 |
^ nil |
|
542 | 3095 |
! ! |
3096 |
||
3097 |
!DSVColumnView methodsFor:'queries'! |
|
3098 |
||
2728
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3099 |
firstLineShown |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3100 |
"for protocol-compat. with listviews" |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3101 |
|
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3102 |
^ self indexOfFirstRowShown |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3103 |
! |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3104 |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3105 |
hasOpenEditor |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3106 |
^ editView notNil |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3107 |
! |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3108 |
|
563 | 3109 |
indexOfFirstRowShown |
2797 | 3110 |
"returns the index of the first shown row" |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3111 |
|
563 | 3112 |
|idx| |
3113 |
||
1498 | 3114 |
idx := (viewOrigin y // rowHeight) + 1. |
2797 | 3115 |
^ (idx max:1) |
3116 |
! |
|
3117 |
||
3118 |
indexOfLastRowShown |
|
3119 |
"returns the index of the last shown row" |
|
3120 |
||
3121 |
|idx| |
|
3122 |
||
3123 |
idx := (viewOrigin y + height - 1 // rowHeight) + 1. |
|
3124 |
^ (idx min:list size) |
|
563 | 3125 |
! |
3126 |
||
1805 | 3127 |
isEnabled |
3128 |
^ enableChannel value ~~ false |
|
3129 |
! |
|
3130 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3131 |
isRowSelectable:aRowNumber |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3132 |
"returne true if a row number is selectable" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3133 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3134 |
(aRowNumber notNil and:[ aRowNumber ~~ 0 ]) ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3135 |
selectConditionBlock isNil ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3136 |
^ true |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3137 |
]. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3138 |
^ (selectConditionBlock value:aRowNumber) |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3139 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3140 |
^ false |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3141 |
! |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3142 |
|
542 | 3143 |
numberOfColumns |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3144 |
"returns number of columns" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3145 |
|
542 | 3146 |
^ columnDescriptors size |
3147 |
! |
|
3148 |
||
3149 |
numberOfRows |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3150 |
"returns number of raws" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3151 |
|
1497 | 3152 |
^ list size |
542 | 3153 |
! |
3154 |
||
3155 |
rowHeight |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3156 |
"get the height of the highest row in pixels" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3157 |
|
542 | 3158 |
^ rowHeight |
3159 |
! |
|
3160 |
||
3161 |
separatorSize |
|
3162 |
"returns vertical/horizontal size of a separator dependent on the |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3163 |
3D effect." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3164 |
|
607 | 3165 |
^ separatorSize |
542 | 3166 |
! |
3167 |
||
3168 |
size |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3169 |
"returns number of raws" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3170 |
|
542 | 3171 |
^ list size |
3172 |
! ! |
|
3173 |
||
3174 |
!DSVColumnView methodsFor:'recomputation'! |
|
3175 |
||
647 | 3176 |
hasPreferredExtent |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3177 |
"returns true if preferred extent is accumulated" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3178 |
|
647 | 3179 |
^ preferredExtent notNil |
3180 |
! |
|
3181 |
||
542 | 3182 |
preferredExtent |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3183 |
"recompute preferred extent; raise notification" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3184 |
|
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
3185 |
|x| |
542 | 3186 |
|
3187 |
preferredExtent notNil ifTrue:[ |
|
3188 |
^ preferredExtent |
|
3189 |
]. |
|
3190 |
x := 3. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3191 |
columnDescriptors do:[:aCol | |
2592
ab64fbe4fb1e
resize #rowHeight if a display label does not match the computed rowHeight
ca
parents:
2580
diff
changeset
|
3192 |
minRowHeight := (aCol heightOfHighestRow) max:minRowHeight. |
1497 | 3193 |
x := x + (aCol minWidth). |
542 | 3194 |
]. |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3195 |
rowHeight := (minRowHeight + separatorSize + verticalSpacing |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3196 |
+ verticalSpacing + 1) |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3197 |
// 2 * 2. |
1497 | 3198 |
preferredExtent := x @ (list size * rowHeight). |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3199 |
rowFontAscent := font ascent. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3200 |
^ preferredExtent |
542 | 3201 |
! |
3202 |
||
3203 |
preferredExtentChanged |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3204 |
"called if the preffered extent changed" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3205 |
|
1497 | 3206 |
|x "{ Class:SmallInteger }" |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3207 |
y "{ Class:SmallInteger }"| |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3208 |
|
542 | 3209 |
y := viewOrigin y. |
3210 |
x := viewOrigin x. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3211 |
(y ~~ 0 or:[ x ~~ 0 ]) ifTrue:[ |
542 | 3212 |
self originWillChange. |
3213 |
viewOrigin := 0 @ 0. |
|
3214 |
preferredExtent := nil. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3215 |
self originChanged:(x negated @ y negated). |
542 | 3216 |
] |
3217 |
! |
|
3218 |
||
3219 |
recomputeHeightOfContents |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3220 |
"recompute height of contents( scrolling )" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3221 |
|
542 | 3222 |
preferredExtent notNil ifTrue:[ |
1497 | 3223 |
preferredExtent y:(rowHeight * list size) |
542 | 3224 |
] ifFalse:[ |
3225 |
self preferredExtent |
|
3226 |
]. |
|
3227 |
! ! |
|
3228 |
||
3229 |
!DSVColumnView methodsFor:'scroller interface'! |
|
3230 |
||
3231 |
innerHeight |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3232 |
"returns the inner height of the contents shown" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3233 |
|
542 | 3234 |
^ height - margin - margin |
3235 |
! |
|
3236 |
||
3237 |
verticalScrollStep |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3238 |
"return the amount to scroll when stepping up/down." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3239 |
|
542 | 3240 |
^ rowHeight |
3241 |
! |
|
3242 |
||
3243 |
viewOrigin |
|
3244 |
"return the viewOrigin; thats the coordinate of the contents |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3245 |
which is shown topLeft in the view." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3246 |
|
542 | 3247 |
^ viewOrigin |
3248 |
! |
|
3249 |
||
3250 |
widthOfContents |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3251 |
"return the width of the contents in pixels" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3252 |
|
647 | 3253 |
preferredExtent isNil ifTrue:[ |
3254 |
self preferredExtent |
|
3255 |
]. |
|
3256 |
^ preferredExtent x |
|
542 | 3257 |
! |
3258 |
||
3259 |
xOriginOfContents |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3260 |
"return the horizontal origin of the contents in pixels" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3261 |
|
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3262 |
^ viewOrigin x |
542 | 3263 |
! |
3264 |
||
3265 |
yOriginOfContents |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3266 |
"return the vertical origin of the contents in pixels" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3267 |
|
542 | 3268 |
^ viewOrigin y |
3269 |
! ! |
|
3270 |
||
3271 |
!DSVColumnView methodsFor:'scrolling'! |
|
3272 |
||
3273 |
scrollTo:anOrigin redraw:doRedraw |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3274 |
"change origin to have newOrigin be visible at the top-left." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3275 |
|
1497 | 3276 |
|newOrg dltOrg wg |
3277 |
h "{ Class:SmallInteger }" |
|
3278 |
w "{ Class:SmallInteger }" |
|
3279 |
x "{ Class:SmallInteger }" |
|
3280 |
x0 "{ Class:SmallInteger }" |
|
3281 |
x1 "{ Class:SmallInteger }" |
|
3282 |
y "{ Class:SmallInteger }" |
|
3283 |
y0 "{ Class:SmallInteger }" |
|
3284 |
y1 "{ Class:SmallInteger }" |
|
3285 |
dX "{ Class:SmallInteger }" |
|
3286 |
dY "{ Class:SmallInteger }" |
|
3287 |
innerHG "{ Class:SmallInteger }" |
|
3288 |
innerWT "{ Class:SmallInteger }" |
|
2146 | 3289 |
lMargin |
1497 | 3290 |
| |
2146 | 3291 |
|
542 | 3292 |
shown ifFalse:[ |
3293 |
^ self |
|
3294 |
]. |
|
612 | 3295 |
|
1448 | 3296 |
(wg := self windowGroup) notNil ifTrue:[ |
3297 |
wg processRealExposeEventsFor:self. |
|
542 | 3298 |
]. |
612 | 3299 |
|
542 | 3300 |
innerWT := self innerWidth. |
3301 |
innerHG := self innerHeight. |
|
3302 |
||
3303 |
h := viewOrigin y. |
|
3304 |
||
3305 |
(y := anOrigin y) > h ifTrue:[ "/ end of contents |
|
3306 |
y > (dY := self maxViewOriginY) ifTrue:[ |
|
3307 |
y := dY max:h |
|
3308 |
] |
|
3309 |
] ifFalse:[ |
|
3310 |
y := y max:0. |
|
3311 |
]. |
|
3312 |
||
3313 |
(x := anOrigin x) > 0 ifTrue:[ |
|
3314 |
x := x min:(self widthOfContents - innerWT). |
|
3315 |
]. |
|
3316 |
x := x max:0. |
|
3317 |
newOrg := (x @ y). |
|
3318 |
dltOrg := newOrg - viewOrigin. |
|
3319 |
dX := dltOrg x. |
|
3320 |
dY := dltOrg y. |
|
3321 |
||
3322 |
(dX == 0 and:[dY == 0]) ifTrue:[ |
|
3323 |
^ self |
|
3324 |
]. |
|
3325 |
self originWillChange. |
|
3326 |
viewOrigin := newOrg. |
|
3327 |
||
3328 |
doRedraw ifFalse:[ |
|
3329 |
^ self originChanged:dltOrg |
|
3330 |
]. |
|
3331 |
||
3332 |
dY ~~ 0 ifTrue:[ "/ SCROLL VERTICAL |
|
3333 |
dY := dY abs. |
|
3334 |
||
3335 |
(dX ~~ 0 or:[innerHG - dY < 20]) ifTrue:[ |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
3336 |
self invalidate. |
542 | 3337 |
] ifFalse:[ "/ COPY VERTICAL |
3338 |
y0 := y1 := margin + dY. |
|
3339 |
h := innerHG - dY. |
|
3340 |
||
3341 |
dltOrg y < 0 ifTrue:[y0 := margin. y := y0] |
|
3342 |
ifFalse:[y1 := margin. y := y1 + h]. |
|
3343 |
||
1460 | 3344 |
self copyFrom:self x:margin y:y0 toX:margin y:y1 width:innerWT height:h async:false. |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
3345 |
self invalidateX:margin y:y width:innerWT height:(innerHG - h). |
542 | 3346 |
] |
3347 |
] ifFalse:[ "/ SCROLL HORIZONTAL |
|
3348 |
dX := dX abs. |
|
3349 |
||
3350 |
innerWT - dX < 20 ifTrue:[ |
|
1487 | 3351 |
labelView invalidate. |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
3352 |
self invalidate. |
542 | 3353 |
] ifFalse:[ "/ COPY HORIZONTAL |
643 | 3354 |
x0 := x1 := dX + margin. |
2146 | 3355 |
w := width - dX. |
3356 |
lMargin := labelView margin. |
|
3357 |
||
3358 |
dltOrg x < 0 ifTrue:[ |
|
3359 |
" ->" |
|
3360 |
x0 := x := margin. |
|
3361 |
self copyFrom:self x:margin y:margin toX:margin+dX y:margin width:innerWT-dX height:innerHG async:false. |
|
3362 |
self invalidateX:margin y:margin width:dX height:innerHG. |
|
3363 |
||
3364 |
labelView notNil ifTrue:[ |
|
3365 |
labelView copyFrom:labelView x:lMargin y:lMargin toX:lMargin+dX y:lMargin width:labelView innerWidth-dX height:labelView innerHeight async:false. |
|
3366 |
labelView invalidateX:lMargin y:lMargin width:dX height:labelView innerHeight. |
|
3367 |
]. |
|
3368 |
] ifFalse:[ |
|
3369 |
x1 := margin. x := w. |
|
3370 |
self copyFrom:self x:margin+dX y:margin toX:margin y:margin width:innerWT-dX height:innerHG async:false. |
|
3371 |
self invalidateX:width-margin-dX y:margin width:dX height:innerHG. |
|
3372 |
||
3373 |
labelView notNil ifTrue:[ |
|
3374 |
labelView copyFrom:labelView x:lMargin+dX y:lMargin toX:lMargin y:lMargin width:labelView innerWidth-dX height:labelView innerHeight async:false. |
|
3375 |
labelView invalidateX:labelView width-lMargin-dX y:lMargin width:dX height:labelView innerHeight. |
|
3376 |
]. |
|
1487 | 3377 |
]. |
2146 | 3378 |
labelView repairDamage. |
542 | 3379 |
] |
3380 |
]. |
|
3381 |
self originChanged:dltOrg. |
|
1123
ea32a2e3d44d
care for sensor becoming nil while handling exposeEvents
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
3382 |
|
2458
0411397ef0a2
readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
3383 |
wg notNil ifTrue:[ |
0411397ef0a2
readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
3384 |
wg processRealExposeEventsFor:self. |
0411397ef0a2
readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
3385 |
]. |
0411397ef0a2
readraw after scroll: process expose events.
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
3386 |
|
1123
ea32a2e3d44d
care for sensor becoming nil while handling exposeEvents
Claus Gittinger <cg@exept.de>
parents:
1115
diff
changeset
|
3387 |
"Modified: / 7.9.1998 / 16:39:49 / cg" |
542 | 3388 |
! |
3389 |
||
2728
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3390 |
scrollToLine:aLineNr |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3391 |
"for compat. with listViews" |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3392 |
|
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3393 |
self scrollToRowAt:aLineNr colAt:1. |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3394 |
! |
a53382733524
+scrollToLine (listView compat.)
Claus Gittinger <cg@exept.de>
parents:
2722
diff
changeset
|
3395 |
|
542 | 3396 |
scrollToRowAt:aRowNr colAt:aColNr |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3397 |
"make row at a row number in column at a column number visible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3398 |
|
1497 | 3399 |
|x "{ Class:SmallInteger }" |
3400 |
y "{ Class:SmallInteger }" |
|
3401 |
l "{ Class:SmallInteger }" |
|
3402 |
dY "{ Class:SmallInteger }" |
|
3403 |
dX "{ Class:SmallInteger }" |
|
3404 |
| |
|
3405 |
||
3406 |
( (aRowNr between:1 and:(list size)) |
|
3407 |
and:[aColNr between:0 and:(columnDescriptors size)] |
|
542 | 3408 |
) ifFalse:[ |
3409 |
^ self |
|
3410 |
]. |
|
3411 |
||
3412 |
dY := dX := 0. |
|
3413 |
y := self yVisibleOfRowNr:aRowNr. |
|
3414 |
||
3415 |
y < margin ifTrue:[ |
|
3416 |
dY := margin - y. |
|
3417 |
] ifFalse:[ |
|
3418 |
y := y + rowHeight. |
|
3419 |
l := height - margin. |
|
3420 |
y > l ifTrue:[dY := l - y] |
|
3421 |
]. |
|
3422 |
||
3423 |
aColNr == 0 ifTrue:[ |
|
3424 |
dY == 0 ifTrue:[^ self]. |
|
3425 |
dX := 0. |
|
3426 |
] ifFalse:[ |
|
3427 |
x := self xVisibleOfColNr:aColNr. |
|
3428 |
||
1163 | 3429 |
x <= margin ifTrue:[ |
542 | 3430 |
dX := margin - x |
3431 |
] ifFalse:[ |
|
1497 | 3432 |
x := x + (columnDescriptors at:aColNr) width. |
542 | 3433 |
l := width - margin. |
3434 |
x > l ifTrue:[dX := l - x] |
|
3435 |
] |
|
3436 |
]. |
|
3437 |
||
3438 |
(dX == 0 and:[dY == 0]) ifFalse:[ |
|
3439 |
self scrollTo:(viewOrigin - (dX @ dY)). |
|
3440 |
] |
|
3441 |
! |
|
3442 |
||
3443 |
scrollToSelection |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3444 |
"make selection visible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3445 |
|
607 | 3446 |
|rowNr| |
3447 |
||
3448 |
(rowNr := self firstIndexSelected) ~~ 0 ifTrue:[ |
|
1497 | 3449 |
self scrollToRowAt:rowNr colAt:selectedColIndex |
542 | 3450 |
] |
1506 | 3451 |
! |
3452 |
||
3453 |
scrollVerticalTo:aPixelOffset |
|
3454 |
"change origin to make aPixelOffset be the top line" |
|
3455 |
||
3456 |
|orgX orgY| |
|
3457 |
||
3458 |
orgX := viewOrigin x. |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3459 |
scrollRowWise ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3460 |
orgY := (aPixelOffset + rowHeight - 1) // rowHeight * rowHeight. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3461 |
] ifFalse:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3462 |
orgY := aPixelOffset. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3463 |
]. |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3464 |
^ self scrollTo:(orgX @ orgY). |
1749 | 3465 |
! |
3466 |
||
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3467 |
startAutoScroll:aSelectorOrBlock distance:aDistance |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3468 |
"setup for auto-scroll (when button-press-moving below/above view); |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3469 |
- timeDelta for scroll is computed from distance" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3470 |
|
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3471 |
|timeDelta scrollBlock| |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3472 |
|
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3473 |
autoScroll ifFalse:[ |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3474 |
self stopAutoScroll. |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3475 |
^ self |
1749 | 3476 |
]. |
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3477 |
|
1749 | 3478 |
autoScrollBlock notNil ifTrue:[ |
3479 |
Processor removeTimedBlock:autoScrollBlock. |
|
3480 |
] ifFalse:[ |
|
3481 |
self compressMotionEvents:false. |
|
3482 |
]. |
|
3483 |
||
3484 |
timeDelta := 0.5 / (aDistance abs). |
|
3485 |
||
2670
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3486 |
scrollBlock := |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3487 |
[ |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3488 |
aSelectorOrBlock isSymbol ifTrue:[ |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3489 |
self perform:aSelectorOrBlock. |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3490 |
] ifFalse:[ |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3491 |
aSelectorOrBlock value |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3492 |
]. |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3493 |
autoScrollBlock notNil ifTrue:[ |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3494 |
Processor addTimedBlock:autoScrollBlock afterSeconds:timeDelta. |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3495 |
] |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3496 |
]. |
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3497 |
|
27dacfff1d6d
autoScroll: let timedBlock push an event which performs the scroll
Claus Gittinger <cg@exept.de>
parents:
2637
diff
changeset
|
3498 |
autoScrollBlock := [self sensor pushUserEvent:#value for:scrollBlock]. |
1749 | 3499 |
Processor addTimedBlock:autoScrollBlock afterSeconds:timeDelta. |
3500 |
! |
|
3501 |
||
3502 |
stopAutoScroll |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3503 |
"stop any autoScroll" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3504 |
|
1749 | 3505 |
autoScrollBlock notNil ifTrue:[ |
3506 |
Processor removeTimedBlock:autoScrollBlock. |
|
3507 |
autoScrollBlock := nil. |
|
3508 |
self compressMotionEvents:true. |
|
3509 |
]. |
|
542 | 3510 |
! ! |
3511 |
||
3512 |
!DSVColumnView methodsFor:'selection'! |
|
3513 |
||
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3514 |
addRowToSelection:aRowNr |
2370 | 3515 |
"add a row to the selection |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3516 |
if a column is selected, the column will be closed" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3517 |
|
2370 | 3518 |
|newSelection| |
3519 |
||
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3520 |
(self isRowSelectable:aRowNr) ifFalse:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3521 |
^ self |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3522 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3523 |
|
2398 | 3524 |
self numberOfSelections == 0 ifTrue:[ |
3525 |
self selectColIndex:0 rowIndex:aRowNr. |
|
2370 | 3526 |
^ self |
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3527 |
]. |
2398 | 3528 |
(self isInSelection:aRowNr) ifTrue:[^ self]. |
3529 |
||
3530 |
multipleSelectOk ifFalse:[ |
|
3531 |
self selectColIndex:0 rowIndex:aRowNr. |
|
2370 | 3532 |
^ self |
3533 |
]. |
|
2371 | 3534 |
newSelection := selectedRowIndex copyWith:aRowNr. |
2370 | 3535 |
|
3536 |
selectedColIndex ~~ 0 ifTrue:[ |
|
3537 |
self selectColIndex:0 rowIndex:newSelection. |
|
2398 | 3538 |
] ifFalse:[ |
3539 |
selectedRowIndex := selectedRowIndex copyWith:aRowNr. |
|
3540 |
self invalidateRowAt:aRowNr. |
|
3541 |
self selectionChanged. |
|
2370 | 3542 |
]. |
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3543 |
! |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3544 |
|
607 | 3545 |
deselect |
3546 |
self selectColIndex:0 rowIndex:0 |
|
3547 |
! |
|
3548 |
||
3549 |
firstIndexSelected |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3550 |
"returns index of first row selected or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3551 |
|
607 | 3552 |
multipleSelectOk ifFalse:[ |
3553 |
^ selectedRowIndex |
|
3554 |
]. |
|
3555 |
selectedRowIndex size ~~ 0 ifTrue:[ |
|
3556 |
^ selectedRowIndex at:1 |
|
3557 |
]. |
|
3558 |
^ 0 |
|
3559 |
! |
|
3560 |
||
2695 | 3561 |
forceAcceptInEditor |
2722 | 3562 |
editView notNil ifTrue:[ |
3563 |
editView |
|
3564 |
allSubViewsDo:[:aSubView | |
|
3565 |
(aSubView respondsTo:#accept) ifTrue:[ |
|
3566 |
aSubView accept |
|
3567 |
]. |
|
3568 |
] |
|
3569 |
] |
|
2695 | 3570 |
! |
3571 |
||
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3572 |
hasRowSelection |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3573 |
"returns true if a selection exists, and its a complete row |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3574 |
(as opposed to either no selection, or a columnSelection)" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3575 |
|
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3576 |
^ self hasSelection and:[selectedColIndex == 0] |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3577 |
! |
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3578 |
|
542 | 3579 |
hasSelection |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3580 |
"returns true if a selection exists" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3581 |
|
607 | 3582 |
^ self numberOfSelections ~~ 0 |
542 | 3583 |
! |
3584 |
||
607 | 3585 |
isInSelection:aRowNr |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3586 |
"returns true, if row, aRowNr is in the selection" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3587 |
|
607 | 3588 |
aRowNr ~~ 0 ifTrue:[ |
3589 |
multipleSelectOk ifFalse:[ |
|
3590 |
^ aRowNr == selectedRowIndex |
|
3591 |
]. |
|
3592 |
selectedRowIndex size ~~ 0 ifTrue:[ |
|
3593 |
^ selectedRowIndex includes:aRowNr |
|
3594 |
] |
|
3595 |
]. |
|
3596 |
^ false |
|
3597 |
! |
|
3598 |
||
647 | 3599 |
isRowSelected:aRowNr |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3600 |
"returns true, if row is in the selection" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3601 |
|
647 | 3602 |
selectedColIndex == 0 ifTrue:[ |
3603 |
^ self isInSelection:aRowNr |
|
3604 |
]. |
|
3605 |
^ false |
|
3606 |
! |
|
3607 |
||
2263 | 3608 |
isRowVisible:aRowNr |
3609 |
|y h| |
|
3610 |
||
3611 |
h := rowHeight. |
|
3612 |
y := self yVisibleOfRowNr:aRowNr. |
|
3613 |
||
3614 |
y < margin ifTrue:[ |
|
3615 |
(h := h + y) <= margin ifTrue:[ |
|
3616 |
^ false |
|
3617 |
]. |
|
3618 |
] ifFalse:[ |
|
3619 |
y >= (height-margin) ifTrue:[^ false]. |
|
3620 |
]. |
|
3621 |
^ true |
|
3622 |
! |
|
3623 |
||
607 | 3624 |
isSelected:aRowNr inColumn:aColNr |
612 | 3625 |
"returns true if cell in a row; a row number, in a column, a column |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3626 |
number is selected." |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3627 |
|
1042 | 3628 |
multipleSelectOk ifFalse:[ |
3629 |
aRowNr ~~ selectedRowIndex ifTrue:[ |
|
3630 |
^ false |
|
3631 |
] |
|
3632 |
] ifTrue:[ |
|
3633 |
(selectedRowIndex size ~~ 0 and:[selectedRowIndex includes:aRowNr]) ifFalse:[ |
|
3634 |
^ false |
|
3635 |
] |
|
607 | 3636 |
]. |
1042 | 3637 |
^ (selectedColIndex == 0 or:[selectedColIndex == aColNr]) |
607 | 3638 |
! |
3639 |
||
2276
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3640 |
isSelectionVisibleIn:anExtentPoint |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3641 |
self selectionIndicesDo:[:selRowNr | |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3642 |
|y| |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3643 |
|
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3644 |
y := self yVisibleOfRowNr:selRowNr. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3645 |
(y between:margin and:(anExtentPoint y - margin)) ifTrue:[^ true]. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3646 |
]. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3647 |
^ false. |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3648 |
! |
19de72502874
dont make selection visible after resize, if it was not visible before
ca
parents:
2263
diff
changeset
|
3649 |
|
809 | 3650 |
lastIndexSelected |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3651 |
"returns index of last selected row or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3652 |
|
809 | 3653 |
multipleSelectOk ifFalse:[ |
3654 |
^ selectedRowIndex |
|
3655 |
]. |
|
3656 |
selectedRowIndex size ~~ 0 ifTrue:[ |
|
3657 |
^ selectedRowIndex last |
|
3658 |
]. |
|
3659 |
^ 0 |
|
3660 |
! |
|
3661 |
||
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3662 |
makeLineVisible:aLine |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3663 |
"scroll to make aLine visible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3664 |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3665 |
|colNr| |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3666 |
|
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3667 |
aLine == 0 ifTrue:[^ self]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3668 |
(self isRowVisible:aLine) ifTrue:[^ self]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3669 |
|
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3670 |
(selectedColIndex notNil and:[selectedColIndex ~~ 0]) ifTrue:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3671 |
colNr := selectedColIndex |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3672 |
] ifFalse:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3673 |
colNr := 1 |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3674 |
]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3675 |
|
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3676 |
self scrollToRowAt:aLine colAt:colNr |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3677 |
! |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3678 |
|
2246 | 3679 |
makeSelectionVisible |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3680 |
"scroll to make the selection line visible" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3681 |
|
2246 | 3682 |
|rowNr colNr| |
3683 |
||
3684 |
rowNr := self firstIndexSelected. |
|
3685 |
rowNr == 0 ifTrue:[^ self]. |
|
3686 |
||
3687 |
(selectedColIndex notNil and:[selectedColIndex ~~ 0]) ifTrue:[ |
|
3688 |
colNr := selectedColIndex |
|
3689 |
] ifFalse:[ |
|
3690 |
colNr := 1 |
|
3691 |
]. |
|
3692 |
self scrollToRowAt:rowNr colAt:colNr |
|
3693 |
! |
|
3694 |
||
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3695 |
maxIndexSelected |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3696 |
"return the largest index selected or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3697 |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3698 |
multipleSelectOk ifFalse:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3699 |
^ selectedRowIndex |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3700 |
]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3701 |
selectedRowIndex size ~~ 0 ifTrue:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3702 |
^ selectedRowIndex max |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3703 |
]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3704 |
^ 0 |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3705 |
! |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3706 |
|
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3707 |
minIndexSelected |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3708 |
"return the smallest index selected or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3709 |
|
2363
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3710 |
multipleSelectOk ifFalse:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3711 |
^ selectedRowIndex |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3712 |
]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3713 |
selectedRowIndex size ~~ 0 ifTrue:[ |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3714 |
^ selectedRowIndex min |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3715 |
]. |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3716 |
^ 0 |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3717 |
! |
72cda227e48d
shift + cursorUp/Down adds to selection
Claus Gittinger <cg@exept.de>
parents:
2333
diff
changeset
|
3718 |
|
607 | 3719 |
numberOfSelections |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3720 |
"return the number of selected rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3721 |
|
607 | 3722 |
multipleSelectOk ifFalse:[ |
3723 |
^ selectedRowIndex ~~ 0 ifTrue:[1] ifFalse:[0] |
|
3724 |
]. |
|
3725 |
^ selectedRowIndex size |
|
542 | 3726 |
! |
3727 |
||
2398 | 3728 |
removeRowFromSelection:aRowNr |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3729 |
"remove a row from the selection" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3730 |
|
2398 | 3731 |
(self isInSelection:aRowNr) ifFalse:[^ self]. |
3732 |
||
3733 |
self numberOfSelections == 1 ifTrue:[ |
|
3734 |
self deselect. |
|
3735 |
] ifFalse:[ |
|
3736 |
selectedRowIndex := selectedRowIndex copyWithout:aRowNr. |
|
3737 |
self invalidateRowAt:aRowNr. |
|
3738 |
self selectionChanged. |
|
3739 |
]. |
|
3740 |
! |
|
3741 |
||
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
3742 |
selectAllRows |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3743 |
"select all" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3744 |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3745 |
multipleSelectOk ifFalse:[^ self]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3746 |
|
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3747 |
selectedRowIndex := (1 to:list size) select:[:idx| self isRowSelectable:idx ]. |
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
3748 |
self selectionChanged. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3749 |
self invalidate. |
1947
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
3750 |
! |
1e11b36633b2
added selectAllRows (Alt-Shift-A) key function
Claus Gittinger <cg@exept.de>
parents:
1946
diff
changeset
|
3751 |
|
542 | 3752 |
selectColIndex:aColNr rowIndex:aRowNr |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3753 |
"change selection with notification" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3754 |
|
542 | 3755 |
|oC oR| |
3756 |
||
607 | 3757 |
oC := self selectedColIndex. |
3758 |
oR := self selectedRowIndex. |
|
542 | 3759 |
|
3760 |
self setSelectColIndex:aColNr rowIndex:aRowNr. |
|
3761 |
||
607 | 3762 |
(oC ~~ self selectedColIndex or:[oR ~= self selectedRowIndex]) ifTrue:[ |
542 | 3763 |
self selectionChanged |
3764 |
]. |
|
3765 |
! |
|
3766 |
||
607 | 3767 |
selectRow:something |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3768 |
"select a row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3769 |
|
607 | 3770 |
^ self selectedRowIndex:something |
542 | 3771 |
! |
3772 |
||
809 | 3773 |
selectRowAt:rowNr colAt:colNr atPoint:aPoint |
3774 |
|v p| |
|
3775 |
||
3776 |
self selectColIndex:colNr rowIndex:rowNr. |
|
3777 |
||
2044
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
3778 |
((v := self detectViewAt:aPoint ignoreInvisible:true) notNil |
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
3779 |
and:[v ~~ self]) |
8e36106065f0
fixed: click on a checkToggle (buttonPress event)
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
3780 |
ifTrue:[ |
2019
0d2757149700
extracted common code to detectViewAt:aPoint.
Claus Gittinger <cg@exept.de>
parents:
2011
diff
changeset
|
3781 |
p := device translatePoint:aPoint fromView:self toView:v. |
2125 | 3782 |
"/ simulate clicking into the editor |
2470 | 3783 |
self sensor |
3784 |
pushEvent:(WindowEvent buttonPress:#select x:p x y:p y view:v); |
|
3785 |
pushEvent:(WindowEvent buttonRelease:#select x:p x y:p y view:v) |
|
809 | 3786 |
]. |
3787 |
! |
|
3788 |
||
2398 | 3789 |
selectRowFrom:start to:stop |
2470 | 3790 |
|step oldSelection newSelection| |
2398 | 3791 |
|
3792 |
start == stop ifTrue:[ |
|
3793 |
self selectColIndex:0 rowIndex:start. |
|
3794 |
^ self |
|
3795 |
]. |
|
3796 |
||
2470 | 3797 |
step := (start <= stop) ifTrue:1 ifFalse:-1. |
3798 |
||
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
3799 |
newSelection := (start to:stop by:step) select:[:idx| self isRowSelectable: idx ]. |
2398 | 3800 |
|
3801 |
selectedColIndex ~~ 0 ifTrue:[ |
|
2470 | 3802 |
self selectColIndex:0 rowIndex:newSelection. |
2398 | 3803 |
^ self |
3804 |
]. |
|
2470 | 3805 |
|
3806 |
oldSelection := selectedRowIndex ? #(). |
|
3807 |
selectedRowIndex := newSelection. |
|
3808 |
||
3809 |
newSelection |
|
3810 |
select:[:i | (oldSelection includes:i) not] |
|
3811 |
thenDo:[:i | self invalidateRowAt:i]. |
|
3812 |
||
3813 |
oldSelection |
|
3814 |
select:[:i | (newSelection includes:i) not] |
|
3815 |
thenDo:[:i | self invalidateRowAt:i]. |
|
3816 |
||
2398 | 3817 |
self selectionChanged. |
3818 |
! |
|
3819 |
||
607 | 3820 |
selectRowIndex:something |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3821 |
"set selection of rows" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3822 |
|
607 | 3823 |
self selectColIndex:selectedColIndex rowIndex:something |
542 | 3824 |
! |
3825 |
||
3826 |
selectedColIndex |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3827 |
"returns selected column number or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3828 |
|
542 | 3829 |
^ selectedColIndex |
3830 |
! |
|
3831 |
||
3832 |
selectedColumn |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3833 |
"returns selected column or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3834 |
|
542 | 3835 |
^ columnDescriptors at:selectedColIndex ifAbsent:nil. |
3836 |
! |
|
3837 |
||
3838 |
selectedRow |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3839 |
"returns the selected row (or collection if multiple selection) or nil" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3840 |
|
607 | 3841 |
multipleSelectOk ifFalse:[ |
3842 |
^ self at:selectedRowIndex ifAbsent:nil |
|
3843 |
]. |
|
3844 |
selectedRowIndex size ~~ 0 ifTrue:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3845 |
^ selectedRowIndex collect:[:i | self at:i ] |
607 | 3846 |
]. |
3847 |
^ nil |
|
3848 |
! |
|
3849 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3850 |
selectedRow:something |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3851 |
"select something" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3852 |
|
607 | 3853 |
self selectedRowIndex:something |
542 | 3854 |
! |
3855 |
||
3856 |
selectedRowIndex |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3857 |
"returns selected row number or 0" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3858 |
|
542 | 3859 |
^ selectedRowIndex |
3860 |
! |
|
3861 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3862 |
selectedRowIndex:something |
2470 | 3863 |
"set the row selection (single or multiple rows); |
2816 | 3864 |
does NOT change the selected column." |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3865 |
|
607 | 3866 |
self selectColIndex:selectedColIndex rowIndex:something |
542 | 3867 |
! |
3868 |
||
3869 |
selectionChanged |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3870 |
"selection has changed" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3871 |
|
1487 | 3872 |
|val| |
3873 |
||
3874 |
model notNil ifTrue:[ |
|
3875 |
val := self selectedRowIndex copy. |
|
3876 |
(model respondsTo:#selectionIndex:) ifTrue:[ |
|
3877 |
model selectionIndex:val |
|
3878 |
] ifFalse:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3879 |
useIndex ifFalse:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3880 |
model value:(self selectedRow) |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3881 |
] ifTrue:[ |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3882 |
model value:val |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3883 |
] |
1487 | 3884 |
] |
3885 |
]. |
|
542 | 3886 |
actionBlock notNil ifTrue:[ |
607 | 3887 |
actionBlock value:(self selectedRowIndex) |
3888 |
] |
|
3889 |
! |
|
3890 |
||
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3891 |
selectionIndicesDo:aOneArgBlock |
607 | 3892 |
"evaluate block on each row selected; the argument to the row |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3893 |
is the index of the selected row" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3894 |
|
607 | 3895 |
multipleSelectOk ifFalse:[ |
3896 |
selectedRowIndex ~~ 0 ifTrue:[ |
|
3897 |
aOneArgBlock value:selectedRowIndex |
|
3898 |
] |
|
3899 |
] ifTrue:[ |
|
3900 |
selectedRowIndex size ~~ 0 ifTrue:[ |
|
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3901 |
selectedRowIndex do:aOneArgBlock |
607 | 3902 |
] |
542 | 3903 |
] |
3904 |
! |
|
3905 |
||
2470 | 3906 |
setSelectColIndex:colNrArg rowIndex:rowNrArg |
2714
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3907 |
"change selection without notification" |
f0d55d0e204d
categories; AEG stuff removed
Claus Gittinger <cg@exept.de>
parents:
2711
diff
changeset
|
3908 |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3909 |
|editSpec rowNr colNr newCol oldCol oldRow sensor sglSelRow oldSz |
2730 | 3910 |
keyBrdFwd filter edView wg| |
542 | 3911 |
|
2470 | 3912 |
rowNr := self validateSelection:rowNrArg. |
2695 | 3913 |
|
2470 | 3914 |
colNr := colNrArg. |
2695 | 3915 |
rowNr == 0 ifTrue:[ |
3916 |
colNr := 0. |
|
3917 |
] ifFalse:[ |
|
3918 |
multipleSelectOk ifTrue:[ |
|
3919 |
(rowNr size == 1) ifFalse:[colNr := 0] |
|
3920 |
]. |
|
542 | 3921 |
]. |
3922 |
||
607 | 3923 |
(colNr := colNr ? 0) ~~ 0 ifTrue:[ |
3924 |
newCol := self columnAt:colNr. |
|
3925 |
newCol rendererType == #rowSelector ifTrue:[ |
|
3926 |
colNr := 0. |
|
3927 |
newCol := nil |
|
3928 |
] ifFalse:[ |
|
3929 |
multipleSelectOk ifTrue:[sglSelRow := rowNr at:1] |
|
3930 |
ifFalse:[sglSelRow := rowNr]. |
|
3931 |
||
3932 |
(newCol canSelect:sglSelRow) ifFalse:[ |
|
3933 |
newCol := nil. |
|
1112 | 3934 |
colNr := 0. |
3935 |
||
3936 |
selectRowOnDefault ifFalse:[ |
|
3937 |
rowNr := multipleSelectOk ifFalse:[0] ifTrue:[nil] |
|
3938 |
] |
|
607 | 3939 |
] |
3940 |
] |
|
3941 |
]. |
|
3942 |
||
3943 |
(rowNr = selectedRowIndex and:[colNr == selectedColIndex]) ifTrue:[ |
|
643 | 3944 |
^ self |
542 | 3945 |
]. |
3946 |
||
3947 |
"/ release old selection |
|
3948 |
||
612 | 3949 |
oldSz := self numberOfSelections. |
542 | 3950 |
oldCol := selectedColIndex. |
3951 |
oldRow := selectedRowIndex. |
|
612 | 3952 |
|
3953 |
oldSz == 1 ifTrue:[ |
|
3954 |
multipleSelectOk ifTrue:[oldRow := oldRow at:1]. |
|
2695 | 3955 |
self updateColumnFromEditValueAndDestroyEditView. |
612 | 3956 |
]. |
1968
857cd9f14570
fixed store-into-wrong-col bug (imageEditors color table)
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
3957 |
selectedRowIndex := rowNr. |
857cd9f14570
fixed store-into-wrong-col bug (imageEditors color table)
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
3958 |
selectedColIndex := colNr. |
857cd9f14570
fixed store-into-wrong-col bug (imageEditors color table)
Claus Gittinger <cg@exept.de>
parents:
1959
diff
changeset
|
3959 |
|
612 | 3960 |
shown ifFalse:[^ self ]. |
542 | 3961 |
|
2730 | 3962 |
wg := self windowGroup. |
3963 |
||
618 | 3964 |
oldSz > 1 ifTrue:[ "/ redraw old selection |
3965 |
oldRow do:[:aRowNr| "/ unselected if visible |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
3966 |
self invalidateRowAt:aRowNr colAt:0 |
618 | 3967 |
] |
3968 |
] ifFalse:[ |
|
3969 |
oldSz == 1 ifTrue:[ |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
3970 |
self invalidateRowAt:oldRow colAt:oldCol |
618 | 3971 |
] |
3972 |
]. |
|
3973 |
||
542 | 3974 |
"/ show new selection |
3975 |
||
3976 |
newCol notNil ifTrue:[ |
|
607 | 3977 |
self scrollToRowAt:sglSelRow colAt:colNr. |
833 | 3978 |
editSpec := newCol editorAt:sglSelRow. |
3979 |
||
3980 |
editSpec notNil ifTrue:[ |
|
1112 | 3981 |
editView := SimpleView extent:( (newCol width - (2 * separatorSize)) |
3982 |
@ (rowHeight - (2 * separatorSize)) |
|
607 | 3983 |
) |
3984 |
in:self. |
|
542 | 3985 |
self updateEditViewOrigin. |
1112 | 3986 |
|
1134 | 3987 |
(newCol containsText or:[newCol showSelectionHighLighted not]) ifTrue:[ |
1565 | 3988 |
editView viewBackground:(newCol backgroundColorAt:sglSelRow) |
1112 | 3989 |
] ifFalse:[ |
2151
50f8723054e7
selected row is highlighted over the full width;
Claus Gittinger <cg@exept.de>
parents:
2146
diff
changeset
|
3990 |
editView viewBackground:selectionBackgroundColor |
1112 | 3991 |
]. |
2816 | 3992 |
edView := editSpec editor. |
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
3993 |
editView add:edView. |
2816 | 3994 |
editSpec isStandardEditorSpec ifTrue:[ |
3995 |
filter := [:aKey| #(#Tab #CursorUp #CursorDown #Return) includes:aKey] |
|
1149
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3996 |
] ifFalse:[ |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3997 |
filter := [:aKey| aKey == #Tab] |
c212f122c8b3
allow collections of string and icons for a cell label
Claus Gittinger <cg@exept.de>
parents:
1136
diff
changeset
|
3998 |
]. |
2816 | 3999 |
keyBrdFwd := KeyboardForwarder toView:self condition:nil filter:filter. |
1111 | 4000 |
|
4001 |
editView withAllSubViewsDo:[:aView| |
|
1112 | 4002 |
aView delegate:keyBrdFwd. |
4003 |
aView font:font. |
|
1111 | 4004 |
]. |
4005 |
||
2816 | 4006 |
(editValue := editSpec model) notNil ifTrue:[ |
809 | 4007 |
editValue addDependent:self. |
648 | 4008 |
]. |
542 | 4009 |
editView realize. |
1665
51c444bfe5ae
default behavour tabing; not yet configurable (next step)
ca
parents:
1661
diff
changeset
|
4010 |
edView canTab:true. |
2730 | 4011 |
wg notNil ifTrue:[ wg focusView:edView ]. |
542 | 4012 |
] ifFalse:[ |
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
4013 |
self invalidateRowAt:sglSelRow colAt:colNr |
612 | 4014 |
]. |
4015 |
] ifFalse:[ |
|
1408
1cda0a4fb566
use invalidate... insteat of redraw...
Claus Gittinger <cg@exept.de>
parents:
1333
diff
changeset
|
4016 |
self selectionIndicesDo:[:i| self invalidateRowAt:i colAt:0 ]. |
612 | 4017 |
self scrollToRowAt:(self firstIndexSelected) colAt:0 |
4018 |
]. |
|
4019 |
||
4020 |
sensor := self sensor. "/ catch expose events |
|
4021 |
||
4022 |
[sensor hasExposeEventFor:nil] whileTrue:[ |
|
2730 | 4023 |
wg notNil ifTrue:[ wg processExposeEvents ] |
612 | 4024 |
]. |
4025 |
||
1661 | 4026 |
"Modified: / 30.1.2000 / 12:18:25 / cg" |
607 | 4027 |
! |
4028 |
||
2695 | 4029 |
updateColumnFromEditValueAndDestroyEditView |
4030 |
|edValue selCol selRow| |
|
4031 |
||
4032 |
selCol := selectedColIndex. |
|
4033 |
selRow := selectedRowIndex. |
|
4034 |
editValue notNil ifTrue:[ |
|
4035 |
editValue removeDependent:self |
|
4036 |
]. |
|
4037 |
editView notNil ifTrue:[ |
|
4038 |
self forceAcceptInEditor |
|
4039 |
]. |
|
4040 |
editValue notNil ifTrue:[ |
|
4041 |
edValue := editValue value. |
|
4042 |
edValue isSequenceable ifTrue:[ |
|
4043 |
edValue size == 0 ifTrue:[ |
|
4044 |
edValue := nil |
|
4045 |
] ifFalse:[ |
|
4046 |
edValue isString ifFalse:[ |
|
4047 |
edValue := edValue select:[:el | el notNil ]. |
|
4048 |
edValue size == 0 ifTrue:[ |
|
4049 |
edValue := nil |
|
4050 |
] |
|
4051 |
] |
|
4052 |
] |
|
4053 |
]. |
|
4054 |
selRow isNumber ifFalse:[ |
|
4055 |
"/ ??? should we do ???: |
|
4056 |
"/ selRow do:[:eachRow | |
|
4057 |
"/ (self columnAt:selCol) at:eachRow put:edValue. |
|
4058 |
"/ ] |
|
4059 |
selRow := selRow first |
|
4060 |
]. |
|
4061 |
(self columnAt:selCol) at:selRow put:edValue. |
|
4062 |
modifiedChannel notNil ifTrue:[ |
|
4063 |
modifiedChannel value:true |
|
4064 |
]. |
|
4065 |
editValue := nil |
|
4066 |
]. |
|
4067 |
self destroyEditView. |
|
4068 |
! |
|
4069 |
||
607 | 4070 |
validateSelection:aSelection |
4071 |
|newSel| |
|
4072 |
||
2733 | 4073 |
(list size == 0 or:[aSelection isNil or:[aSelection == 0]]) ifTrue:[ |
607 | 4074 |
^ multipleSelectOk ifFalse:[0] ifTrue:[nil] |
4075 |
]. |
|
4076 |
||
2733 | 4077 |
newSel := aSelection. |
4078 |
||
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4079 |
multipleSelectOk ifFalse:[ |
2732 | 4080 |
newSel isInteger ifFalse:[ |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4081 |
newSel := self identityIndexOfRow:aSelection. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4082 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4083 |
^ (self isRowSelectable:newSel) ifTrue:[newSel] ifFalse:[0]. |
607 | 4084 |
]. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4085 |
|
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4086 |
"multiple selection |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4087 |
" |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4088 |
aSelection size ~~ 0 ifTrue:[ |
2732 | 4089 |
aSelection first isInteger ifTrue:[ |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4090 |
newSel := aSelection select:[:idx| self isRowSelectable:idx ]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4091 |
] ifFalse:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4092 |
newSel := aSelection |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4093 |
collect:[:el| self identityIndexOfRow:el ] |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4094 |
thenSelect:[:idx| self isRowSelectable:idx ]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4095 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4096 |
newSel notEmpty ifTrue:[ |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4097 |
^ newSel |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4098 |
]. |
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4099 |
] ifFalse:[ |
2733 | 4100 |
newSel isInteger ifFalse:[ |
4101 |
newSel := self identityIndexOfRow:aSelection. |
|
4102 |
]. |
|
4103 |
(self isRowSelectable:newSel) ifTrue:[ |
|
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4104 |
^ Array with:newSel |
2733 | 4105 |
] |
607 | 4106 |
]. |
2636
103067a67ff9
add selectConditionBlock: to enable the selection of a row
ca
parents:
2593
diff
changeset
|
4107 |
^ nil |
542 | 4108 |
! ! |
4109 |
||
4110 |
!DSVColumnView class methodsFor:'documentation'! |
|
4111 |
||
4112 |
version |
|
2886 | 4113 |
^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.209 2006-01-23 22:18:58 cg Exp $' |
542 | 4114 |
! ! |