author | Claus Gittinger <cg@exept.de> |
Fri, 11 Oct 2002 15:09:56 +0200 | |
changeset 2633 | 96d7e5d626ae |
parent 2597 | feebf7ba0771 |
child 2670 | 72392256ff0a |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
||
2187
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
13 |
"{ Package: 'stx:libwidg' }" |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
14 |
|
0 | 15 |
ListView subclass:#SelectionInListView |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
16 |
instanceVariableNames:'selection actionBlock enabled hilightFgColor hilightBgColor |
2140 | 17 |
halfIntensityFgColor doubleClickActionBlock listAttributes |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
18 |
multipleSelectOk clickLine selectMode selectionAtClickTime |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
19 |
initialSelectionMsg printItems oneItem useIndex hilightLevel |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
20 |
hilightFrameColor ignoreReselect arrowLevel smallArrow |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
21 |
keyActionStyle returnKeyActionStyle toggleSelect strikeOut |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
22 |
iSearchString items doubleClickMsg hilightStyle clickPosition |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
23 |
allowDrag dragObjectConverter dragIsActive endDragAction |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
24 |
dropTarget dropSource visualBlock selectedVisualBlock |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
25 |
selectConditionBlock' |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
26 |
classVariableNames:'RightArrowShadowForm RightArrowLightForm RightArrowForm |
128 | 27 |
SmallRightArrowShadowForm SmallRightArrowLightForm |
28 |
DefaultForegroundColor DefaultBackgroundColor |
|
29 |
DefaultHilightForegroundColor DefaultHilightBackgroundColor |
|
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
30 |
DefaultHilightFrameColor DefaultHilightLevel |
128 | 31 |
DefaultRightArrowStyle DefaultRightArrowLevel |
32 |
DefaultDisabledForegroundColor DefaultShadowColor |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
33 |
DefaultLightColor DefaultHilightStyle' |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
34 |
poolDictionaries:'' |
1771 | 35 |
category:'Views-Lists' |
0 | 36 |
! |
37 |
||
869
4b09e6fe33b6
allow multiSelect modifier to be changed
Claus Gittinger <cg@exept.de>
parents:
838
diff
changeset
|
38 |
!SelectionInListView class methodsFor:'documentation'! |
7 | 39 |
|
38 | 40 |
copyright |
41 |
" |
|
42 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
59 | 43 |
All Rights Reserved |
38 | 44 |
|
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
! |
|
53 |
||
7 | 54 |
documentation |
55 |
" |
|
31 | 56 |
this one is a ListView with a selected line (which is shown highlighted) |
38 | 57 |
If multipleSelectionsOk is true, it is also allowed to shift-click multiple |
58 |
entries. |
|
63 | 59 |
If toggleSelect is true, clicking toggles (i.e. click on a seleted item |
60 |
will deselect). |
|
31 | 61 |
|
38 | 62 |
Whenever the selection changes, an action-block is evaluated, passing the |
63 |
current selection as argument. |
|
64 |
Currently, the selection can be nil, aNumber or a collection of numbers; |
|
65 |
this will change to be either nil or a collection, making selection handling |
|
70 | 66 |
easier in the future. (this stupid behavior is due to the multiple |
67 |
select feature being added later - the first implementation used to support |
|
68 |
only single selections). |
|
69 |
||
59 | 70 |
The actionBlock is called with the current selection (single number or |
71 |
collection of numbers) as argument. |
|
72 |
||
73 |
Also, to support ST-80 MVC-style use, the model (if nonNil) is notified |
|
155 | 74 |
by the change mechanism (performs changeMsg) and vice versa, the view |
75 |
updates if the model changes (with aspect of either #list or #selectionIndex). |
|
59 | 76 |
|
60 | 77 |
Before actually adding entries to the the selection, a checkBlock (if non-nil) is evaluated |
78 |
passing the number of the entry whch is about to be selected as argument. |
|
79 |
The select change operation is only done if this returns true. This allows |
|
59 | 80 |
interception of select, for example to query the user if he/she wants to save |
60 | 81 |
the old contents before (see uses in SystemBrowser and FileBrowser), or to |
82 |
disable individual entries. |
|
31 | 83 |
|
38 | 84 |
It is also possible to select entries with the keyboard; use the cursor up/ |
85 |
down keys to select prev/next, Home- and End-keys to select first/last. |
|
86 |
Use the return key to apply the double-click-action to the current selection. |
|
87 |
Also, alphabetic keys will select the next entry starting with that key. |
|
88 |
||
89 |
The keyboard behavior can be further controlled with the keyActionStyle |
|
90 |
instance variable (see SelectionInListView>>keyActionStyle:). |
|
91 |
||
59 | 92 |
Finally, ignoreReselect controls if pressing on an already selected item |
93 |
triggers the action or not. For some applications it is useful to allow |
|
94 |
reselects (for example, the SystemBrowsers method-list updates the |
|
95 |
source code in this case). |
|
38 | 96 |
|
60 | 97 |
Currently, some limited form of line attributes are supported. These |
98 |
are kept in the instance variable lineAttributes. |
|
99 |
This may change (using mechanisms similar to MultiColListEntry), so |
|
63 | 100 |
be prepared. (dont use the listAttributes instvar directly; if possible, |
101 |
use MultiColListEntry or subclasses of it. |
|
120 | 102 |
|
63 | 103 |
Although currently based on the listAttributes instVar, the implementation of |
120 | 104 |
text attributes will be changed in the near future (when Text/DisplayText are |
105 |
available). |
|
106 |
However, the protocol will probably be kept for backward compatibility |
|
107 |
(i.e. use #attributeAt: / #attributeAt:put etc. - at least, these are easy to find |
|
108 |
when migrating to the new attributed text handling). |
|
60 | 109 |
|
586 | 110 |
[Instance variables:] |
111 |
selection <misc> the current selection. nil, a number or collection of numbers |
|
112 |
||
113 |
actionBlock <Block> block to be evaluated on selection changes |
|
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
114 |
(1-arg blocks gets selectionIndex or selectionValue |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
115 |
as arg - depending upon the useIndex setting) |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
116 |
|
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
117 |
useIndex <Boolean> if true, the index of a selection is passed to |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
118 |
the actionBlock or stuffed into the selection valueHolder; |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
119 |
if false, the seelction-value is passed. |
586 | 120 |
|
121 |
enabled <Boolean> true: selection changes allowed; false: ignore clicks |
|
122 |
||
123 |
hilightFgColor |
|
124 |
hilightBgColor <Color> how highlighted items are drawn |
|
125 |
||
126 |
halfIntensityColor <Color> foreground for disabled items |
|
127 |
||
2139 | 128 |
selectCondition <Block> if non-nil, this block can decide if selection is ok. |
129 |
or its invoked with the itemNr of the |
|
130 |
<ValueHolder> 'to-be-selected' item. |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
131 |
If the block returns true, the item is selected |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
132 |
(or added to the selection); if false is returned, |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
133 |
no action is taken. |
2139 | 134 |
selectionChangeCondition |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
135 |
<Block> much like above, but invoked without argument, |
2139 | 136 |
or on any change of the selection (i.e. also when items |
137 |
<ValueHolder> are deselected). |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
138 |
Can return false to suppress change. |
586 | 139 |
|
140 |
doubleClickActionBlock <Block> action to perform on double-click |
|
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
141 |
(1-arg blocks gets selectionIndex or selectionValue |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
142 |
as arg - depending upon the useIndex setting) |
586 | 143 |
|
144 |
listAttributes dont use - will vanish |
|
145 |
||
146 |
hilightLevel <Integer> level to draw selections (i.e. for 3D effect) |
|
147 |
hilightFrameColor <Color> rectangle around highlighted items |
|
148 |
||
149 |
multipleSelectOk <Boolean> if true, multiple selections (with shift) are ok. |
|
150 |
default: false |
|
151 |
||
152 |
ignoreReselect <Boolean> if true, selecting same again does not trigger action; |
|
153 |
if false, every select triggers it. |
|
154 |
default: true |
|
155 |
||
156 |
toggleSelect <Boolean> if true, click toggles; |
|
157 |
if false, click selects. |
|
158 |
default: false |
|
159 |
||
160 |
arrowLevel <Integer> level to draw right-arrows (for submenus etc.) |
|
161 |
smallArrow <Boolean> if true, uses a small arrow bitmap |
|
162 |
||
163 |
listMsg if non-nil, use ST-80 style (model-access) |
|
164 |
initialSelectionMsg |
|
165 |
printItems |
|
166 |
oneItem |
|
167 |
||
168 |
keyActionStyle <Symbol> controls how to respond to keyboard selects |
|
169 |
||
170 |
returnKeyActionStyle <Symbol> controls how to respond to return key |
|
125 | 171 |
|
31 | 172 |
written spring/summer 89 by claus |
173 |
3D Jan 90 by claus |
|
38 | 174 |
multiselect Jun 92 by claus |
175 |
keyboard-select jun 94 by claus |
|
586 | 176 |
|
177 |
[author:] |
|
178 |
Claus Gittinger |
|
7 | 179 |
" |
119 | 180 |
! |
181 |
||
182 |
examples |
|
183 |
" |
|
184 |
SelectionInListView can be used both in the ST/X way, using action blocks |
|
185 |
or in the traditional mvc way. |
|
186 |
with actions: |
|
187 |
||
125 | 188 |
basic interface: |
594 | 189 |
[exBegin] |
401 | 190 |
|top slv| |
191 |
||
192 |
top := StandardSystemView new |
|
193 |
label:'select'; |
|
194 |
minExtent:100@100; |
|
195 |
maxExtent:300@400; |
|
196 |
extent:200@200. |
|
197 |
||
198 |
slv := SelectionInListView new. |
|
199 |
slv list:#('one' 'two' 'three'). |
|
655 | 200 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
401 | 201 |
|
202 |
top add:slv in:(0.0@0.0 corner:1.0@1.0). |
|
203 |
top open |
|
594 | 204 |
[exEnd] |
125 | 205 |
|
206 |
||
207 |
get element instead of index: |
|
594 | 208 |
[exBegin] |
401 | 209 |
|top slv| |
210 |
||
211 |
top := StandardSystemView new |
|
212 |
label:'select'; |
|
213 |
minExtent:100@100; |
|
214 |
maxExtent:300@400; |
|
215 |
extent:200@200. |
|
216 |
||
217 |
slv := SelectionInListView new. |
|
218 |
slv list:#('one' 'two' 'three'). |
|
655 | 219 |
slv action:[:element | Transcript showCR:'selected ' , element printString]. |
401 | 220 |
slv useIndex:false. |
221 |
||
222 |
top add:slv in:(0.0@0.0 corner:1.0@1.0). |
|
223 |
top open |
|
594 | 224 |
[exEnd] |
125 | 225 |
|
226 |
||
227 |
concrete example; show filenames: |
|
228 |
(notice: normally, you would use a FileSelectionList) |
|
594 | 229 |
[exBegin] |
401 | 230 |
|top slv| |
231 |
||
232 |
top := StandardSystemView new |
|
233 |
label:'select'; |
|
234 |
minExtent:100@100; |
|
235 |
maxExtent:300@400; |
|
236 |
extent:200@200. |
|
237 |
||
238 |
slv := SelectionInListView new. |
|
239 |
slv list:(Filename currentDirectory directoryContents). |
|
240 |
slv action:[:index | |
|
655 | 241 |
Transcript showCR:'selected ' , index printString. |
242 |
Transcript showCR:' the value is: ', slv selectionValue]. |
|
401 | 243 |
|
244 |
top add:slv in:(0.0@0.0 corner:1.0@1.0). |
|
245 |
top open |
|
594 | 246 |
[exEnd] |
125 | 247 |
|
119 | 248 |
|
124
7abd3a234296
last version before changing to collection in multipleSelect mode
claus
parents:
120
diff
changeset
|
249 |
add a scrollbar: |
594 | 250 |
[exBegin] |
401 | 251 |
|top slv| |
252 |
||
253 |
top := StandardSystemView new |
|
254 |
label:'select'; |
|
255 |
minExtent:100@100; |
|
256 |
maxExtent:300@400; |
|
257 |
extent:200@200. |
|
258 |
||
259 |
slv := SelectionInListView new. |
|
260 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 261 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
401 | 262 |
|
263 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
264 |
top open |
|
594 | 265 |
[exEnd] |
125 | 266 |
|
119 | 267 |
|
628 | 268 |
allow reselect |
269 |
(clicking on already selected entry |
|
270 |
triggers action/changeNotification again): |
|
594 | 271 |
[exBegin] |
401 | 272 |
|top slv| |
273 |
||
274 |
top := StandardSystemView new |
|
275 |
label:'select'; |
|
276 |
minExtent:100@100; |
|
277 |
maxExtent:300@400; |
|
278 |
extent:200@200. |
|
279 |
||
280 |
slv := SelectionInListView new. |
|
281 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 282 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
401 | 283 |
slv ignoreReselect:false. |
284 |
||
285 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
286 |
top open |
|
594 | 287 |
[exEnd] |
125 | 288 |
|
119 | 289 |
|
628 | 290 |
allow multiple selections (shift-select): |
594 | 291 |
[exBegin] |
401 | 292 |
|top slv| |
293 |
||
294 |
top := StandardSystemView new |
|
295 |
label:'select'; |
|
296 |
minExtent:100@100; |
|
297 |
maxExtent:300@400; |
|
298 |
extent:200@200. |
|
299 |
||
300 |
slv := SelectionInListView new. |
|
301 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 302 |
slv action:[:indexList | Transcript showCR:'selected ' , indexList printString]. |
401 | 303 |
slv multipleSelectOk:true. |
304 |
||
305 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
306 |
top open |
|
594 | 307 |
[exEnd] |
125 | 308 |
|
309 |
same, not using index: |
|
594 | 310 |
[exBegin] |
401 | 311 |
|top slv| |
312 |
||
313 |
top := StandardSystemView new |
|
314 |
label:'select'; |
|
315 |
minExtent:100@100; |
|
316 |
maxExtent:300@400; |
|
317 |
extent:200@200. |
|
318 |
||
319 |
slv := SelectionInListView new. |
|
320 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 321 |
slv action:[:indexList | Transcript showCR:'selected ' , indexList printString]. |
401 | 322 |
slv multipleSelectOk:true; useIndex:false. |
323 |
||
324 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
325 |
top open |
|
594 | 326 |
[exEnd] |
125 | 327 |
|
119 | 328 |
|
124
7abd3a234296
last version before changing to collection in multipleSelect mode
claus
parents:
120
diff
changeset
|
329 |
strikeout mode (single): |
594 | 330 |
[exBegin] |
401 | 331 |
|top slv| |
332 |
||
333 |
top := StandardSystemView new |
|
334 |
label:'select'; |
|
335 |
minExtent:100@100; |
|
336 |
maxExtent:300@400; |
|
337 |
extent:200@200. |
|
338 |
||
339 |
slv := SelectionInListView new. |
|
340 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 341 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
401 | 342 |
slv strikeOut:true. |
343 |
||
344 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
345 |
top open |
|
594 | 346 |
[exEnd] |
125 | 347 |
|
119 | 348 |
|
124
7abd3a234296
last version before changing to collection in multipleSelect mode
claus
parents:
120
diff
changeset
|
349 |
strikeout mode (multiple): |
594 | 350 |
[exBegin] |
401 | 351 |
|top slv| |
352 |
||
353 |
top := StandardSystemView new |
|
354 |
label:'select'; |
|
355 |
minExtent:100@100; |
|
356 |
maxExtent:300@400; |
|
357 |
extent:200@200. |
|
358 |
||
359 |
slv := SelectionInListView new. |
|
360 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 361 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
401 | 362 |
slv strikeOut:true; multipleSelectOk:true. |
363 |
||
364 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
365 |
top open |
|
594 | 366 |
[exEnd] |
119 | 367 |
|
628 | 368 |
toggleSelect mode (clicking on selected entry deselects it): |
369 |
[exBegin] |
|
370 |
|top slv| |
|
371 |
||
372 |
top := StandardSystemView new |
|
373 |
label:'select'; |
|
374 |
minExtent:100@100; |
|
375 |
maxExtent:300@400; |
|
376 |
extent:200@200. |
|
377 |
||
378 |
slv := SelectionInListView new. |
|
379 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 380 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
628 | 381 |
slv toggleSelect:true. |
382 |
||
383 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
384 |
top open |
|
385 |
[exEnd] |
|
386 |
||
124
7abd3a234296
last version before changing to collection in multipleSelect mode
claus
parents:
120
diff
changeset
|
387 |
define what to do on double-click: |
594 | 388 |
[exBegin] |
401 | 389 |
|top slv| |
390 |
||
391 |
top := StandardSystemView new |
|
392 |
label:'select'; |
|
393 |
minExtent:100@100; |
|
394 |
maxExtent:300@400; |
|
395 |
extent:200@200. |
|
396 |
||
397 |
slv := SelectionInListView new. |
|
398 |
slv list:(Filename currentDirectory directoryContents). |
|
655 | 399 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
400 |
slv doubleClickAction:[:index | Transcript showCR:'doubleclick on ' , index printString]. |
|
401 | 401 |
|
402 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
403 |
top open |
|
594 | 404 |
[exEnd] |
124
7abd3a234296
last version before changing to collection in multipleSelect mode
claus
parents:
120
diff
changeset
|
405 |
|
1163
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
406 |
enable / disable: |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
407 |
[exBegin] |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
408 |
|top slv| |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
409 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
410 |
top := StandardSystemView new |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
411 |
label:'select'; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
412 |
minExtent:100@100; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
413 |
maxExtent:300@400; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
414 |
extent:200@200. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
415 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
416 |
slv := SelectionInListView new. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
417 |
slv list:(Filename currentDirectory directoryContents). |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
418 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
419 |
slv disable. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
420 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
421 |
top open. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
422 |
Delay waitForSeconds:5. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
423 |
slv enable. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
424 |
[exEnd] |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
425 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
426 |
enable / disable via a channel: |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
427 |
[exBegin] |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
428 |
|top slv enableChannel t| |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
429 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
430 |
enableChannel := true asValue. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
431 |
t := Toggle label:'enable'. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
432 |
t model:enableChannel. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
433 |
t open. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
434 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
435 |
top := StandardSystemView new |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
436 |
label:'select'; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
437 |
minExtent:100@100; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
438 |
maxExtent:300@400; |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
439 |
extent:200@200. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
440 |
|
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
441 |
slv := SelectionInListView new. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
442 |
slv list:(Filename currentDirectory directoryContents). |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
443 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
444 |
slv enableChannel:enableChannel. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
445 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
446 |
top open. |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
447 |
[exEnd] |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
448 |
|
119 | 449 |
using a Model: |
594 | 450 |
[exBegin] |
401 | 451 |
|top slv model| |
452 |
||
453 |
model := Plug new. |
|
454 |
model respondTo:#getList with:[#('foo' 'bar' 'baz' 'hello')]. |
|
455 |
model respondTo:#initial with:[1]. |
|
655 | 456 |
model respondTo:#setSelection: with:[:arg | Transcript showCR:'model selected:', arg printString]. |
401 | 457 |
|
458 |
top := StandardSystemView new |
|
459 |
label:'select'; |
|
460 |
minExtent:100@100; |
|
461 |
maxExtent:300@400; |
|
462 |
extent:200@200. |
|
463 |
||
464 |
slv := SelectionInListView |
|
465 |
on:model |
|
466 |
aspect:#someAspect |
|
467 |
change:#setSelection: |
|
468 |
list:#getList |
|
469 |
initialSelection:#initial. |
|
470 |
||
471 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
472 |
top open |
|
594 | 473 |
[exEnd] |
119 | 474 |
|
475 |
notice, that the ST-80 behavaior on reselect is to send a selection change |
|
476 |
with an index of 0. |
|
477 |
||
125 | 478 |
same, with useIndex false: |
594 | 479 |
[exBegin] |
401 | 480 |
|top slv model| |
481 |
||
482 |
model := Plug new. |
|
483 |
model respondTo:#getList with:[#('foo' 'bar' 'baz' 'hello')]. |
|
484 |
model respondTo:#initial with:['bar']. |
|
655 | 485 |
model respondTo:#setSelection: with:[:arg | Transcript showCR:'model selected:', arg printString]. |
401 | 486 |
|
487 |
top := StandardSystemView new |
|
488 |
label:'select'; |
|
489 |
minExtent:100@100; |
|
490 |
maxExtent:300@400; |
|
491 |
extent:200@200. |
|
492 |
||
493 |
slv := SelectionInListView |
|
494 |
on:model |
|
495 |
aspect:#someAspect |
|
496 |
change:#setSelection: |
|
497 |
list:#getList |
|
498 |
initialSelection:#initial. |
|
499 |
slv useIndex:false. |
|
500 |
||
501 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
502 |
top open |
|
594 | 503 |
[exEnd] |
125 | 504 |
|
505 |
||
155 | 506 |
self changing list: |
507 |
(selectionInListView updates itself when button changes initial selection): |
|
594 | 508 |
[exBegin] |
401 | 509 |
|top slv model sel changeButton| |
510 |
||
511 |
sel := 'bar'. |
|
512 |
model := Plug new. |
|
513 |
model respondTo:#getList with:['getList' printNL. #('foo' 'bar' 'baz' 'hello')]. |
|
514 |
model respondTo:#initial with:['initial' printNL. sel]. |
|
515 |
model respondTo:#setSelection: with:[:arg | ('model selected:', arg) printNL. sel := arg]. |
|
516 |
||
517 |
changeButton := Button label:'change selection'. |
|
518 |
changeButton action:[sel := 'foo'. model changed:#initial]. |
|
519 |
changeButton open. |
|
520 |
||
521 |
top := StandardSystemView new |
|
522 |
label:'select'; |
|
523 |
minExtent:100@100; |
|
524 |
maxExtent:300@400; |
|
525 |
extent:200@200. |
|
526 |
||
527 |
slv := SelectionInListView |
|
528 |
on:model |
|
529 |
aspect:#someAspect |
|
530 |
change:#setSelection: |
|
531 |
list:#getList |
|
532 |
initialSelection:#initial. |
|
533 |
slv useIndex:false. |
|
534 |
||
535 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
536 |
top open |
|
594 | 537 |
[exEnd] |
155 | 538 |
|
539 |
||
119 | 540 |
using a SelectionInList-Model: |
541 |
(see how changes in the model (via list:...) are reflected in the view) |
|
594 | 542 |
[exBegin] |
401 | 543 |
|top slv model| |
544 |
||
545 |
model := SelectionInList with:#('foo' 'bar' 'baz' 'hello'). |
|
546 |
model selection:'bar'. |
|
547 |
||
548 |
top := StandardSystemView new |
|
549 |
label:'select'; |
|
550 |
minExtent:100@100; |
|
551 |
maxExtent:300@400; |
|
552 |
extent:200@200. |
|
553 |
||
554 |
slv := SelectionInListView on:model. |
|
555 |
||
556 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
557 |
top open. |
|
558 |
||
449
725c26daf5d8
examples (use new monitoringInspector)
Claus Gittinger <cg@exept.de>
parents:
441
diff
changeset
|
559 |
InspectorView openOn:model monitor:'selectionIndexHolder' |
594 | 560 |
[exEnd] |
125 | 561 |
|
562 |
||
563 |
two selectionInListViews on the same selectionInList model: |
|
594 | 564 |
[exBegin] |
401 | 565 |
|top1 slv1 top2 slv2 model| |
566 |
||
567 |
model := SelectionInList with:#('foo' 'bar' 'baz' 'hello'). |
|
568 |
||
569 |
top1 := StandardSystemView new |
|
570 |
label:'select'; |
|
571 |
minExtent:100@100; |
|
572 |
maxExtent:300@400; |
|
573 |
extent:200@200. |
|
574 |
||
575 |
slv1 := SelectionInListView on:model. |
|
576 |
||
577 |
top1 add:(ScrollableView forView:slv1) in:(0.0@0.0 corner:1.0@1.0). |
|
578 |
top1 open. |
|
579 |
||
580 |
top2 := StandardSystemView new |
|
581 |
label:'select'; |
|
582 |
minExtent:100@100; |
|
583 |
maxExtent:300@400; |
|
584 |
extent:200@200. |
|
585 |
||
586 |
slv2 := SelectionInListView on:model. |
|
587 |
||
588 |
top2 add:(ScrollableView forView:slv2) in:(0.0@0.0 corner:1.0@1.0). |
|
589 |
top2 open. |
|
594 | 590 |
[exEnd] |
166 | 591 |
|
592 |
||
593 |
a MultiSelectionInList model: |
|
594 | 594 |
[exBegin] |
401 | 595 |
|top slv model| |
596 |
||
597 |
model := MultiSelectionInList with:#('foo' 'bar' 'baz' 'hello'). |
|
598 |
model selection:#('foo' 'bar'). |
|
599 |
||
600 |
top := StandardSystemView new |
|
601 |
label:'select'; |
|
602 |
minExtent:100@100; |
|
603 |
maxExtent:300@400; |
|
604 |
extent:200@200. |
|
605 |
||
606 |
slv := SelectionInListView on:model. |
|
607 |
slv multipleSelectOk:true. |
|
608 |
||
609 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
610 |
top open. |
|
611 |
||
449
725c26daf5d8
examples (use new monitoringInspector)
Claus Gittinger <cg@exept.de>
parents:
441
diff
changeset
|
612 |
InspectorView openOn:model monitor:'selectionIndexHolder' |
594 | 613 |
[exEnd] |
166 | 614 |
|
615 |
with strikeOut: |
|
594 | 616 |
[exBegin] |
401 | 617 |
|top slv model| |
618 |
||
619 |
model := MultiSelectionInList with:#('foo' 'bar' 'baz' 'hello'). |
|
620 |
model selection:#('foo' 'bar'). |
|
621 |
||
622 |
top := StandardSystemView new |
|
623 |
label:'select'; |
|
624 |
minExtent:100@100; |
|
625 |
maxExtent:300@400; |
|
626 |
extent:200@200. |
|
627 |
||
628 |
slv := SelectionInListView on:model. |
|
629 |
slv multipleSelectOk:true; toggleSelect:true; strikeOut:true. |
|
630 |
||
631 |
top add:(ScrollableView forView:slv) in:(0.0@0.0 corner:1.0@1.0). |
|
632 |
top open. |
|
633 |
||
449
725c26daf5d8
examples (use new monitoringInspector)
Claus Gittinger <cg@exept.de>
parents:
441
diff
changeset
|
634 |
InspectorView openOn:model monitor:'selectionIndexHolder' |
594 | 635 |
[exEnd] |
401 | 636 |
|
637 |
||
638 |
two listViews on the same list, but separate selections |
|
594 | 639 |
[exBegin] |
401 | 640 |
|top top2 lv1 lv2 selInL1 selInL2 listHolder l1 l2| |
641 |
||
642 |
top := StandardSystemView new extent:300@300. |
|
643 |
||
644 |
lv1 := SelectionInListView origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
645 |
lv1 level:-1. |
|
646 |
lv1 toggleSelect:true. |
|
647 |
||
648 |
lv2 := SelectionInListView origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
649 |
lv2 level:-1. |
|
650 |
lv2 toggleSelect:true. |
|
651 |
||
652 |
selInL1 := SelectionInList new. |
|
653 |
selInL2 := SelectionInList new. |
|
654 |
||
655 |
listHolder := #('foo' 'bar' 'baz') asValue. |
|
656 |
||
657 |
selInL1 listHolder:listHolder. |
|
658 |
selInL2 listHolder:listHolder. |
|
659 |
||
660 |
lv1 model:selInL1. |
|
661 |
lv2 model:selInL2. |
|
662 |
||
663 |
top open. |
|
664 |
||
665 |
top2 := StandardSystemView new extent:100 @ 30. |
|
666 |
l1 := Label origin:0.0@0.0 corner:0.5@1.0 in:top2. |
|
667 |
l2 := Label origin:0.5@0.0 corner:1.0@1.0 in:top2. |
|
668 |
||
669 |
l1 model:(BlockValue with:[:arg | arg value printString] argument:selInL1 selectionIndexHolder). |
|
670 |
l2 model:(BlockValue with:[:arg | arg value printString] argument:selInL2 selectionIndexHolder). |
|
671 |
||
672 |
l1 labelMessage:#value. |
|
673 |
l2 labelMessage:#value. |
|
674 |
||
675 |
top2 open. |
|
676 |
||
677 |
Delay waitForSeconds:2. |
|
678 |
listHolder value:#('1' '2' '3' '4'). |
|
594 | 679 |
[exEnd] |
628 | 680 |
non-string entries (text) |
681 |
[exBegin] |
|
682 |
|top l slv| |
|
683 |
||
684 |
top := StandardSystemView new |
|
685 |
label:'select'; |
|
686 |
minExtent:100@100; |
|
687 |
maxExtent:300@400; |
|
688 |
extent:200@200. |
|
689 |
||
690 |
slv := SelectionInListView new. |
|
691 |
l := OrderedCollection new. |
|
692 |
l add:(Text string:'red' emphasis:(#color->Color red)). |
|
693 |
l add:(Text string:'green' emphasis:(#color->Color green)). |
|
694 |
l add:(Text string:'blue' emphasis:(#color->Color blue)). |
|
695 |
slv list:l. |
|
655 | 696 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
628 | 697 |
|
698 |
top add:slv in:(0.0@0.0 corner:1.0@1.0). |
|
699 |
top open |
|
700 |
[exEnd] |
|
838 | 701 |
|
702 |
non string entries |
|
703 |
[exBegin] |
|
704 |
|top slv wrapper l fileImage dirImage m| |
|
705 |
||
706 |
dirImage := Image fromFile:'DirObj.xbm'. |
|
707 |
fileImage := Image fromFile:'FileObj.xbm'. |
|
708 |
||
709 |
||
710 |
l := OrderedCollection new. |
|
711 |
Filename currentDirectory directoryContents do:[:s | |
|
712 |
s asFilename isDirectory ifTrue:[ |
|
713 |
l add:(LabelAndIcon icon:dirImage string:s) |
|
714 |
] ifFalse:[ |
|
715 |
l add:(LabelAndIcon icon:fileImage string:s) |
|
716 |
] |
|
717 |
]. |
|
718 |
||
719 |
m := SelectionInList new. |
|
720 |
m list:l. |
|
721 |
||
722 |
slv := SelectionInListView new. |
|
723 |
slv model:m. |
|
724 |
wrapper := HVScrollableView forView:slv miniScrollerH:true. |
|
725 |
||
726 |
top := StandardSystemView extent:150@200. |
|
727 |
top add:wrapper in:(0.0@0.0 corner:1.0@1.0). |
|
728 |
top open. |
|
729 |
[exEnd] |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
730 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
731 |
[exBegin] |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
732 |
|top slv| |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
733 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
734 |
top := StandardSystemView new |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
735 |
label:'select'; |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
736 |
minExtent:100@100; |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
737 |
maxExtent:300@400; |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
738 |
extent:200@200. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
739 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
740 |
slv := SelectionInListView new. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
741 |
slv list:#('one' 'two' 'three'). |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
742 |
slv action:[:index | Transcript showCR:'selected ' , index printString]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
743 |
slv multipleSelectOk:true. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
744 |
slv allowDrag:true. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
745 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
746 |
top add:slv in:(0.0@0.0 corner:1.0@1.0). |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
747 |
top open |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
748 |
[exEnd] |
119 | 749 |
" |
166 | 750 |
|
751 |
"Modified: 26.10.1995 / 16:42:02 / cg" |
|
7 | 752 |
! ! |
0 | 753 |
|
869
4b09e6fe33b6
allow multiSelect modifier to be changed
Claus Gittinger <cg@exept.de>
parents:
838
diff
changeset
|
754 |
!SelectionInListView class methodsFor:'instance creation'! |
105 | 755 |
|
125 | 756 |
on:aModel aspect:aspect change:change list:list initialSelection:initial |
757 |
^ self on:aModel |
|
758 |
printItems:true |
|
759 |
oneItem:false |
|
760 |
aspect:aspect |
|
761 |
change:change |
|
762 |
list:list |
|
763 |
menu:nil |
|
764 |
initialSelection:initial |
|
765 |
useIndex:true |
|
766 |
! |
|
767 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
768 |
on:aModel aspect:aspect change:change list:list menu:menu initialSelection:initial |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
769 |
^ self on:aModel |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
770 |
printItems:true |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
771 |
oneItem:false |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
772 |
aspect:aspect |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
773 |
change:change |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
774 |
list:list |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
775 |
menu:menu |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
776 |
initialSelection:initial |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
777 |
useIndex:true |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
778 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
779 |
|
105 | 780 |
on:aModel printItems:print oneItem:one aspect:aspect |
781 |
change:change list:list menu:menu initialSelection:initial |
|
782 |
||
783 |
"for ST-80 compatibility" |
|
784 |
||
119 | 785 |
^ self on:aModel |
105 | 786 |
printItems:print |
787 |
oneItem:one |
|
788 |
aspect:aspect |
|
789 |
change:change |
|
790 |
list:list |
|
791 |
menu:menu |
|
792 |
initialSelection:initial |
|
793 |
useIndex:false |
|
119 | 794 |
! |
795 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
796 |
on:aModel printItems:print oneItem:one aspect:aspect change:change |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
797 |
list:list menu:menu initialSelection:initial useIndex:useIndex |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
798 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
799 |
"for ST-80 compatibility" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
800 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
801 |
^ (self new) on:aModel |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
802 |
printItems:print |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
803 |
oneItem:one |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
804 |
aspect:aspect |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
805 |
change:change |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
806 |
list:list |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
807 |
menu:menu |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
808 |
initialSelection:initial |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
809 |
useIndex:useIndex |
105 | 810 |
! ! |
811 |
||
869
4b09e6fe33b6
allow multiSelect modifier to be changed
Claus Gittinger <cg@exept.de>
parents:
838
diff
changeset
|
812 |
!SelectionInListView class methodsFor:'defaults'! |
22 | 813 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
814 |
defaultAspectMessage |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
815 |
^ nil |
125 | 816 |
! |
817 |
||
818 |
defaultChangeMessage |
|
819 |
^ #selectionIndex: |
|
820 |
! |
|
821 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
822 |
defaultListMessage |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
823 |
^ #list |
125 | 824 |
! |
825 |
||
826 |
defaultSelectionMessage |
|
827 |
^ #selectionIndex |
|
828 |
! |
|
829 |
||
22 | 830 |
rightArrowFormOn:aDevice |
831 |
"return the form used for the right arrow (non 3D)" |
|
832 |
||
1636
6f75bcabf092
oops - resource spec was incompatible with stc.
Claus Gittinger <cg@exept.de>
parents:
1634
diff
changeset
|
833 |
<resource: #style (#'selection.rightArrowForm' #'selection.rightArrowFormFile')> |
1204
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
834 |
|
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
835 |
|f fn bits| |
22 | 836 |
|
837 |
((aDevice == Display) and:[RightArrowForm notNil]) ifTrue:[ |
|
898 | 838 |
^ RightArrowForm |
22 | 839 |
]. |
1204
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
840 |
|
1870 | 841 |
f := StyleSheet at:#'selection.rightArrowForm'. |
22 | 842 |
f isNil ifTrue:[ |
1870 | 843 |
fn := StyleSheet at:#'selection.rightArrowFormFile' default:'RightArrow.xbm'. |
2075 | 844 |
f := Smalltalk imageFromFileNamed:fn forClass:self. |
2062
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
845 |
f notNil ifTrue:[ |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
846 |
f := f onDevice:aDevice. |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
847 |
] ifFalse:[ |
1204
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
848 |
DefaultRightArrowStyle == #solid ifTrue:[ |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
849 |
bits := #[2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
850 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
851 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
852 |
2r00000010 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
853 |
2r00000011 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
854 |
2r00000011 2r10000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
855 |
2r00000011 2r11000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
856 |
2r00000011 2r11100000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
857 |
2r00000011 2r11110000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
858 |
2r00000011 2r11100000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
859 |
2r00000011 2r11000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
860 |
2r00000011 2r10000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
861 |
2r00000011 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
862 |
2r00000010 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
863 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
864 |
2r00000000 2r00000000] |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
865 |
] ifFalse:[ |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
866 |
bits := #[2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
867 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
868 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
869 |
2r00000110 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
870 |
2r00000101 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
871 |
2r00000100 2r10000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
872 |
2r00000100 2r01000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
873 |
2r00000100 2r00100000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
874 |
2r00000100 2r00010000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
875 |
2r00000100 2r00100000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
876 |
2r00000100 2r01000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
877 |
2r00000100 2r10000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
878 |
2r00000101 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
879 |
2r00000110 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
880 |
2r00000000 2r00000000 |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
881 |
2r00000000 2r00000000] |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
882 |
]. |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
883 |
f := Form width:16 height:16 fromArray:bits on:aDevice |
8cbd65c6ddac
allow right-arrow form to be defined in style-sheet.
Claus Gittinger <cg@exept.de>
parents:
1202
diff
changeset
|
884 |
] |
22 | 885 |
]. |
886 |
(aDevice == Display) ifTrue:[ |
|
898 | 887 |
RightArrowForm := f |
22 | 888 |
]. |
889 |
^ f |
|
898 | 890 |
|
1634 | 891 |
"Modified: / 5.8.1998 / 00:04:40 / cg" |
31 | 892 |
! |
893 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
894 |
rightArrowLightFormOn:aDevice |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
895 |
"return the form used for the right arrow light pixels (3D only)" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
896 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
897 |
|f| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
898 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
899 |
((aDevice == Display) and:[RightArrowLightForm notNil]) ifTrue:[ |
898 | 900 |
^ RightArrowLightForm |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
901 |
]. |
2075 | 902 |
f := Smalltalk imageFromFileNamed:'RightArrowLight.xbm' forClass:self. |
2062
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
903 |
f notNil ifTrue:[ |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
904 |
f := f onDevice:aDevice. |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
905 |
] ifFalse:[ |
898 | 906 |
f := Form width:16 height:16 fromArray:#[2r00000000 2r00000000 |
907 |
2r00000000 2r00000000 |
|
908 |
2r00000000 2r00000000 |
|
909 |
2r00000110 2r00000000 |
|
910 |
2r00000101 2r00000000 |
|
911 |
2r00000100 2r10000000 |
|
912 |
2r00000100 2r01000000 |
|
913 |
2r00000100 2r00100000 |
|
914 |
2r00000100 2r00000000 |
|
915 |
2r00000100 2r00000000 |
|
916 |
2r00000100 2r00000000 |
|
917 |
2r00000100 2r00000000 |
|
918 |
2r00000100 2r00000000 |
|
919 |
2r00000100 2r00000000 |
|
920 |
2r00000000 2r00000000 |
|
921 |
2r00000000 2r00000000] |
|
922 |
on:aDevice |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
923 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
924 |
(aDevice == Display) ifTrue:[ |
898 | 925 |
RightArrowLightForm := f |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
926 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
927 |
^ f |
898 | 928 |
|
929 |
"Modified: 1.1.1970 / 14:10:42 / cg" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
930 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
931 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
932 |
rightArrowShadowFormOn:aDevice |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
933 |
"return the form used for the right arrow light pixels (3D only)" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
934 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
935 |
|f| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
936 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
937 |
((aDevice == Display) and:[RightArrowShadowForm notNil]) ifTrue:[ |
898 | 938 |
^ RightArrowShadowForm |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
939 |
]. |
2075 | 940 |
f := Smalltalk imageFromFileNamed:'RightArrowShadow.xbm' forClass:self. |
2062
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
941 |
f notNil ifTrue:[ |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
942 |
f := f onDevice:aDevice. |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
943 |
] ifFalse:[ |
898 | 944 |
f := Form width:16 height:16 fromArray:#[2r00000000 2r00000000 |
945 |
2r00000000 2r00000000 |
|
946 |
2r00000000 2r00000000 |
|
947 |
2r00000000 2r00000000 |
|
948 |
2r00000000 2r00000000 |
|
949 |
2r00000000 2r00000000 |
|
950 |
2r00000000 2r00000000 |
|
951 |
2r00000000 2r00000000 |
|
952 |
2r00000000 2r00010000 |
|
953 |
2r00000000 2r00100000 |
|
954 |
2r00000000 2r01000000 |
|
955 |
2r00000000 2r10000000 |
|
956 |
2r00000001 2r00000000 |
|
957 |
2r00000010 2r00000000 |
|
958 |
2r00000000 2r00000000 |
|
959 |
2r00000000 2r00000000] |
|
960 |
on:aDevice |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
961 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
962 |
(aDevice == Display) ifTrue:[ |
898 | 963 |
RightArrowShadowForm := f |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
964 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
965 |
^ f |
898 | 966 |
|
967 |
"Modified: 1.1.1970 / 01:00:00 / cg" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
968 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
969 |
|
31 | 970 |
smallRightArrowLightFormOn:aDevice |
971 |
"return the form used for the small right arrow light pixels (3D only)" |
|
972 |
||
973 |
|f| |
|
974 |
||
975 |
((aDevice == Display) and:[SmallRightArrowLightForm notNil]) ifTrue:[ |
|
898 | 976 |
^ SmallRightArrowLightForm |
31 | 977 |
]. |
2075 | 978 |
f := Smalltalk imageFromFileNamed:'SmallRightArrowLight.xbm' forClass:self. |
2062
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
979 |
f notNil ifTrue:[ |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
980 |
f := f onDevice:aDevice. |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
981 |
] ifFalse:[ |
898 | 982 |
f := Form width:9 height:9 fromArray:#[2r00000000 2r00000000 |
983 |
2r01100000 2r00000000 |
|
984 |
2r01011000 2r00000000 |
|
985 |
2r01000110 2r00000000 |
|
986 |
2r01000000 2r00000000 |
|
987 |
2r01000000 2r00000000 |
|
988 |
2r01000000 2r00000000 |
|
989 |
2r01000000 2r00000000 |
|
990 |
2r00000000 2r00000000] |
|
991 |
on:aDevice |
|
31 | 992 |
]. |
993 |
(aDevice == Display) ifTrue:[ |
|
898 | 994 |
SmallRightArrowLightForm := f |
31 | 995 |
]. |
996 |
^ f |
|
898 | 997 |
|
998 |
"Modified: 19.12.1996 / 14:10:59 / cg" |
|
31 | 999 |
! |
1000 |
||
1001 |
smallRightArrowShadowFormOn:aDevice |
|
1002 |
"return the form used for the small right arrow light pixels (3D only)" |
|
1003 |
||
1004 |
|f| |
|
1005 |
||
1006 |
((aDevice == Display) and:[SmallRightArrowShadowForm notNil]) ifTrue:[ |
|
898 | 1007 |
^ SmallRightArrowShadowForm |
31 | 1008 |
]. |
2075 | 1009 |
f := Smalltalk imageFromFileNamed:'SmallRightArrowShadow.xbm' forClass:self. |
2062
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1010 |
f notNil ifTrue:[ |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1011 |
f := f onDevice:aDevice. |
1af54949ac53
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2037
diff
changeset
|
1012 |
] ifFalse:[ |
898 | 1013 |
f := Form width:9 height:9 fromArray:#[2r00000000 2r00000000 |
1014 |
2r00000000 2r00000000 |
|
1015 |
2r00000000 2r00000000 |
|
1016 |
2r00000000 2r00000000 |
|
1017 |
2r00000001 2r00000000 |
|
1018 |
2r00000110 2r00000000 |
|
1019 |
2r00011000 2r00000000 |
|
1020 |
2r00100000 2r00000000 |
|
1021 |
2r00000000 2r00000000] |
|
1022 |
on:aDevice |
|
31 | 1023 |
]. |
1024 |
(aDevice == Display) ifTrue:[ |
|
898 | 1025 |
SmallRightArrowShadowForm := f |
31 | 1026 |
]. |
1027 |
^ f |
|
898 | 1028 |
|
1029 |
"Modified: 19.12.1996 / 14:11:10 / cg" |
|
125 | 1030 |
! |
1031 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1032 |
updateStyleCache |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
1033 |
"extract values from the styleSheet and cache them in class variables" |
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
1034 |
|
1354 | 1035 |
<resource: #style (#'selection.disabledForegroundColor' |
1036 |
#'selection.hilightForegroundColor' #'selection.hilightBackgroundColor' |
|
1037 |
#'selection.hilightFrameColor' #'selection.hilightLevel' |
|
1038 |
#'selection.rightArrowStyle' #'selection.rightArrowLevel' |
|
1039 |
#'selection.foregroundColor' #'selection.backgroundColor' |
|
1040 |
#'selection.shadowColor' #'selection.lightColor' |
|
1041 |
#'selection.font' #'selection.hilightStyle')> |
|
1042 |
||
1870 | 1043 |
DefaultDisabledForegroundColor := StyleSheet colorAt:#'selection.disabledForegroundColor'. |
1044 |
DefaultHilightForegroundColor := StyleSheet colorAt:#'selection.hilightForegroundColor'. |
|
1045 |
DefaultHilightBackgroundColor := StyleSheet colorAt:#'selection.hilightBackgroundColor'. |
|
1046 |
DefaultHilightFrameColor := StyleSheet colorAt:#'selection.hilightFrameColor'. |
|
1047 |
DefaultHilightLevel := StyleSheet at:#'selection.hilightLevel' default:0. |
|
1048 |
DefaultHilightStyle := StyleSheet at:#'selection.hilightStyle' default:(StyleSheet name). |
|
1049 |
DefaultRightArrowStyle := StyleSheet at:#'selection.rightArrowStyle'. |
|
1050 |
DefaultRightArrowLevel := StyleSheet at:#'selection.rightArrowLevel'. |
|
1051 |
DefaultForegroundColor := StyleSheet colorAt:#'selection.foregroundColor'. |
|
1052 |
DefaultBackgroundColor := StyleSheet colorAt:#'selection.backgroundColor'. |
|
1053 |
DefaultShadowColor := StyleSheet colorAt:#'selection.shadowColor'. |
|
1054 |
DefaultLightColor := StyleSheet colorAt:#'selection.lightColor'. |
|
1055 |
DefaultFont := StyleSheet fontAt:#'selection.font'. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1056 |
RightArrowForm := nil. |
125 | 1057 |
|
1058 |
" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1059 |
self updateStyleCache |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1060 |
" |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
1061 |
|
1354 | 1062 |
"Modified: 20.10.1997 / 14:04:26 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1063 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1064 |
|
2211 | 1065 |
!SelectionInListView methodsFor:'Compatibility - ST80'! |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1066 |
|
2597
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
1067 |
isSingleSelect:aBool |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
1068 |
self multipleSelectOk:aBool not |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
1069 |
! |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
1070 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1071 |
sequence |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1072 |
"same as #list - for ST80 compatibility" |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1073 |
|
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1074 |
^ self list |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1075 |
|
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1076 |
"Created: / 21.6.1998 / 02:46:50 / cg" |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1077 |
! |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1078 |
|
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1079 |
setValidTargetIndex:index |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1080 |
"ignored for now - for ST80 compatibility" |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1081 |
|
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1082 |
^ self |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1083 |
|
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
1084 |
"Created: / 4.2.2000 / 00:07:14 / cg" |
2401
296ed4051b86
VW compatibility: #targetIndex:
Claus Gittinger <cg@exept.de>
parents:
2369
diff
changeset
|
1085 |
! |
296ed4051b86
VW compatibility: #targetIndex:
Claus Gittinger <cg@exept.de>
parents:
2369
diff
changeset
|
1086 |
|
296ed4051b86
VW compatibility: #targetIndex:
Claus Gittinger <cg@exept.de>
parents:
2369
diff
changeset
|
1087 |
targetIndex:index |
296ed4051b86
VW compatibility: #targetIndex:
Claus Gittinger <cg@exept.de>
parents:
2369
diff
changeset
|
1088 |
self selection:index |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1089 |
! ! |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1090 |
|
2227 | 1091 |
!SelectionInListView methodsFor:'accessing-actions'! |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1092 |
|
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1093 |
action |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1094 |
"return the action block to be performed on select. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1095 |
With useIndex==true, the block gets the selectionIndex as arg, |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1096 |
otherwise, it gets the selectionValue." |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1097 |
|
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1098 |
^ actionBlock |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1099 |
! |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1100 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1101 |
action:aBlock |
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
1102 |
"set the action block to be performed on select. |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
1103 |
With useIndex==true, the block gets the selectionIndex as arg, |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
1104 |
otherwise, it gets the selectionValue." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1105 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1106 |
actionBlock := aBlock |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1107 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1108 |
|
393 | 1109 |
doubleClickAction:aOneArgBlock |
1110 |
"set the double click action block. |
|
1111 |
If non-nil, that one is evaluated on double click, passing the |
|
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
1112 |
selection-line-number (useIndex==true) or selectionValue (useIndex==false) as argument." |
393 | 1113 |
|
1114 |
doubleClickActionBlock := aOneArgBlock |
|
1115 |
||
1116 |
"Modified: 24.2.1996 / 16:07:28 / cg" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1117 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1118 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1119 |
keyActionStyle:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1120 |
"defines how the view should respond to alpha-keys pressed. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1121 |
Possible values are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1122 |
#select -> will select next entry starting with that |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1123 |
character and perform the click-action |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1124 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1125 |
#selectAndDoubleclick -> will select next & perform double-click action |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1126 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1127 |
#pass -> will pass key to superclass (i.e. no special treatment) |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1128 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1129 |
nil -> will ignore key |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1130 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1131 |
the default (set in #initialize) is #select |
125 | 1132 |
" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1133 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1134 |
keyActionStyle := aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1135 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1136 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1137 |
returnKeyActionStyle:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1138 |
"defines how the view should respond to a return key pressed. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1139 |
Possible values are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1140 |
#doubleClick -> perform double-click action |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1141 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1142 |
#pass -> will pass key to superclass (i.e. no special treatment) |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1143 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1144 |
nil -> will ignore key |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1145 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1146 |
the default (set in #initialize) is #doubleClick |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1147 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1148 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1149 |
returnKeyActionStyle := aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1150 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1151 |
|
2139 | 1152 |
selectConditionBlock:aBlock |
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1153 |
"set the select-conditionBlock; this block is evaluated before |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1154 |
any selection change is performed (passing the to-be-changed item index as arg). |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1155 |
The change will not be done, if the block returns false. |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1156 |
For example, this allows confirmation queries in the SystemBrowser" |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1157 |
|
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1158 |
selectConditionBlock := aBlock |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1159 |
! |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1160 |
|
1310 | 1161 |
useIndex |
1162 |
"set/clear the useIndex flag. If set, both actionBlock and change-messages |
|
1163 |
are passed the index(indices) of the selection as argument. |
|
1164 |
If clear, the value(s) (i.e. the selected string) is passed. |
|
1165 |
Default is true." |
|
1166 |
||
1167 |
^ useIndex |
|
1168 |
! |
|
1169 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1170 |
useIndex:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1171 |
"set/clear the useIndex flag. If set, both actionBlock and change-messages |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1172 |
are passed the index(indices) of the selection as argument. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1173 |
If clear, the value(s) (i.e. the selected string) is passed. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1174 |
Default is true." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1175 |
|
1235 | 1176 |
useIndex ~~ aBoolean ifTrue:[ |
1177 |
useIndex := aBoolean. |
|
1178 |
useIndex ifTrue:[ |
|
1179 |
changeMsg == #selection: ifTrue:[ |
|
1180 |
changeMsg := #selectionIndex:. |
|
1181 |
aspectMsg := #selectionIndex. |
|
1182 |
] |
|
1183 |
] ifFalse:[ |
|
1184 |
changeMsg == #selectionIndex: ifTrue:[ |
|
1185 |
changeMsg := #selection:. |
|
1186 |
aspectMsg := #selection. |
|
1187 |
] |
|
1188 |
]. |
|
1189 |
]. |
|
1190 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1191 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1192 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1193 |
!SelectionInListView methodsFor:'accessing-attributes'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1194 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1195 |
attributeAt:index |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1196 |
"return the line attribute of list line index. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1197 |
currently supported are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1198 |
#halfIntensity |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1199 |
#disabled |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1200 |
#bold |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1201 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1202 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1203 |
listAttributes isNil ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1204 |
(index > listAttributes size) ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1205 |
^ listAttributes at:index |
125 | 1206 |
] |
1207 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1208 |
^ nil |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1209 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1210 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1211 |
attributeAt:index add:aSymbolOrCollectionOfSymbols |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1212 |
"add to a lines attribute(s); |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1213 |
currently supported are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1214 |
#halfIntensity |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1215 |
#disabled |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1216 |
#bold |
125 | 1217 |
" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1218 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1219 |
|current| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1220 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1221 |
current := self attributeAt:index. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1222 |
current isNil ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1223 |
current := Set new. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1224 |
] ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1225 |
current isSymbol ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1226 |
current == aSymbolOrCollectionOfSymbols ifTrue:[^ self]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1227 |
current := Set with:current |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1228 |
] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1229 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1230 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1231 |
aSymbolOrCollectionOfSymbols isSymbol ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1232 |
current := current add:aSymbolOrCollectionOfSymbols |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1233 |
] ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1234 |
(current includes:aSymbolOrCollectionOfSymbols) ifTrue:[^ self]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1235 |
current addAll:aSymbolOrCollectionOfSymbols |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1236 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1237 |
self attributeAt:index put:current |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1238 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1239 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1240 |
attributeAt:index put:aSymbolOrCollectionOfSymbolsOrNil |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1241 |
"set a lines attribute(s); |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1242 |
currently supported are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1243 |
#halfIntensity |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1244 |
#disabled |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1245 |
#bold |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1246 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1247 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1248 |
(index > self size) ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1249 |
listAttributes isNil ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1250 |
listAttributes := (OrderedCollection new:index) grow:index |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1251 |
] ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1252 |
(index > listAttributes size) ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1253 |
listAttributes grow:index |
125 | 1254 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1255 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1256 |
aSymbolOrCollectionOfSymbolsOrNil = (listAttributes at:index) ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1257 |
listAttributes at:index put:aSymbolOrCollectionOfSymbolsOrNil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1258 |
self redrawLine:index |
125 | 1259 |
] |
1260 |
] |
|
1261 |
||
1262 |
! |
|
1263 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1264 |
attributeAt:index remove:aSymbolOrCollectionOfSymbols |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1265 |
"remove a line attribute; |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1266 |
currently supported are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1267 |
#halfIntensity |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1268 |
#disabled |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1269 |
#bold |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1270 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1271 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1272 |
|current| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1273 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1274 |
current := self attributeAt:index. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1275 |
current isNil ifTrue:[^ self]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1276 |
current isSymbol ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1277 |
aSymbolOrCollectionOfSymbols isSymbol ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1278 |
current == aSymbolOrCollectionOfSymbols ifTrue:[current := nil] |
125 | 1279 |
] ifFalse:[ |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1280 |
(aSymbolOrCollectionOfSymbols includes:current) ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1281 |
current := nil |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1282 |
] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1283 |
] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1284 |
] ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1285 |
aSymbolOrCollectionOfSymbols isSymbol ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1286 |
current := current remove:aSymbolOrCollectionOfSymbols ifAbsent:[] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1287 |
] ifFalse:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1288 |
aSymbolOrCollectionOfSymbols removeAll:aSymbolOrCollectionOfSymbols |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1289 |
] |
125 | 1290 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1291 |
self attributeAt:index put:current |
125 | 1292 |
! |
1293 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1294 |
line:lineNr hasAttribute:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1295 |
"return true, if line nr has attribute, aSymbol; |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1296 |
currently supported attributes are: |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1297 |
#halfIntensity |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1298 |
#disabled |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1299 |
#bold |
125 | 1300 |
" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1301 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1302 |
|attr| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1303 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1304 |
listAttributes isNil ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1305 |
(lineNr > listAttributes size) ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1306 |
attr := listAttributes at:lineNr. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1307 |
attr isNil ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1308 |
attr isSymbol ifTrue:[^ attr == aSymbol]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1309 |
^ (attr includes:aSymbol) |
125 | 1310 |
! |
1311 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1312 |
setAttributes:aList |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1313 |
"set the attribute list. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1314 |
No redraw is done - the caller should make sure to redraw afterwards |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1315 |
(or use this only before the view is visible)." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1316 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1317 |
listAttributes := aList |
125 | 1318 |
! |
1319 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1320 |
strikeOut:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1321 |
"turn on/off strikeOut mode" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1322 |
|
2516 | 1323 |
self obsoleteMethodWarning:'use #strikeout:'. |
1324 |
strikeOut := aBoolean. |
|
1325 |
! |
|
1326 |
||
1327 |
strikeout:aBoolean |
|
1328 |
"turn on/off strikeOut mode" |
|
1329 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1330 |
strikeOut := aBoolean. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1331 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1332 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1333 |
!SelectionInListView methodsFor:'accessing-behavior'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1334 |
|
1181
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1335 |
dragObjectConverter:aBlock |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1336 |
"set an optional dragObject converter; |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1337 |
if non-nil, this one will be evaluated on a drag-start, |
1182
b8af34a9be46
allow a dropConverter to return nil (ignore on drop)
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1338 |
for each dropItem as argument, and supposed |
b8af34a9be46
allow a dropConverter to return nil (ignore on drop)
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1339 |
to convert it into a dragObject and return it. |
b8af34a9be46
allow a dropConverter to return nil (ignore on drop)
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1340 |
If it returns nil, the object will not be dropped. |
1181
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1341 |
Useful, if the receiver view represents fileNames or other |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1342 |
names of the actual objects to be dragged." |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1343 |
|
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1344 |
dragObjectConverter := aBlock |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1345 |
|
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1346 |
"Created: 6.4.1997 / 12:16:11 / cg" |
1182
b8af34a9be46
allow a dropConverter to return nil (ignore on drop)
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1347 |
"Modified: 6.4.1997 / 14:12:45 / cg" |
1181
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1348 |
! |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
1349 |
|
987
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1350 |
enabled |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1351 |
"return true if selections are possible" |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1352 |
|
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1353 |
^ enabled. |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1354 |
|
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1355 |
"Created: 29.1.1997 / 12:40:54 / stefan" |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1356 |
! |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
1357 |
|
1831 | 1358 |
enabled:aBoolean |
1359 |
"enable/disable the view - selection changes are allowed/disallowed" |
|
1360 |
||
1361 |
enabled := aBoolean |
|
1362 |
||
1363 |
"Modified: / 30.3.1999 / 15:26:10 / stefan" |
|
1364 |
! |
|
1365 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1366 |
ignoreReselect:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1367 |
"set/clear the ignoreReselect flag - |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1368 |
if set, a click on an already selected entry is ignored. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1369 |
Otherwise the notification is done, even if no |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1370 |
change in the selection occurs. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1371 |
(for example, in browser to update a method). |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1372 |
Setting ignoreReselect to false makes sense if data is shown |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1373 |
which may change by itself (i.e. without the user doing anything) |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1374 |
For example, the inspector uses this, and redisplays the value, |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1375 |
if the selection is the same. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1376 |
The default is true, meaning that a click on an already selected |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1377 |
does not lead to a notification via the actionBlock/change mechanism." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1378 |
|
997 | 1379 |
"ca: |
1380 |
multiple selection on: the ignoreReselect will have no influence |
|
1381 |
" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1382 |
ignoreReselect := aBoolean |
125 | 1383 |
! |
1384 |
||
2329 | 1385 |
multipleSelectOk |
1386 |
^ multipleSelectOk |
|
1387 |
! |
|
1388 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1389 |
multipleSelectOk:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1390 |
"allow/disallow multiple selections. If enabled, the |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1391 |
user may select multiple entries in the list, and the program |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1392 |
always gets a collection of selected items (indexes if useIndex is true, |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1393 |
values otherwise). The default is false, for single selections." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1394 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1395 |
multipleSelectOk := aBoolean. |
997 | 1396 |
|
125 | 1397 |
! |
1398 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1399 |
toggleSelect:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1400 |
"turn on/off toggle select. If true, clicking on a selected entry |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1401 |
unselects it and vice versa. The default is false, which means |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1402 |
that clicking on an already selected entry does not change its |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1403 |
select status (see also ignoreReselect:)." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1404 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1405 |
toggleSelect := aBoolean. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1406 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1407 |
|
1163
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1408 |
!SelectionInListView methodsFor:'accessing-channels'! |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1409 |
|
1310 | 1410 |
listHolder |
1411 |
^ listChannel |
|
1412 |
! |
|
1413 |
||
1414 |
listHolder:aListHolder |
|
1415 |
listChannel notNil ifTrue:[ |
|
1416 |
listChannel removeDependent:self |
|
1417 |
]. |
|
1418 |
(listChannel := aListHolder) notNil ifTrue:[ |
|
1419 |
listChannel addDependent:self |
|
1420 |
]. |
|
1421 |
self getListFromModel |
|
1163
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1422 |
! ! |
05ec30ba9b17
added enableChannel & example.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
1423 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1424 |
!SelectionInListView methodsFor:'accessing-contents'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1425 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1426 |
add:aValue beforeIndex:index |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1427 |
"must recompute our current selections" |
125 | 1428 |
|
1429 |
selection notNil ifTrue:[ |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1430 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1431 |
selection := selection collect:[ :sel | |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1432 |
sel >= index ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1433 |
sel + 1 |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1434 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1435 |
sel |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1436 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1437 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1438 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1439 |
selection >= index ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1440 |
selection := selection + 1. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1441 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1442 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1443 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1444 |
^ super add:aValue beforeIndex:index. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1445 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1446 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1447 |
contents:aCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1448 |
"set the list - redefined, since setting the list implies unselecting |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1449 |
and clearing attributes. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1450 |
No redraw is done - the caller should make sure to redraw afterwards |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1451 |
(or use this only before the view is visible)." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1452 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1453 |
selection := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1454 |
listAttributes := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1455 |
super contents:aCollection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1456 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1457 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1458 |
list:aCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1459 |
"set the list - redefined, since setting the list implies unselecting |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1460 |
and clearing attributes." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1461 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1462 |
self list:aCollection keepSelection:false |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1463 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1464 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1465 |
list:aCollection keepSelection:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1466 |
"set the list - redefined, since setting the list implies unselecting |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1467 |
and clearing attributes." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1468 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1469 |
|oldSelection| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1470 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1471 |
"somewhat of a kludge: if selection is first line, |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1472 |
we have to remove the highlight frame by hand here" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1473 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1474 |
(shown and:[hilightLevel ~~ 0]) ifTrue:[ |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1475 |
selection == firstLineShown ifTrue:[ |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1476 |
self paint:bgColor. |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1477 |
self fillRectangleX:margin y:margin |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1478 |
width:(width - (margin * 2)) |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1479 |
height:(hilightLevel abs). |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1480 |
]. |
125 | 1481 |
]. |
1482 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1483 |
aBoolean ifTrue:[ |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1484 |
oldSelection := selection. |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1485 |
selection := nil. |
125 | 1486 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1487 |
listAttributes := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1488 |
super list:aCollection expandTabs:printItems. |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1489 |
self setSelection:oldSelection. "/ nil if keep is false |
2232
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1490 |
selection ~= oldSelection ifTrue:[ |
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1491 |
"/ cannot keep the selection (items removed) |
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1492 |
"/ must tell the model if there is one .... |
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1493 |
self selectionChangedFrom:oldSelection |
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
1494 |
]. |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1495 |
|
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
1496 |
"Modified: 25.5.1996 / 16:31:13 / cg" |
31 | 1497 |
! |
1498 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1499 |
printItems:aBoolean |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1500 |
"set/clear the printItems flag. If set, items (as set via #list: or |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1501 |
as returned from the model) are sent #printString to display them. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1502 |
If false, items are assumed to be either strings, or know how to |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1503 |
display themself in a GC (i.e. they are instances of ListEntry). |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1504 |
The default is false. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1505 |
Caveat: printString seems to be too specialized - I'd rather have |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1506 |
a definable printSelector or - better - a printConverter. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1507 |
This may be added in the future." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1508 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1509 |
printItems := aBoolean |
125 | 1510 |
! |
1511 |
||
2255
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1512 |
removeFromIndex:startLineNr toIndex:endLineNr |
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1513 |
"must recompute our current selections" |
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1514 |
|
2256 | 1515 |
|oldSelection| |
1516 |
||
2255
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1517 |
selection notNil ifTrue:[ |
2256 | 1518 |
oldSelection := selection copy. |
1519 |
||
1520 |
"/ a kludge - if the first line is in the selection, |
|
1521 |
"/ and the selection is drawn with an extra inverted area around, |
|
1522 |
"/ we must invalidate the line before as well. |
|
2633
96d7e5d626ae
redraw bug fix (highlightFrame leftover when deleting lines)
Claus Gittinger <cg@exept.de>
parents:
2597
diff
changeset
|
1523 |
(hilightFrameColor notNil or:[hilightStyle == #motif]) ifTrue:[ |
2256 | 1524 |
(self isInSelection:startLineNr) ifTrue:[ |
1525 |
startLineNr > 1 ifTrue:[ |
|
1526 |
self invalidateLine:(startLineNr - 1) |
|
1527 |
] |
|
1528 |
]. |
|
1529 |
]. |
|
1530 |
||
2255
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1531 |
endLineNr to:startLineNr by:-1 do:[:eachIndex | self checkRemovingSelection:eachIndex]. |
2256 | 1532 |
oldSelection ~= selection ifTrue:[ |
1533 |
"/ cannot keep the selection (items removed) |
|
1534 |
"/ must tell the model if there is one .... |
|
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1535 |
model notNil ifTrue:[model removeDependent:self]. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1536 |
[ |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1537 |
self selectionChangedFrom:oldSelection |
2519
a088ad3bb1e5
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
2516
diff
changeset
|
1538 |
] ensure:[ |
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1539 |
model notNil ifTrue:[model addDependent:self]. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1540 |
]. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1541 |
]. |
2255
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1542 |
]. |
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1543 |
super removeFromIndex:startLineNr toIndex:endLineNr. |
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1544 |
! |
0bd7f58945b7
oops - must care for selection when doing bulk-removes
Claus Gittinger <cg@exept.de>
parents:
2247
diff
changeset
|
1545 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1546 |
removeIndexWithoutRedraw:lineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1547 |
"delete line - no redraw; |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1548 |
return true, if something was really deleted. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1549 |
Redefined since we have to care for selection" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1550 |
|
2256 | 1551 |
|oldSelection| |
1552 |
||
1553 |
selection notNil ifTrue:[ |
|
1554 |
oldSelection := selection copy. |
|
1555 |
self checkRemovingSelection:lineNr. |
|
1556 |
oldSelection ~= selection ifTrue:[ |
|
1557 |
"/ cannot keep the selection (items removed) |
|
1558 |
"/ must tell the model if there is one .... |
|
1559 |
self selectionChangedFrom:oldSelection |
|
1560 |
] |
|
1561 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1562 |
^ super removeIndexWithoutRedraw:lineNr |
105 | 1563 |
! |
1564 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1565 |
setContents:aCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1566 |
"set the list - redefined, since setting the list implies unselecting |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1567 |
and clearing attributes. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1568 |
No redraw is done - the caller should make sure to redraw afterwards |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1569 |
(or use this only before the view is visible)." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1570 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1571 |
selection := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1572 |
listAttributes := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1573 |
super setContents:aCollection. |
125 | 1574 |
! |
1575 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1576 |
setList:aCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1577 |
"set the list - redefined, since setting the list implies unselecting |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1578 |
and clearing attributes. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1579 |
No redraw is done - the caller should make sure to redraw afterwards |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1580 |
(or use this only before the view is visible)." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1581 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1582 |
selection := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1583 |
listAttributes := nil. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1584 |
super setList:aCollection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1585 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1586 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1587 |
!SelectionInListView methodsFor:'accessing-look'! |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1588 |
|
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1589 |
selectedVisualBlock:aBlock |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
1590 |
"ST-80 compatibility: provide a block, which returns a displayObject to be drawn for |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
1591 |
selected items." |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1592 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1593 |
selectedVisualBlock := aBlock |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1594 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1595 |
"Created: / 27.10.1997 / 19:50:58 / cg" |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1596 |
"Modified: / 21.6.1998 / 02:40:46 / cg" |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1597 |
! |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1598 |
|
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1599 |
visualBlock:aBlock |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
1600 |
"ST-80 compatibility: provide a block, which returns a displayObject to be drawn for |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
1601 |
unselected items." |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1602 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1603 |
visualBlock := aBlock |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1604 |
|
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1605 |
"Modified: / 21.6.1998 / 02:40:57 / cg" |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1606 |
! ! |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
1607 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1608 |
!SelectionInListView methodsFor:'accessing-mvc'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1609 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1610 |
addModelInterfaceTo:aDictionary |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1611 |
"see comment in View>>modelInterface" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1612 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1613 |
super addModelInterfaceTo:aDictionary. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1614 |
aDictionary at:#doubleClickMessage put:doubleClickMsg. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1615 |
aDictionary at:#initialSelectionMessage put:initialSelectionMsg. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1616 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1617 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1618 |
SelectionInListView new modelInterface |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1619 |
" |
105 | 1620 |
! |
1621 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1622 |
doubleClick:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1623 |
"set the symbol with which the model is informed about double-click. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1624 |
OBSOLETE: please use #doubleClickMessage:" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1625 |
|
2369 | 1626 |
<resource:#obsolete> |
1627 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1628 |
self obsoleteMethodWarning:'please use #doubleClickMessage:'. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1629 |
doubleClickMsg := aSymbol |
105 | 1630 |
! |
1631 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1632 |
doubleClickMessage |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1633 |
"return the symbol with which the model (if any) is informed about |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1634 |
double-click. If nil (which is the default), it is not informed." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1635 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1636 |
^ doubleClickMsg |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1637 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1638 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1639 |
doubleClickMessage:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1640 |
"set the symbol with which the model (if any) is informed about double-click. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1641 |
If nil (which is the default), it is not informed." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1642 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1643 |
doubleClickMsg := aSymbol |
119 | 1644 |
! |
1645 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1646 |
initialSelectionMessage |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1647 |
"return the symbol by which the model informes me about a changed |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1648 |
selectionIndex. This is used both in change notification and to |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1649 |
actually aquire a new selection value." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1650 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1651 |
^ initialSelectionMsg |
125 | 1652 |
! |
1653 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1654 |
initialSelectionMessage:aSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1655 |
"set the symbol by which the model informes me about a changed |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1656 |
selectionIndex. This is used both in change notification and to |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1657 |
actually aquire a new selection value." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1658 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1659 |
initialSelectionMsg := aSymbol |
125 | 1660 |
! |
1661 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1662 |
on:aModel printItems:print oneItem:one aspect:aspectSymbol change:changeSymbol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1663 |
list:listSymbol menu:menuSymbol initialSelection:initialSymbol useIndex:use |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1664 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1665 |
"ST-80 compatibility" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1666 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1667 |
aspectMsg := aspectSymbol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1668 |
changeMsg := changeSymbol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1669 |
listMsg := listSymbol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1670 |
menuMsg := menuSymbol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1671 |
initialSelectionMsg := initialSymbol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1672 |
printItems := print. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1673 |
oneItem := one. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1674 |
useIndex := use. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1675 |
ignoreReselect := false. "/ ST80 behavior |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1676 |
self model:aModel. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1677 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1678 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1679 |
!SelectionInListView methodsFor:'accessing-selection'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1680 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1681 |
addElementToSelection:anObject |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1682 |
"add the element with the same printstring as the argument, anObject |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1683 |
to the selection. The entry is searched by comparing printStrings. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1684 |
No scrolling is done. Returns true, if ok, false if no such entry |
886 | 1685 |
was found. |
1686 |
*** No model and/or actionBlock notification is done here." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1687 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1688 |
|lineNo str| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1689 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1690 |
str := anObject printString. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1691 |
lineNo := list findFirst:[:entry | str = entry printString]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1692 |
lineNo ~~ 0 ifTrue:[ |
886 | 1693 |
self addToSelection:lineNo. |
1694 |
^ true |
|
125 | 1695 |
]. |
1696 |
^ false |
|
886 | 1697 |
|
1698 |
"Modified: 15.11.1996 / 16:59:43 / cg" |
|
125 | 1699 |
! |
1700 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1701 |
addToSelection:aNumber |
886 | 1702 |
"add entry, aNumber to the selection. No scrolling is done. |
1703 |
*** No model and/or actionBlock notification is done here." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1704 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1705 |
(self isValidSelection:aNumber) ifFalse:[^ self]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1706 |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
1707 |
"/ this item selectable ? |
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1708 |
(selectConditionBlock notNil |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
1709 |
and:[(selectConditionBlock value:aNumber) not]) ifTrue:[^ self]. |
1409 | 1710 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1711 |
selection isNil ifTrue:[^ self selectWithoutScroll:aNumber]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1712 |
selection isCollection ifTrue:[ |
886 | 1713 |
(selection includes:aNumber) ifTrue:[^ self]. |
2136
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1714 |
|
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1715 |
"/ to enforce the change-message (value is identical to oldValue) |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1716 |
selection isList ifTrue:[ |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1717 |
selection add:aNumber |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1718 |
] ifFalse:[ |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1719 |
selection := selection asOrderedCollection. |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1720 |
selection := selection copyWith:aNumber |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1721 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1722 |
] ifFalse:[ |
886 | 1723 |
(aNumber == selection) ifTrue:[^ self]. |
1724 |
selection := OrderedCollection with:selection with:aNumber |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1725 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1726 |
self redrawElement:aNumber |
886 | 1727 |
|
2136
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1728 |
"Modified: / 11.2.2000 / 01:38:45 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1729 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1730 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1731 |
removeFromSelection:aNumber |
886 | 1732 |
"remove entry, aNumber from the selection. |
1733 |
*** No model and/or actionBlock notification is done here." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1734 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1735 |
selection isNil ifTrue:[^ self]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1736 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
1737 |
self multipleSelectOk ifTrue:[ |
886 | 1738 |
(selection includes:aNumber) ifFalse:[^ self]. |
2136
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1739 |
|
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1740 |
selection isList ifTrue:[ |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1741 |
selection remove:aNumber ifAbsent:nil |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1742 |
] ifFalse:[ |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1743 |
"/ to enforce the change-message (value is identical to oldValue) |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1744 |
selection := selection asOrderedCollection. |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1745 |
selection := selection copyWithout:aNumber |
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1746 |
]. |
886 | 1747 |
selection size == 0 ifTrue:[ |
2136
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1748 |
selection := #() |
886 | 1749 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1750 |
] ifFalse:[ |
886 | 1751 |
(aNumber == selection) ifFalse:[^ self]. |
1752 |
selection := nil |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1753 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1754 |
self redrawElement:aNumber |
886 | 1755 |
|
2136
eb816448daec
care for multiSelect into a non-list;
Claus Gittinger <cg@exept.de>
parents:
2125
diff
changeset
|
1756 |
"Modified: / 11.2.2000 / 01:41:24 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1757 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1758 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1759 |
!SelectionInListView methodsFor:'change & update'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1760 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1761 |
update:something with:aParameter from:changedObject |
2246 | 1762 |
|listValue start stop size idx| |
1345 | 1763 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1764 |
changedObject == model ifTrue:[ |
1235 | 1765 |
something == aspectMsg ifTrue:[ |
1358 | 1766 |
listChannel isNil ifTrue:[ |
1767 |
self getListFromModel |
|
1768 |
]. |
|
1235 | 1769 |
self getSelectionFromModel. |
1770 |
^ self |
|
1771 |
]. |
|
1772 |
something == listMsg ifTrue:[ |
|
1773 |
self getListFromModel. |
|
1774 |
^ self |
|
1775 |
]. |
|
1776 |
something == initialSelectionMsg ifTrue:[ |
|
1777 |
self getSelectionFromModel. |
|
1778 |
^ self |
|
1779 |
]. |
|
1780 |
something == #empty ifTrue:[ |
|
1781 |
self list:nil. |
|
1782 |
^ self |
|
1783 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
1784 |
]. |
1345 | 1785 |
changedObject == listChannel ifFalse:[ |
1786 |
^ super update:something with:aParameter from:changedObject |
|
1787 |
]. |
|
2246 | 1788 |
listValue := listChannel value. |
1345 | 1789 |
|
1790 |
something == #at: ifTrue:[ |
|
1844
a76a2ba85a4b
list change notification #at:
Claus Gittinger <cg@exept.de>
parents:
1831
diff
changeset
|
1791 |
idx := aParameter isCollection ifTrue:[aParameter at:1] |
a76a2ba85a4b
list change notification #at:
Claus Gittinger <cg@exept.de>
parents:
1831
diff
changeset
|
1792 |
ifFalse:[aParameter]. |
2246 | 1793 |
^ self at:aParameter put:(listValue at:idx). |
1345 | 1794 |
]. |
1795 |
||
1796 |
something == #insert: ifTrue:[ |
|
2264
f5cd15f186f8
care for nil selectable-index in cursorUp/down
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
1797 |
listValue == list ifTrue:[self halt:'should not happen']. |
2246 | 1798 |
^ self add:(listValue at:aParameter) beforeIndex:aParameter |
1345 | 1799 |
]. |
1800 |
||
1801 |
something == #remove: ifTrue:[ |
|
1802 |
^ self removeIndex:aParameter |
|
1803 |
]. |
|
1804 |
||
1805 |
something == #insertCollection: ifTrue:[ |
|
1473 | 1806 |
(size := aParameter last) ~~ 0 ifTrue:[ |
2246 | 1807 |
(self size == 0 or:[size > 50]) ifTrue:[ |
1473 | 1808 |
self getListFromModel |
1809 |
] ifFalse:[ |
|
2264
f5cd15f186f8
care for nil selectable-index in cursorUp/down
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
1810 |
listValue == list ifTrue:[self halt:'should not happen']. |
1473 | 1811 |
start := aParameter first. |
2246 | 1812 |
"/ self addAll:(listValue copyFrom:start to:start+size-1) beforeIndex:start. |
1473 | 1813 |
size timesRepeat:[ |
2246 | 1814 |
self add:(listValue at:start) beforeIndex:start. |
1473 | 1815 |
start := start + 1 |
1816 |
] |
|
1358 | 1817 |
] |
1345 | 1818 |
]. |
1310 | 1819 |
^ self |
1820 |
]. |
|
1345 | 1821 |
|
1822 |
something == #removeFrom: ifTrue:[ |
|
1823 |
start := aParameter first. |
|
1824 |
stop := aParameter last. |
|
1825 |
||
1826 |
(start == 1 and:[stop == self size]) ifTrue:[ |
|
1473 | 1827 |
self getListFromModel |
1345 | 1828 |
] ifFalse:[ |
2235
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
1829 |
"/ "/ old code |
2234
e88a450b1503
used #removeFromIndex:toIndex: when updating from a list model
Claus Gittinger <cg@exept.de>
parents:
2232
diff
changeset
|
1830 |
"/ (stop - start + 1) timesRepeat:[ |
e88a450b1503
used #removeFromIndex:toIndex: when updating from a list model
Claus Gittinger <cg@exept.de>
parents:
2232
diff
changeset
|
1831 |
"/ self removeIndex:start |
e88a450b1503
used #removeFromIndex:toIndex: when updating from a list model
Claus Gittinger <cg@exept.de>
parents:
2232
diff
changeset
|
1832 |
"/ ] |
2235
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
1833 |
"/ new code |
2234
e88a450b1503
used #removeFromIndex:toIndex: when updating from a list model
Claus Gittinger <cg@exept.de>
parents:
2232
diff
changeset
|
1834 |
self removeFromIndex:start toIndex:stop. |
1345 | 1835 |
]. |
1836 |
^ self |
|
1837 |
]. |
|
1838 |
||
1839 |
something == #replace: ifTrue:[ |
|
1840 |
start := aParameter first. |
|
1841 |
stop := aParameter last. |
|
1842 |
||
2247
7994ab3193f9
tuned multiLine replace update from model
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1843 |
"/ old code |
7994ab3193f9
tuned multiLine replace update from model
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1844 |
"/ start to:stop do:[:anIndex| |
7994ab3193f9
tuned multiLine replace update from model
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1845 |
"/ self at:anIndex put:(listValue at:anIndex) |
7994ab3193f9
tuned multiLine replace update from model
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1846 |
"/ ]. |
7994ab3193f9
tuned multiLine replace update from model
Claus Gittinger <cg@exept.de>
parents:
2246
diff
changeset
|
1847 |
"/ new code |
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1848 |
list size = listValue size ifTrue:[ |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1849 |
self replaceFrom:start to:stop with:listValue startingAt:start. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1850 |
^ self |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
1851 |
]. |
1345 | 1852 |
]. |
1853 |
||
1854 |
self getListFromModel. |
|
1400 | 1855 |
|
1856 |
"Modified: / 14.11.1997 / 13:51:04 / cg" |
|
1831 | 1857 |
"Modified: / 30.3.1999 / 14:27:42 / stefan" |
125 | 1858 |
! ! |
1859 |
||
2563
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1860 |
!SelectionInListView methodsFor:'drag & drop'! |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1861 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1862 |
allowDrag:aBoolean |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1863 |
"enable/disable dragging support" |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1864 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1865 |
allowDrag := aBoolean |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1866 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1867 |
"Created: 14.11.1996 / 15:12:58 / cg" |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1868 |
! |
1473 | 1869 |
|
1870 |
canDrag |
|
1871 |
"returns true if dragging is enabled |
|
1872 |
" |
|
1873 |
^ (allowDrag or:[dropSource notNil]) |
|
1874 |
! |
|
1875 |
||
1876 |
dropSource |
|
1877 |
"returns the dropSource or nil |
|
1878 |
" |
|
1879 |
^ dropSource |
|
1880 |
! |
|
1881 |
||
1882 |
dropSource:aDropSourceOrNil |
|
1883 |
"set the dropSource or nil |
|
1884 |
" |
|
1885 |
dropSource := aDropSourceOrNil. |
|
1886 |
||
1887 |
||
1888 |
! |
|
1889 |
||
1890 |
dropTarget |
|
1891 |
"returns the dropTarget or nil |
|
1892 |
" |
|
1893 |
^ dropTarget |
|
1894 |
! |
|
1895 |
||
1896 |
dropTarget:aDropTragetOrNil |
|
1897 |
"set the dropTarget or nil |
|
1898 |
" |
|
1899 |
dropTarget := aDropTragetOrNil. |
|
1900 |
||
1901 |
||
1902 |
! |
|
1903 |
||
1904 |
startDragAt:aPoint |
|
1905 |
||
1906 |
dropSource isNil ifTrue:[ |
|
2563
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1907 |
dragIsActive := true. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1908 |
DragAndDropManager startDrag:(self collectionOfDragObjects) |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1909 |
from:self |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1910 |
offset:0 @ 0 |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1911 |
atEnd:endDragAction |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1912 |
display:(self selectionValue). |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
1913 |
|
1473 | 1914 |
] ifFalse:[ |
1915 |
dropSource startDragIn:self at:aPoint |
|
1916 |
] |
|
1917 |
! ! |
|
1918 |
||
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1919 |
!SelectionInListView methodsFor:'drawing'! |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1920 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1921 |
drawRightArrowInVisibleLine:visLineNr |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1922 |
"draw a right arrow (for submenus). |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1923 |
This method is not used here, but provided for subclasses such |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1924 |
as menus or file-lists." |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1925 |
|
988 | 1926 |
|y x form form2 topLeftColor botRightColor t itemHeight listLine item| |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1927 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1928 |
x := width - 16. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1929 |
y := (self yOfVisibleLine:visLineNr). |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1930 |
|
988 | 1931 |
listLine := self visibleLineToListLine:visLineNr. |
1932 |
item := self at:listLine. |
|
1933 |
item isNil ifTrue:[ |
|
1934 |
itemHeight := fontHeight |
|
1935 |
] ifFalse:[ |
|
1936 |
itemHeight := item heightOn:self. |
|
1937 |
]. |
|
1938 |
||
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1939 |
(device depth == 1 or:[arrowLevel == 0]) ifTrue:[ |
988 | 1940 |
form := self class rightArrowFormOn:device. |
1941 |
form notNil ifTrue:[ |
|
1942 |
y := y + ((itemHeight - form height) // 2). |
|
2037 | 1943 |
self foreground:( |
1944 |
(self isInSelection:listLine) |
|
1945 |
ifTrue:[hilightFgColor] |
|
1946 |
ifFalse:[fgColor]). |
|
988 | 1947 |
self displayForm:form x:x y:y. |
1948 |
] |
|
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1949 |
] ifFalse:[ |
988 | 1950 |
smallArrow ifTrue:[ |
1951 |
form := self class smallRightArrowLightFormOn:device. |
|
1952 |
form2 := self class smallRightArrowShadowFormOn:device. |
|
1953 |
] ifFalse:[ |
|
1954 |
form := self class rightArrowLightFormOn:device. |
|
1955 |
form2 := self class rightArrowShadowFormOn:device. |
|
1956 |
]. |
|
1957 |
(form isNil or:[form2 isNil]) ifTrue:[ |
|
1958 |
"/ very bad conditions |
|
1959 |
^ self |
|
1960 |
]. |
|
1961 |
y := y + ((itemHeight - form height) // 2). |
|
1962 |
||
1963 |
topLeftColor := lightColor. |
|
1964 |
botRightColor := shadowColor. |
|
1965 |
||
1966 |
"openwin arrow stays down" |
|
1967 |
styleSheet name ~~ #openwin ifTrue:[ |
|
1968 |
(self isInSelection:listLine) ifTrue:[ |
|
1969 |
t := topLeftColor. |
|
1970 |
topLeftColor := botRightColor. |
|
1971 |
botRightColor := t. |
|
1972 |
] |
|
1973 |
]. |
|
1974 |
arrowLevel < 0 ifTrue:[ |
|
1975 |
t := topLeftColor. |
|
1976 |
topLeftColor := botRightColor. |
|
1977 |
botRightColor := t. |
|
1978 |
]. |
|
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1979 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1980 |
"/ self foreground:topLeftColor. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1981 |
self paint:topLeftColor. |
988 | 1982 |
self displayForm:form x:x y:y. |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1983 |
"/ self foreground:botRightColor. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1984 |
self paint:botRightColor. |
988 | 1985 |
self displayForm:form2 x:x y:y. |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1986 |
] |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1987 |
! |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1988 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1989 |
drawVisibleLineSelected:visLineNr |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1990 |
"redraw a single line as selected." |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1991 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1992 |
self drawVisibleLineSelected:visLineNr with:hilightFgColor and:hilightBgColor |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1993 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1994 |
"Modified: / 31.8.1995 / 19:24:09 / claus" |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
1995 |
"Modified: / 21.6.1998 / 03:12:56 / cg" |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1996 |
! |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1997 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1998 |
drawVisibleLineSelected:visLineNr with:fg and:bg |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
1999 |
"redraw a single line as selected." |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2000 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2001 |
|listLine |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2002 |
y "{ Class: SmallInteger }" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2003 |
y2 "{ Class: SmallInteger }" |
2330
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2004 |
wEdge dObj item t| |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2005 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2006 |
listLine := self visibleLineToListLine:visLineNr. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2007 |
listLine notNil ifTrue:[ |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2008 |
y := self yOfVisibleLine:visLineNr. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2009 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2010 |
selectedVisualBlock notNil ifTrue:[ |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2011 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2012 |
self paint:bg. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2013 |
self fillRectangleX:margin y:y - (lineSpacing//2) |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2014 |
width:(width - (2 * margin)) |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2015 |
height:fontHeight. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2016 |
]. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2017 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2018 |
dObj := selectedVisualBlock value:self value:listLine. |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2019 |
self paint:fg on:bg. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2020 |
dObj displayOn:self x:textStartLeft y:y + font ascent opaque:true. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2021 |
] ifFalse:[ |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2022 |
strikeOut ifTrue:[ |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2023 |
self drawVisibleLine:visLineNr with:fgColor and:bgColor. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2024 |
|
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2025 |
self paint:fgColor. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2026 |
y := y + (fontHeight // 2). |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2027 |
self displayLineFromX:0 y:y toX:width y:y. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2028 |
^ self |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2029 |
]. |
2330
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2030 |
"/ kludge: |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2031 |
"/ care for text objects with a color |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2032 |
"/ if the contrast between the fg-color and the selection-bg is too small, |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2033 |
"/ the item is not readable anymore ... |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2034 |
item := list at:listLine. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2035 |
(item isText and:[item hasChangeOfEmphasis]) ifTrue:[ |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2036 |
t := Text string:item string emphasisCollection:item emphasis asArray. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2037 |
t emphasisAllRemove:#color. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2038 |
self |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2039 |
drawLine:t |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
2040 |
atX:(textStartLeft - viewOrigin x) |
2330
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2041 |
inVisible:visLineNr |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2042 |
with:fg |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2043 |
and:bg |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2044 |
] ifFalse:[ |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2045 |
(item class == LabelAndIcon |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2046 |
and:[(t := item string) notNil |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2047 |
and:[(t isText and:[t hasChangeOfEmphasis])]]) ifTrue:[ |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2048 |
t := Text string:t string emphasisCollection:t emphasis asArray. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2049 |
t emphasisAllRemove:#color. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2050 |
t := LabelAndIcon icon:item icon string:t. |
2537
46a01c4d6d4d
fix for dual icon LabelAndIcon
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
2051 |
t image:(item image). |
46a01c4d6d4d
fix for dual icon LabelAndIcon
Claus Gittinger <cg@exept.de>
parents:
2519
diff
changeset
|
2052 |
t gap:(item gap). |
2330
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2053 |
self |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2054 |
drawLine:t |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
2055 |
atX:(textStartLeft - viewOrigin x) |
2330
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2056 |
inVisible:visLineNr |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2057 |
with:fg |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2058 |
and:bg |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2059 |
] ifFalse:[ |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2060 |
self drawVisibleLine:visLineNr with:fg and:bg. |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2061 |
] |
0b1dfad5e081
when drawing a selected line, look for any color emphasis
Claus Gittinger <cg@exept.de>
parents:
2329
diff
changeset
|
2062 |
] |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2063 |
]. |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2064 |
|
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
2065 |
y := y - (lineSpacing//2). |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2066 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2067 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2068 |
a line above and below |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2069 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2070 |
hilightFrameColor notNil ifTrue:[ |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2071 |
hilightLevel == 0 ifTrue:[ |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2072 |
self paint:hilightFrameColor. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2073 |
self displayLineFromX:0 y:y toX:width y:y. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2074 |
y2 := y + fontHeight - 1. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2075 |
self displayLineFromX:0 y:y2 toX:width y:y2. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2076 |
^ self |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2077 |
] |
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2078 |
] ifFalse:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2079 |
hilightStyle == #motif ifTrue:[ |
2633
96d7e5d626ae
redraw bug fix (highlightFrame leftover when deleting lines)
Claus Gittinger <cg@exept.de>
parents:
2597
diff
changeset
|
2080 |
"/ an additional line, inset by one pixel |
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2081 |
self paint:fg. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2082 |
self displayLineFromX:0 y:y+1 toX:width y:y+1. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2083 |
y2 := y + fontHeight - 1 - 1. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2084 |
self displayLineFromX:0 y:y2 toX:width y:y2. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2085 |
] |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2086 |
]. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2087 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2088 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2089 |
an edge it around |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2090 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2091 |
(hilightLevel ~~ 0) ifTrue:[ |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2092 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2093 |
let edge start at left, extending to the full width |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2094 |
XXX: widthOfContents should be cached in ListView |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2095 |
(instead of recomputing all over) |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2096 |
" |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2097 |
wEdge := width-(2 * margin). |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2098 |
includesNonStrings ifFalse:[ |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2099 |
wEdge := wEdge max:(self widthOfContents). |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2100 |
]. |
2429
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
2101 |
self drawEdgesForX:(margin - viewOrigin x) y:y |
eed79a96e43b
eliminated accesses to leftOffset
Claus Gittinger <cg@exept.de>
parents:
2413
diff
changeset
|
2102 |
width:wEdge+viewOrigin x height:fontHeight |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2103 |
level:hilightLevel. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2104 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2105 |
|
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2106 |
]. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2107 |
^ self |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2108 |
]. |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2109 |
^ super drawVisibleLine:visLineNr with:fg and:bg |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2110 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2111 |
"Modified: / 31.8.1995 / 19:24:09 / claus" |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2112 |
"Created: / 28.2.1996 / 18:40:21 / cg" |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2113 |
"Modified: / 21.6.1998 / 03:51:04 / cg" |
429
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2114 |
! ! |
678f8d820c0f
fixed round-edge drawing; slight rewrite
Claus Gittinger <cg@exept.de>
parents:
401
diff
changeset
|
2115 |
|
125 | 2116 |
!SelectionInListView methodsFor:'event handling'! |
2117 |
||
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2118 |
buttonControlPress:button x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2119 |
"if multipleSelectOk: add to the selection; |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2120 |
otherwise, behave like normal select" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2121 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2122 |
|oldSelection listLineNr| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2123 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2124 |
((button == 1) or:[button == #select]) ifTrue:[ |
1299 | 2125 |
"/ toggleSelect ifTrue:[ |
2126 |
"/ ^ self buttonPress:button x:x y:y |
|
2127 |
"/ ]. |
|
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2128 |
selectionAtClickTime := nil. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2129 |
|
816 | 2130 |
enabled ifTrue:[ |
2413 | 2131 |
listLineNr := self lineAtY:y. "/ self visibleLineToListLine:(self visibleLineOfY:y). |
816 | 2132 |
listLineNr notNil ifTrue:[ |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2133 |
(self lineIsEnabled:listLineNr) ifFalse:[^ self]. |
816 | 2134 |
]. |
2135 |
oldSelection := selection copy. |
|
2136 |
listLineNr notNil ifTrue: [ |
|
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2137 |
"/ this item selectable ? |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2138 |
(selectConditionBlock notNil |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2139 |
and:[(selectConditionBlock value:listLineNr) not]) ifTrue:[^ self]. |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2140 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2141 |
self multipleSelectOk ifTrue:[ |
816 | 2142 |
(self isInSelection:listLineNr) ifTrue:[ |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2143 |
self removeFromSelection:listLineNr. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2144 |
selectMode := false. |
816 | 2145 |
] ifFalse:[ |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2146 |
self addToSelection:listLineNr. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2147 |
selectMode := true. |
816 | 2148 |
] |
2149 |
] ifFalse:[ |
|
2150 |
self selectWithoutScroll:listLineNr |
|
2151 |
] |
|
2152 |
]. |
|
2153 |
((ignoreReselect not and:[selection notNil]) |
|
2154 |
or:[selection ~= oldSelection]) ifTrue:[ |
|
2155 |
self selectionChangedFrom:oldSelection. |
|
2156 |
]. |
|
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2157 |
clickLine := listLineNr. |
816 | 2158 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2159 |
] ifFalse:[ |
816 | 2160 |
super buttonPress:button x:x y:y |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2161 |
] |
816 | 2162 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2163 |
"Created: / 14.11.1996 / 15:51:41 / cg" |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2164 |
"Modified: / 8.8.1998 / 03:24:03 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2165 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2166 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2167 |
buttonMotion:buttonMask x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2168 |
"mouse-move while button was pressed - handle selection changes" |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2169 |
|
997 | 2170 |
(enabled not or:[dragIsActive]) ifTrue:[ |
987
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
2171 |
^ self |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
2172 |
]. |
611244bb2e1d
Disable must ignore buttonMotion events for multiSelections.
Stefan Vogel <sv@exept.de>
parents:
970
diff
changeset
|
2173 |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2174 |
"is it the select or 1-button ?" |
1620
47983c461af0
use another left-button-down test in #buttonMotion.
Claus Gittinger <cg@exept.de>
parents:
1600
diff
changeset
|
2175 |
self sensor leftButtonPressed ifFalse:[^ self]. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2176 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2177 |
clickLine isNil ifTrue:[^ self]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2178 |
|
1473 | 2179 |
(self canDrag and:[clickPosition notNil]) ifTrue:[ "mouse pressed but not released" |
997 | 2180 |
(clickPosition dist:(x@y)) > 5.0 ifTrue:[ |
1473 | 2181 |
^ self startDragAt:clickPosition |
997 | 2182 |
]. |
2183 |
^ self |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2184 |
]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2185 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2186 |
"if moved outside of view, start autoscroll" |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2187 |
(y < 0) ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2188 |
self compressMotionEvents:false. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2189 |
self startAutoScrollUp:y. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2190 |
^ self |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2191 |
]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2192 |
(y > height) ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2193 |
self compressMotionEvents:false. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2194 |
self startAutoScrollDown:(y - height). |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2195 |
^ self |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2196 |
]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2197 |
|
1473 | 2198 |
(self canDrag and:[x < -5]) ifTrue:[ "visible and left out of view" |
2199 |
^ self startDragAt:(0 @ y) |
|
997 | 2200 |
]. |
2201 |
||
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2202 |
"move inside - stop autoscroll if any" |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2203 |
self stopAutoScroll. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2204 |
|
2161 | 2205 |
(self sensor hasButtonMotionEventFor:self) ifFalse:[ |
2206 |
self expandSelectionToX:x y:y. |
|
2207 |
]. |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2208 |
|
1620
47983c461af0
use another left-button-down test in #buttonMotion.
Claus Gittinger <cg@exept.de>
parents:
1600
diff
changeset
|
2209 |
"Modified: / 29.1.1997 / 12:15:31 / stefan" |
2161 | 2210 |
"Modified: / 23.2.2000 / 12:03:35 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2211 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2212 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2213 |
buttonMultiPress:button x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2214 |
((button == 1) or:[button == #select]) ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2215 |
"/ doubleClickActionBlock isNil ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2216 |
"/ self buttonPress:button x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2217 |
"/ ]. |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2218 |
enabled ifFalse:[ |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2219 |
^ self |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2220 |
]. |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2221 |
self doubleClicked. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2222 |
] ifFalse:[ |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2223 |
super buttonMultiPress:button x:x y:y |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2224 |
] |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2225 |
|
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2226 |
"Modified: / 26.10.1997 / 18:50:58 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2227 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2228 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2229 |
buttonPress:button x:x y:y |
997 | 2230 |
|sensor lineNr| |
2231 |
||
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2232 |
((button == 1) or:[button == #select]) ifFalse:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2233 |
^ super buttonPress:button x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2234 |
]. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2235 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2236 |
selectionAtClickTime := nil. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2237 |
enabled ifFalse:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2238 |
^ self |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2239 |
]. |
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2240 |
|
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2241 |
dragIsActive := false. |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2242 |
clickPosition := nil. |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2243 |
|
997 | 2244 |
sensor := self sensor. |
1513 | 2245 |
sensor notNil ifTrue:[ |
2246 |
sensor ctrlDown ifTrue:[ |
|
2247 |
^ self buttonControlPress:button x:x y:y |
|
2248 |
]. |
|
2249 |
sensor shiftDown ifTrue:[ |
|
2250 |
^ self expandSelectionToX:x y:y |
|
2251 |
] |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2252 |
]. |
1181
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
2253 |
|
1473 | 2254 |
self canDrag ifTrue:[ |
1181
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
2255 |
"/ clicked into the selection ? |
ad5004cb2969
allow an optional converter for dropObjects
Claus Gittinger <cg@exept.de>
parents:
1163
diff
changeset
|
2256 |
|
2413 | 2257 |
lineNr := self lineAtY:y. "/ self visibleLineToListLine:(self visibleLineOfY:y). |
997 | 2258 |
|
2259 |
(self isInSelection:lineNr) ifTrue:[ |
|
2260 |
"wait for release button |
|
2261 |
" |
|
2262 |
clickPosition := x@y. |
|
2263 |
clickLine := lineNr. |
|
2264 |
^ self |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2265 |
] |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2266 |
]. |
997 | 2267 |
self selectOrToggleAtX:x y:y |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2268 |
|
1513 | 2269 |
"Modified: / 7.5.1998 / 02:02:20 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2270 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2271 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2272 |
buttonRelease:button x:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2273 |
"stop any autoscroll" |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2274 |
|
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2275 |
selectionAtClickTime := nil. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2276 |
self stopAutoScroll. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2277 |
|
997 | 2278 |
dragIsActive ifTrue:[ |
2279 |
dragIsActive := false |
|
2280 |
] ifFalse:[ |
|
2281 |
clickPosition notNil ifTrue:[ |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2282 |
enabled ifFalse:[ |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2283 |
^ self |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2284 |
]. |
997 | 2285 |
self selectOrToggleAtX:(clickPosition x) y:(clickPosition y). |
2286 |
] |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2287 |
]. |
997 | 2288 |
clickPosition := nil. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2289 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2290 |
"Modified: / 26.10.1997 / 18:51:14 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2291 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2292 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2293 |
buttonShiftPress:button x:x y:y |
997 | 2294 |
"expand selection |
2295 |
" |
|
2264
f5cd15f186f8
care for nil selectable-index in cursorUp/down
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
2296 |
self halt:'obsolete method called'. "/ never called |
997 | 2297 |
|
2298 |
self expandSelectionToX:x y:y |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2299 |
|
1252 | 2300 |
"Modified: 17.6.1997 / 18:03:24 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2301 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2302 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2303 |
doubleClicked |
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
2304 |
|actionArg| |
1457 | 2305 |
|
2306 |
clickLine := nil. |
|
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2307 |
selectionAtClickTime := nil. |
1457 | 2308 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2309 |
enabled ifFalse:[ |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2310 |
^ self |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2311 |
]. |
554 | 2312 |
selection isNil ifTrue:[ |
2313 |
"/ can only happen if claus modifies the selection within |
|
2314 |
"/ the selectAction .... |
|
2315 |
^ self |
|
2316 |
]. |
|
2317 |
||
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
2318 |
actionArg := self argForChangeMessage. |
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
2319 |
|
1010 | 2320 |
"/ |
2321 |
"/ the ST-80 way of notifying the model |
|
2322 |
"/ |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2323 |
(model notNil and:[doubleClickMsg notNil]) ifTrue:[ |
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
2324 |
self sendChangeMessage:doubleClickMsg with:actionArg. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2325 |
]. |
554 | 2326 |
|
1010 | 2327 |
"/ |
2328 |
"/ ST/X action blocks |
|
2329 |
"/ |
|
1744
f7d712e4b79e
support 0, 1 or 2-arg doubleClickActionBlock.
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
2330 |
doubleClickActionBlock notNil ifTrue:[ |
2503
05307dff92f1
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
2331 |
doubleClickActionBlock valueWithOptionalArgument:actionArg |
1744
f7d712e4b79e
support 0, 1 or 2-arg doubleClickActionBlock.
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
2332 |
]. |
1010 | 2333 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2334 |
"Modified: / 26.10.1997 / 18:51:39 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2335 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2336 |
|
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2337 |
key:key select:index x:x y:y shifted:shifted |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2338 |
"select an entry by a keyboard action. |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2339 |
This is treated like a doubleClick on that entry, |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2340 |
except if shift is down, and multiple selections are |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2341 |
allowed, this adds/removes the new item to the selection." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2342 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2343 |
|oldSelection| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2344 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2345 |
enabled ifFalse:[ |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2346 |
^ self |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2347 |
]. |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2348 |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2349 |
keyActionStyle notNil ifTrue:[ |
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2350 |
"/ this item selectable ? |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2351 |
(selectConditionBlock notNil |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2352 |
and:[(selectConditionBlock value:index) not]) ifTrue:[^ self]. |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2353 |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2354 |
keyActionStyle == #pass ifTrue:[ |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2355 |
^ super keyPress:key x:x y:y |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2356 |
]. |
2156
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2357 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2358 |
(self multipleSelectOk and:[shifted]) ifTrue:[ |
2156
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2359 |
oldSelection := selection copy. |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2360 |
(self isInSelection:index) ifTrue:[ |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2361 |
self removeFromSelection:index |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2362 |
] ifFalse:[ |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2363 |
self addToSelection:index |
2156
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2364 |
]. |
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2365 |
(selection ~= oldSelection) ifTrue:[ |
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2366 |
self selectionChangedFrom:oldSelection. |
77515ef62950
selectionChange notification, if expanded via shift-click,
Claus Gittinger <cg@exept.de>
parents:
2148
diff
changeset
|
2367 |
]. |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2368 |
] ifFalse:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2369 |
self multipleSelectOk ifTrue:[ |
2235
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
2370 |
self selection:(OrderedCollection with:index) |
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
2371 |
] ifFalse:[ |
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
2372 |
self selection:index. |
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
2373 |
]. |
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2374 |
keyActionStyle == #selectAndDoubleClick ifTrue:[ |
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
2375 |
self doubleClicked |
885
7a53a92aa4c2
oops - did changeNotification twice.
Claus Gittinger <cg@exept.de>
parents:
882
diff
changeset
|
2376 |
] |
7a53a92aa4c2
oops - did changeNotification twice.
Claus Gittinger <cg@exept.de>
parents:
882
diff
changeset
|
2377 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2378 |
]. |
885
7a53a92aa4c2
oops - did changeNotification twice.
Claus Gittinger <cg@exept.de>
parents:
882
diff
changeset
|
2379 |
|
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2380 |
"Modified: / 4.2.2000 / 14:51:25 / cg" |
125 | 2381 |
! |
2382 |
||
2383 |
keyPress:key x:x y:y |
|
2384 |
"handle keyboard input" |
|
2385 |
||
490 | 2386 |
<resource: #keyboard ( #CursorUp #CursorDown #BeginOfText #EndOfText |
1676
a85936a2064c
treat BeginOfLine key like BeginOfText;
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
2387 |
#BeginOfLine #EndOfLine |
490 | 2388 |
#Return ) > |
132 | 2389 |
|
210
f7d44c195776
search fixed for lines which start with a separator
Claus Gittinger <cg@exept.de>
parents:
191
diff
changeset
|
2390 |
|index |
f7d44c195776
search fixed for lines which start with a separator
Claus Gittinger <cg@exept.de>
parents:
191
diff
changeset
|
2391 |
searchIndex "{Class: SmallInteger}" |
f7d44c195776
search fixed for lines which start with a separator
Claus Gittinger <cg@exept.de>
parents:
191
diff
changeset
|
2392 |
startSearch "{Class: SmallInteger}" |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2393 |
backSearch searchPrefix item shifted |
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2394 |
mySize sensor s index0 stillSearching| |
125 | 2395 |
|
1361
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2396 |
enabled ifFalse:[ |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2397 |
^ self |
139f8063319c
added dummy #visualBlock: and #selectedVisualBlock:
Claus Gittinger <cg@exept.de>
parents:
1358
diff
changeset
|
2398 |
]. |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2399 |
sensor := self sensor. |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2400 |
shifted := sensor notNil and:[sensor shiftDown]. |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2401 |
|
125 | 2402 |
(key == #CursorUp) ifTrue:[ |
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2403 |
index0 := self firstInSelection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2404 |
index := self previousSelectableBefore:selection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2405 |
stillSearching := true. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2406 |
[stillSearching |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2407 |
and:[selectConditionBlock notNil |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2408 |
and:[(selectConditionBlock value:index) not]]] whileTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2409 |
index := self previousSelectableBefore:index. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2410 |
stillSearching := index0 notNil and:[index ~= index0] |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2411 |
]. |
2264
f5cd15f186f8
care for nil selectable-index in cursorUp/down
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
2412 |
(index0 notNil and:[index isNil or:[index > index0]]) ifTrue:[self beep]. "/ wrapped |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2413 |
self key:key select:index x:x y:y shifted:shifted. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2414 |
^ self |
125 | 2415 |
]. |
2416 |
(key == #CursorDown) ifTrue:[ |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2417 |
index0 := self lastInSelection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2418 |
index := self nextSelectableAfter:selection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2419 |
stillSearching := true. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2420 |
[stillSearching |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2421 |
and:[selectConditionBlock notNil |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2422 |
and:[(selectConditionBlock value:index) not]]] whileTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2423 |
index := self nextSelectableAfter:index. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2424 |
stillSearching := index0 notNil and:[index ~= index0] |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
2425 |
]. |
2264
f5cd15f186f8
care for nil selectable-index in cursorUp/down
Claus Gittinger <cg@exept.de>
parents:
2256
diff
changeset
|
2426 |
(index0 notNil and:[index isNil or:[index < index0]]) ifTrue:[self beep]. "/ wrapped |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2427 |
self key:key select:index x:x y:y shifted:shifted. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2428 |
^ self |
125 | 2429 |
]. |
2430 |
"/ |
|
1249 | 2431 |
"/ stupid: Home and End are caught in ScrollableView |
125 | 2432 |
"/ we normally do not get them ... |
2433 |
"/ (need to call handlesKey: from there ... |
|
2434 |
"/ ... and implement it here) |
|
2435 |
"/ |
|
1676
a85936a2064c
treat BeginOfLine key like BeginOfText;
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
2436 |
((key == #BeginOfText) or:[key == #BeginOfLine]) ifTrue:[ |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2437 |
self key:key select:1 x:x y:y shifted:shifted. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2438 |
^ self |
125 | 2439 |
]. |
1676
a85936a2064c
treat BeginOfLine key like BeginOfText;
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
2440 |
((key == #EndOfText) or:[key == #EndOfLine]) ifTrue:[ |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2441 |
index := self size. |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2442 |
self key:key select:index x:x y:y shifted:shifted. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2443 |
^ self |
125 | 2444 |
]. |
2445 |
key == #Return ifTrue:[ |
|
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2446 |
returnKeyActionStyle == #doubleClick ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2447 |
selection notNil ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2448 |
self doubleClicked |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2449 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2450 |
^ self |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2451 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2452 |
returnKeyActionStyle ~~ #pass ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2453 |
^ self |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2454 |
]. |
125 | 2455 |
]. |
2142
2015adfc6096
selectAll shortKey (shift-Cmd-A)
Claus Gittinger <cg@exept.de>
parents:
2141
diff
changeset
|
2456 |
(key == #SelectAll) ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2457 |
self multipleSelectOk ifTrue:[ |
2142
2015adfc6096
selectAll shortKey (shift-Cmd-A)
Claus Gittinger <cg@exept.de>
parents:
2141
diff
changeset
|
2458 |
self selectAll. |
2015adfc6096
selectAll shortKey (shift-Cmd-A)
Claus Gittinger <cg@exept.de>
parents:
2141
diff
changeset
|
2459 |
]. |
2015adfc6096
selectAll shortKey (shift-Cmd-A)
Claus Gittinger <cg@exept.de>
parents:
2141
diff
changeset
|
2460 |
^ self |
2015adfc6096
selectAll shortKey (shift-Cmd-A)
Claus Gittinger <cg@exept.de>
parents:
2141
diff
changeset
|
2461 |
]. |
125 | 2462 |
|
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2463 |
mySize := self size. |
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2464 |
|
125 | 2465 |
" |
2466 |
alphabetic keys: search for next entry |
|
2467 |
starting with keys character. If shift is pressed, search backward |
|
2468 |
" |
|
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2469 |
(mySize > 0 |
125 | 2470 |
and:[key isCharacter |
2471 |
and:[key isLetter]]) ifTrue:[ |
|
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2472 |
keyActionStyle isNil ifTrue:[^ self]. |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2473 |
"/ self multipleSelectOk ifTrue:[^ self]. |
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2474 |
|
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2475 |
keyActionStyle == #pass ifFalse:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2476 |
searchPrefix := key asLowercase asString. |
125 | 2477 |
|
2478 |
"/ ... isISearch... ifFalse:[ |
|
2479 |
"/ iSearchString := '' |
|
2480 |
"/ ] ifTrue:[ |
|
2481 |
"/ iSearchString := iSearchString , searchPrefix. |
|
2482 |
"/ searchPrefix := iSearchString |
|
2483 |
"/ ]. |
|
2484 |
||
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2485 |
backSearch := shifted. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2486 |
backSearch ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2487 |
selection notNil ifTrue:[ |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2488 |
startSearch := self firstInSelection - 1. |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2489 |
"/ selection size > 0 ifTrue:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2490 |
"/ startSearch := selection first - 1 |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2491 |
"/ ] ifFalse:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2492 |
"/ selection isCollection ifTrue:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2493 |
"/ startSearch := mySize |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2494 |
"/ ] ifFalse:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2495 |
"/ startSearch := selection - 1 |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2496 |
"/ ] |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2497 |
"/ ] |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2498 |
] ifFalse:[ |
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2499 |
startSearch := mySize |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2500 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2501 |
startSearch < 1 ifTrue:[ |
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2502 |
startSearch := mySize. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2503 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2504 |
] ifFalse:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2505 |
selection notNil ifTrue:[ |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2506 |
startSearch := self lastInSelection + 1. |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2507 |
"/ selection size > 0 ifTrue:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2508 |
"/ startSearch := selection last + 1 |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2509 |
"/ ] ifFalse:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2510 |
"/ selection isCollection ifTrue:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2511 |
"/ startSearch := 1 |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2512 |
"/ ] ifFalse:[ |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2513 |
"/ startSearch := selection + 1 |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2514 |
"/ ] |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2515 |
"/ ] |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2516 |
] ifFalse:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2517 |
startSearch := 1 |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2518 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2519 |
startSearch > self size ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2520 |
startSearch := 1. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2521 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2522 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2523 |
searchIndex := startSearch. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2524 |
[true] whileTrue:[ |
2187
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2525 |
s := self characterSearchItemStringAt:searchIndex. |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2526 |
s notNil ifTrue:[ |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
2527 |
(s withoutSeparators asLowercase startsWith:searchPrefix) ifTrue:[ |
1256
13ff2ef827e5
care for nil entries when searching via key-click
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
2528 |
searchIndex = selection ifTrue:[^ self]. |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2529 |
^ self key:key select:searchIndex x:x y:y shifted:false |
1256
13ff2ef827e5
care for nil entries when searching via key-click
Claus Gittinger <cg@exept.de>
parents:
1252
diff
changeset
|
2530 |
]. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2531 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2532 |
backSearch ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2533 |
searchIndex := searchIndex - 1. |
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2534 |
searchIndex < 1 ifTrue:[searchIndex := mySize] |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2535 |
] ifFalse:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2536 |
searchIndex := searchIndex + 1. |
1323
86b03205acc9
care for empty multi-selection in character-search
Claus Gittinger <cg@exept.de>
parents:
1310
diff
changeset
|
2537 |
searchIndex > mySize ifTrue:[searchIndex := 1]. |
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2538 |
]. |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2539 |
searchIndex == startSearch ifTrue:[ |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2540 |
^ self |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2541 |
] |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2542 |
] |
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2543 |
]. |
125 | 2544 |
]. |
2545 |
^ super keyPress:key x:x y:y |
|
326
f04c328526c4
use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents:
320
diff
changeset
|
2546 |
|
1676
a85936a2064c
treat BeginOfLine key like BeginOfText;
Claus Gittinger <cg@exept.de>
parents:
1640
diff
changeset
|
2547 |
"Modified: / 15.9.1998 / 18:22:31 / cg" |
125 | 2548 |
! |
2549 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2550 |
sizeChanged:how |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2551 |
"if there is a selection, make certain, its visible |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2552 |
after the sizechange" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2553 |
|
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2554 |
|first wasAtEnd selectionWasWisible oldFirst| |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2555 |
|
1973 | 2556 |
widthOfWidestLine := nil. |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2557 |
oldFirst := firstLineShown. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2558 |
wasAtEnd := (firstLineShown + nFullLinesShown) >= self size. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2559 |
|
1725
532f89cec6ae
only scroll on size-change, if selection was visible before
Claus Gittinger <cg@exept.de>
parents:
1697
diff
changeset
|
2560 |
selectionWasWisible := false. |
532f89cec6ae
only scroll on size-change, if selection was visible before
Claus Gittinger <cg@exept.de>
parents:
1697
diff
changeset
|
2561 |
selection notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2562 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2563 |
first := selection firstIfEmpty:nil |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2564 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2565 |
first := selection |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2566 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2567 |
first notNil ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2568 |
selectionWasWisible := (first between:firstLineShown and:(firstLineShown + nFullLinesShown)). |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2569 |
] |
1725
532f89cec6ae
only scroll on size-change, if selection was visible before
Claus Gittinger <cg@exept.de>
parents:
1697
diff
changeset
|
2570 |
]. |
532f89cec6ae
only scroll on size-change, if selection was visible before
Claus Gittinger <cg@exept.de>
parents:
1697
diff
changeset
|
2571 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2572 |
super sizeChanged:how. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2573 |
|
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2574 |
oldFirst ~~ firstLineShown ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2575 |
"/ super did scroll already |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2576 |
^ self |
2204
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2577 |
]. |
53a4c702b4df
multiSelect and shifted-alpha key
Claus Gittinger <cg@exept.de>
parents:
2194
diff
changeset
|
2578 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2579 |
shown ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2580 |
selection size > 0 ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2581 |
selectionWasWisible ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2582 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2583 |
first := selection firstIfEmpty:nil |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2584 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2585 |
first := selection |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2586 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2587 |
first notNil ifTrue:[self makeLineVisible:first] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2588 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2589 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2590 |
" |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2591 |
if we where at the end before, move to the end again. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2592 |
Still to be seen, if this is better in real life ... |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2593 |
" |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2594 |
wasAtEnd ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2595 |
"at end" |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2596 |
self scrollToBottom |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2597 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2598 |
] |
125 | 2599 |
] |
2600 |
||
1725
532f89cec6ae
only scroll on size-change, if selection was visible before
Claus Gittinger <cg@exept.de>
parents:
1697
diff
changeset
|
2601 |
"Modified: / 1.12.1998 / 23:27:27 / cg" |
155 | 2602 |
! ! |
2603 |
||
1918
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2604 |
!SelectionInListView methodsFor:'focus handling'! |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2605 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2606 |
wantsFocusWithPointerEnter |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2607 |
"return true, if I want the focus when |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2608 |
the mouse pointer enters" |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2609 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2610 |
|pref| |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2611 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2612 |
pref := UserPreferences current focusFollowsMouse. |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2613 |
(pref ~~ false |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2614 |
and:[(styleSheet at:#'selection.requestFocusOnPointerEnter' default:true) |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2615 |
]) ifTrue:[ |
2481
7b7985560ea7
take focus on pointer enter only if the list is not empty.
Claus Gittinger <cg@exept.de>
parents:
2446
diff
changeset
|
2616 |
list size > 0 ifTrue:[ |
7b7985560ea7
take focus on pointer enter only if the list is not empty.
Claus Gittinger <cg@exept.de>
parents:
2446
diff
changeset
|
2617 |
^ true |
7b7985560ea7
take focus on pointer enter only if the list is not empty.
Claus Gittinger <cg@exept.de>
parents:
2446
diff
changeset
|
2618 |
] |
1918
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2619 |
]. |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2620 |
|
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2621 |
^ false |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2622 |
! ! |
3ac07b97b4f7
use extra query: #wantsFocusWithPointerEnter;
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
2623 |
|
105 | 2624 |
!SelectionInListView methodsFor:'initialization'! |
2625 |
||
941 | 2626 |
fetchDeviceResources |
2627 |
"fetch device colors, to avoid reallocation at redraw time" |
|
2628 |
||
2629 |
super fetchDeviceResources. |
|
2630 |
||
1988 | 2631 |
hilightFgColor notNil ifTrue:[hilightFgColor := hilightFgColor onDevice:device]. |
2632 |
hilightBgColor notNil ifTrue:[hilightBgColor := hilightBgColor onDevice:device]. |
|
2633 |
halfIntensityFgColor notNil ifTrue:[halfIntensityFgColor := halfIntensityFgColor onDevice:device]. |
|
2634 |
hilightFrameColor notNil ifTrue:[hilightFrameColor := hilightFrameColor onDevice:device]. |
|
941 | 2635 |
|
2636 |
"Created: 14.1.1997 / 00:11:13 / cg" |
|
2637 |
! |
|
2638 |
||
105 | 2639 |
initCursor |
2640 |
"set the cursor - a hand" |
|
2641 |
||
2642 |
cursor := Cursor hand |
|
2643 |
! |
|
2644 |
||
2645 |
initStyle |
|
968 | 2646 |
"setup viewStyle specifics" |
2647 |
||
105 | 2648 |
super initStyle. |
2649 |
||
392
81343306d796
eliminated all DefaultFont classVars (are now classINSTvars)
Claus Gittinger <cg@exept.de>
parents:
384
diff
changeset
|
2650 |
"/ DefaultFont notNil ifTrue:[font := DefaultFont on:device]. |
105 | 2651 |
|
2652 |
bgColor := viewBackground. |
|
2653 |
hilightFrameColor := nil. |
|
2654 |
hilightLevel := 0. |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2655 |
hilightStyle := DefaultHilightStyle. |
105 | 2656 |
arrowLevel := 1. |
2657 |
smallArrow := false. |
|
2658 |
||
709 | 2659 |
device hasGrayscales ifTrue:[ |
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2660 |
" |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2661 |
must get rid of these hard codings |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2662 |
" |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2663 |
(hilightStyle == #next) ifTrue:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2664 |
hilightFgColor := fgColor. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2665 |
hilightBgColor := White. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2666 |
hilightFrameColor := fgColor |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2667 |
] ifFalse:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2668 |
(hilightStyle == #motif) ifTrue:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2669 |
fgColor := White. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2670 |
bgColor := Grey. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2671 |
viewBackground := bgColor. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2672 |
hilightFgColor := bgColor "fgColor" "White". |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2673 |
hilightBgColor := fgColor "bgColor lightened" "darkened". |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2674 |
] ifFalse:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2675 |
(hilightStyle == #openwin) ifTrue:[ |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2676 |
hilightFgColor := fgColor. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2677 |
hilightBgColor := Color grey. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2678 |
smallArrow := true. |
1634 | 2679 |
] ifFalse:[ |
2680 |
(hilightStyle == #win95) ifTrue:[ |
|
2681 |
smallArrow := true. |
|
2682 |
] |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2683 |
] |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2684 |
] |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2685 |
] |
105 | 2686 |
]. |
2687 |
||
2688 |
hilightFgColor isNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2689 |
hilightFgColor := bgColor. |
105 | 2690 |
]. |
2691 |
hilightBgColor isNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2692 |
hilightBgColor := fgColor. |
105 | 2693 |
]. |
2694 |
DefaultForegroundColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2695 |
fgColor := DefaultForegroundColor |
105 | 2696 |
]. |
2697 |
DefaultBackgroundColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2698 |
bgColor := viewBackground := DefaultBackgroundColor |
105 | 2699 |
]. |
2700 |
DefaultHilightForegroundColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2701 |
hilightFgColor := DefaultHilightForegroundColor |
105 | 2702 |
]. |
2703 |
DefaultHilightBackgroundColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2704 |
hilightBgColor := DefaultHilightBackgroundColor |
105 | 2705 |
]. |
2706 |
DefaultHilightFrameColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2707 |
hilightFrameColor := DefaultHilightFrameColor |
105 | 2708 |
]. |
2709 |
DefaultHilightLevel notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2710 |
hilightLevel := DefaultHilightLevel |
105 | 2711 |
]. |
2712 |
DefaultRightArrowLevel notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2713 |
arrowLevel := DefaultRightArrowLevel |
105 | 2714 |
]. |
2715 |
||
2716 |
DefaultShadowColor notNil ifTrue:[ |
|
941 | 2717 |
shadowColor := DefaultShadowColor |
105 | 2718 |
]. |
2719 |
DefaultLightColor notNil ifTrue:[ |
|
941 | 2720 |
lightColor := DefaultLightColor |
105 | 2721 |
]. |
2722 |
||
2723 |
(hilightLevel abs > 0) ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2724 |
lineSpacing := 3 |
105 | 2725 |
] ifFalse:[ |
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2726 |
lineSpacing := 2 |
105 | 2727 |
]. |
2728 |
||
2729 |
hilightFgColor isNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2730 |
hilightFgColor := bgColor. |
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2731 |
hilightBgColor := fgColor |
105 | 2732 |
]. |
2733 |
||
2734 |
DefaultDisabledForegroundColor notNil ifTrue:[ |
|
510
69259a0d7c07
better motif-style hilighting
Claus Gittinger <cg@exept.de>
parents:
490
diff
changeset
|
2735 |
halfIntensityFgColor := DefaultDisabledForegroundColor |
105 | 2736 |
] ifFalse:[ |
705 | 2737 |
halfIntensityFgColor := Color darkGray. |
105 | 2738 |
]. |
2739 |
||
1634 | 2740 |
"Modified: / 5.8.1998 / 00:00:00 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2741 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2742 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2743 |
initialize |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2744 |
super initialize. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2745 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2746 |
fontHeight := font height + lineSpacing. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2747 |
enabled := true. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2748 |
ignoreReselect := true. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2749 |
multipleSelectOk := toggleSelect := strikeOut := printItems := false. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2750 |
useIndex := true. |
997 | 2751 |
dragIsActive := allowDrag := false. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2752 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2753 |
keyActionStyle := #select. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2754 |
returnKeyActionStyle := #doubleClick. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2755 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2756 |
listMsg := self class defaultListMessage. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2757 |
initialSelectionMsg := self class defaultSelectionMessage. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2758 |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2759 |
"Modified: 14.11.1996 / 15:12:33 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2760 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2761 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2762 |
realize |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2763 |
super realize. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2764 |
|
1068 | 2765 |
model notNil ifTrue:[ |
2766 |
self getSelectionFromModel. |
|
2767 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2768 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2769 |
selection notNil ifTrue:[ |
1068 | 2770 |
selection isCollection ifTrue:[ |
2771 |
selection notEmpty ifTrue:[ |
|
2772 |
self makeLineVisible:selection first |
|
2773 |
] |
|
2774 |
] ifFalse:[ |
|
2775 |
self makeLineVisible:selection |
|
2776 |
] |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2777 |
]. |
1068 | 2778 |
|
2779 |
"Modified: 27.2.1997 / 14:23:40 / cg" |
|
0 | 2780 |
! ! |
2781 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2782 |
!SelectionInListView methodsFor:'private'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2783 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2784 |
argForChangeMessage |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2785 |
"return the argument for a selectionChange; |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2786 |
depending on the setting of useIndex, this is either the numeric |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2787 |
index of the selection or the value (i.e. the string)" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2788 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2789 |
useIndex ~~ false ifTrue:[ "/ i.e. everything except false |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2790 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2791 |
selection isNil ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2792 |
^ #() |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2793 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2794 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2795 |
^ selection |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2796 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2797 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2798 |
printItems ifFalse:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2799 |
^ self selectionValue |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2800 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2801 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2802 |
items notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2803 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2804 |
^ selection collect:[:nr | items at:nr] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2805 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2806 |
^ items at:selection |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2807 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2808 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2809 |
^ nil "/ cannot happen |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2810 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2811 |
"Modified: 26.10.1995 / 16:28:13 / cg" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2812 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2813 |
|
2187
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2814 |
characterSearchItemStringAt:lineNr |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2815 |
"for first-character search: |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2816 |
return a lines item-string. |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2817 |
For multi-col items, this may be different from the actual string" |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2818 |
|
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2819 |
|item s| |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2820 |
|
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2821 |
item := self at:lineNr. |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2822 |
item isNil ifTrue:[^ nil]. |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2823 |
(Object errorSignal catch:[ |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2824 |
s := item asString |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2825 |
]) ifTrue:[ |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2826 |
s := item displayString |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2827 |
]. |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2828 |
^ s |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2829 |
|
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2830 |
! |
b5bfc9d40650
allow for subclasses to redefine character search
Claus Gittinger <cg@exept.de>
parents:
2169
diff
changeset
|
2831 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2832 |
checkRemovingSelection:lineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2833 |
"when a line is removed, we have to adjust selection" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2834 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2835 |
|newSelection| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2836 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2837 |
selection notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2838 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2839 |
newSelection := OrderedCollection new. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2840 |
selection do:[:sel | |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2841 |
sel < lineNr ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2842 |
newSelection add:sel |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2843 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2844 |
sel > lineNr ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2845 |
newSelection add:(sel - 1) |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2846 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2847 |
"otherwise remove it from the selection" |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2848 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2849 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2850 |
newSelection size == 0 ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2851 |
selection := nil |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2852 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2853 |
selection := newSelection |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2854 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2855 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2856 |
selection == lineNr ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2857 |
selection := nil |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2858 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2859 |
selection > lineNr ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2860 |
selection := selection - 1 |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2861 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2862 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2863 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2864 |
] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2865 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2866 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2867 |
getListFromModel |
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2868 |
"if I have a model, get my list from it using the listMessage. |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2869 |
If listMessage is nil, try aspectMessage for backward compatibilty." |
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2870 |
|
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2871 |
|text msg| |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2872 |
|
1310 | 2873 |
listChannel notNil ifTrue:[ |
1345 | 2874 |
items := listChannel value copy |
1310 | 2875 |
] ifFalse:[ |
2876 |
(model isNil or:[(msg := listMsg) isNil and:[(msg := aspectMsg) isNil]]) ifTrue:[ |
|
2877 |
^ self |
|
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2878 |
]. |
1310 | 2879 |
items := model perform:msg. |
2880 |
]. |
|
2881 |
items notNil ifTrue:[ |
|
2882 |
printItems ifTrue:[ |
|
2883 |
text := items collect:[:element | element printString] |
|
2884 |
] ifFalse:[ |
|
2885 |
text := items |
|
587
19deffec383d
if there is no listMessage, try aspect to get models text
Claus Gittinger <cg@exept.de>
parents:
586
diff
changeset
|
2886 |
]. |
1310 | 2887 |
text notNil ifTrue:[ |
2888 |
text isSequenceable ifFalse:[ |
|
2889 |
text := text asOrderedCollection |
|
2890 |
] |
|
2891 |
] |
|
105 | 2892 |
]. |
1310 | 2893 |
self list:text keepSelection:true. "/ expandTabs:false |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2894 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2895 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2896 |
getSelectionFromModel |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2897 |
"if I have a model and an initialSelectionMsg, get my selection from it" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2898 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2899 |
|sel| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2900 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2901 |
model notNil ifTrue:[ |
1310 | 2902 |
listChannel notNil ifTrue:[ |
2903 |
sel := model value. |
|
1813
7f51dc0341a6
oops - did not unselect if model was changed to nil.
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
2904 |
sel isNil ifTrue:[ |
7f51dc0341a6
oops - did not unselect if model was changed to nil.
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
2905 |
self deselect. |
7f51dc0341a6
oops - did not unselect if model was changed to nil.
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
2906 |
^ self |
7f51dc0341a6
oops - did not unselect if model was changed to nil.
Claus Gittinger <cg@exept.de>
parents:
1796
diff
changeset
|
2907 |
] |
1310 | 2908 |
] ifFalse:[ |
2909 |
initialSelectionMsg isNil ifTrue:[^ self]. |
|
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
2910 |
sel := model perform:initialSelectionMsg. |
1310 | 2911 |
]. |
2912 |
(useIndex or:[sel isNumber]) ifTrue:[ |
|
2913 |
self setSelection:sel |
|
2914 |
] ifFalse:[ |
|
2915 |
self setSelectElement:sel. |
|
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
2916 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2917 |
]. |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
2918 |
|
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
2919 |
"Modified: 25.5.1996 / 16:34:54 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2920 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2921 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2922 |
isValidSelection:aNumberOrCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2923 |
"return true, if aNumber is ok as a selection index" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2924 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2925 |
|sz| |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2926 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2927 |
aNumberOrCollection isNil ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2928 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2929 |
sz := self size. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2930 |
(aNumberOrCollection isCollection) ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
2931 |
self multipleSelectOk ifFalse:[^ false]. |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2932 |
aNumberOrCollection do:[:index | |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2933 |
(index between:1 and:sz) ifFalse:[^ false]. |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2934 |
(self lineIsEnabled:index) ifFalse:[^ false]. |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2935 |
]. |
125 | 2936 |
] ifFalse:[ |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2937 |
(aNumberOrCollection between:1 and:sz) ifFalse:[^ false]. |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2938 |
(self lineIsEnabled:aNumberOrCollection) ifFalse:[^ false]. |
63 | 2939 |
]. |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2940 |
^ true. |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2941 |
|
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2942 |
"Modified: / 8.8.1998 / 03:34:27 / cg" |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2943 |
! |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2944 |
|
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2945 |
lineIsEnabled:lineNr |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2946 |
^ (self line:lineNr hasAttribute:#disabled) not |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2947 |
|
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
2948 |
"Modified: / 8.8.1998 / 03:22:50 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2949 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2950 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2951 |
positionToSelectionX:x y:y |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2952 |
"given a click position, return the selection lineNo" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2953 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2954 |
|visibleLine| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2955 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2956 |
(x between:0 and:width) ifTrue:[ |
2413 | 2957 |
(y between:0 and:height) ifTrue:[ |
2958 |
^ self lineAtY:y |
|
2959 |
"/ visibleLine := self visibleLineOfY:y. |
|
2960 |
"/ ^ self visibleLineToListLine:visibleLine |
|
2961 |
] |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2962 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2963 |
^ nil |
125 | 2964 |
! |
2965 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2966 |
scrollSelectDown |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2967 |
"auto scroll action; scroll and reinstall timed-block" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2968 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2969 |
self scrollDown. |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2970 |
self invalidate. |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2971 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2972 |
Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT. |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2973 |
|
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
2974 |
"Modified: / 3.2.2000 / 22:41:59 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2975 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2976 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2977 |
scrollSelectUp |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2978 |
"auto scroll action; scroll and reinstall timed-block" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2979 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2980 |
self scrollUp. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2981 |
Processor addTimedBlock:autoScrollBlock afterSeconds:autoScrollDeltaT. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2982 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
2983 |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2984 |
selectOrToggleAtX:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2985 |
|oldSelection listLineNr| |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2986 |
|
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2987 |
selectMode := nil. |
2413 | 2988 |
listLineNr := self lineAtY:y. "/ self visibleLineToListLine:(self visibleLineOfY:y). |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2989 |
listLineNr notNil ifTrue:[ |
2141
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2990 |
"/ this item selectable ? |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2991 |
(selectConditionBlock notNil |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2992 |
and:[(selectConditionBlock value:listLineNr) not]) ifTrue:[^ self]. |
a9f9956168b8
undid the last change - a single block is ok
Claus Gittinger <cg@exept.de>
parents:
2140
diff
changeset
|
2993 |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2994 |
(toggleSelect |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2995 |
and:[self isInSelection:listLineNr]) ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2996 |
oldSelection := selection copy. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2997 |
self removeFromSelection:listLineNr. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
2998 |
selectMode := false. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
2999 |
] ifFalse:[ |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3000 |
(self lineIsEnabled:listLineNr) ifFalse:[^ self]. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3001 |
|
2138
a634610a37de
added a selectionChangeConditionBlock,
Claus Gittinger <cg@exept.de>
parents:
2136
diff
changeset
|
3002 |
oldSelection := selection copy. |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3003 |
(toggleSelect and:[self multipleSelectOk]) ifTrue:[ |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3004 |
self addToSelection:listLineNr |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3005 |
] ifFalse:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3006 |
self selectWithoutScroll:listLineNr. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3007 |
]. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3008 |
selectMode := true. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3009 |
]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3010 |
((ignoreReselect not and:[selection notNil]) |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3011 |
or:[selection ~= oldSelection]) ifTrue:[ |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3012 |
self selectionChangedFrom:oldSelection. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3013 |
]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3014 |
clickLine := listLineNr |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3015 |
] |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3016 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3017 |
"Created: / 14.11.1996 / 16:27:17 / cg" |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3018 |
"Modified: / 8.8.1998 / 03:22:26 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3019 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3020 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3021 |
visibleLineNeedsSpecialCare:visLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3022 |
|listLine| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3023 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3024 |
listLine := self visibleLineToListLine:visLineNr. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3025 |
listLine isNil ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3026 |
(self isInSelection:listLine) ifTrue:[^ true]. |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3027 |
visualBlock notNil ifTrue:[^true]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3028 |
listAttributes notNil ifTrue:[ |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3029 |
(listLine <= listAttributes size) ifTrue:[ |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3030 |
^ (listAttributes at:listLine) notNil |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3031 |
] |
0 | 3032 |
]. |
125 | 3033 |
^ false |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3034 |
|
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3035 |
"Modified: / 21.6.1998 / 02:43:02 / cg" |
125 | 3036 |
! |
3037 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3038 |
widthForScrollBetween:start and:end |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3039 |
"has to be redefined since WHOLE line is inverted/modified sometimes" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3040 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3041 |
| anySelectionInRange | |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3042 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3043 |
selection notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3044 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3045 |
anySelectionInRange := false. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3046 |
selection do:[:s | |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3047 |
(s between:start and:end) ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3048 |
anySelectionInRange := true |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3049 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3050 |
] |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3051 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3052 |
anySelectionInRange := selection between:start and:end |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3053 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3054 |
] ifFalse:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3055 |
anySelectionInRange := false |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3056 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3057 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3058 |
anySelectionInRange ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3059 |
^ width |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3060 |
" |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3061 |
self is3D ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3062 |
^ width |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3063 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3064 |
( #(next openwin) includes:styleSheet name) ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3065 |
^ width |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3066 |
]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3067 |
viewBackground = background ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3068 |
^ width |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3069 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3070 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3071 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3072 |
^ super widthForScrollBetween:start and:end |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3073 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3074 |
|
2563
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3075 |
!SelectionInListView methodsFor:'private - drag and drop'! |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3076 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3077 |
collectionOfDragObjects |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3078 |
"returns collection of dragable objects assigned to selection |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3079 |
Here, by default, a collection of text-dragObjects is generated; |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3080 |
however, if a dragObjectConverter is defined, that one gets a chance |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3081 |
to convert as appropriate." |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3082 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3083 |
|collection converted| |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3084 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3085 |
collection := OrderedCollection new. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3086 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3087 |
self selectionDo:[:aNumber| |text| |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3088 |
text := self at:aNumber. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3089 |
collection add:(DropObject newText:text) |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3090 |
]. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3091 |
dragObjectConverter notNil ifTrue:[ |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3092 |
converted := OrderedCollection new. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3093 |
collection do:[:o | |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3094 |
|convertedObject| |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3095 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3096 |
convertedObject := dragObjectConverter value:o. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3097 |
convertedObject notNil ifTrue:[ |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3098 |
converted add:convertedObject |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3099 |
] |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3100 |
]. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3101 |
collection := converted |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3102 |
]. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3103 |
^ collection. |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3104 |
|
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3105 |
"Modified: 6.4.1997 / 14:14:30 / cg" |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3106 |
! ! |
ffb88664908a
Drag&Drop - remove unused stuff
Stefan Vogel <sv@exept.de>
parents:
2537
diff
changeset
|
3107 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3108 |
!SelectionInListView methodsFor:'queries'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3109 |
|
2597
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3110 |
isCursorKeyConsumer |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3111 |
"return true, if the receiver can be controlled by cursor keys; |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3112 |
i.e. it can handle some keyboard input, |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3113 |
isCursorKeyConsumer are potential candidates for getting the keyboard |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3114 |
focus initially within dialogBoxes, or when the focus-follows-pointer |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3115 |
mode is off. |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3116 |
Return false here, this is redefined in SelectionInListView." |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3117 |
|
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3118 |
^ true |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3119 |
! |
feebf7ba0771
added #isCursorKeyConsumer (second chance initial focus in dialog)
Claus Gittinger <cg@exept.de>
parents:
2563
diff
changeset
|
3120 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3121 |
specClass |
1379 | 3122 |
"redefined, since the name of my specClass is nonStandard (i.e. not SelectionInListSpec)" |
3123 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3124 |
self class == SelectionInListView ifTrue:[^ SequenceViewSpec]. |
1045 | 3125 |
^ super specClass |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3126 |
|
1379 | 3127 |
"Modified: / 5.9.1995 / 23:05:53 / claus" |
3128 |
"Modified: / 31.10.1997 / 19:48:44 / cg" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3129 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3130 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3131 |
!SelectionInListView methodsFor:'redrawing'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3132 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3133 |
redrawElement:aNumber |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3134 |
"redraw an individual element" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3135 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3136 |
^ self redrawLine:aNumber |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3137 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3138 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3139 |
redrawFromVisibleLine:startVisLineNr to:endVisLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3140 |
"redraw a range of lines. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3141 |
Must check, if any is in the selection and handle this case. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3142 |
Otherwise draw it en-bloque using supers method." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3143 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3144 |
|special sel |
393 | 3145 |
l1 "{ Class: SmallInteger }" |
3146 |
l2 "{ Class: SmallInteger }" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3147 |
selNo "{ Class: SmallInteger }" | |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3148 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3149 |
((selection isCollection) |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3150 |
or:[listAttributes notNil |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3151 |
or:[visualBlock notNil |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3152 |
or:[selectedVisualBlock notNil]]]) ifTrue:[ |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3153 |
"/ cannot do bulk-redraw ... |
393 | 3154 |
l1 := startVisLineNr. |
3155 |
l2 := endVisLineNr. |
|
3156 |
l1 to:l2 do:[:visLine | |
|
3157 |
self redrawVisibleLine:visLine |
|
3158 |
]. |
|
3159 |
^ self |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3160 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3161 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3162 |
"XXX only if -1/+1" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3163 |
"/ hilightLevel ~~ 0 ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3164 |
"/ self paint:bgColor. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3165 |
"/ self fillRectangleX:0 y:(self yOfVisibleLine:startVisLineNr)-1 width:width height:1 |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3166 |
"/ ]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3167 |
special := true. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3168 |
selection isNil ifTrue:[ |
393 | 3169 |
special := false |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3170 |
] ifFalse:[ |
393 | 3171 |
sel := self listLineToVisibleLine:selection. |
3172 |
sel isNil ifTrue:[ |
|
3173 |
special := false |
|
3174 |
] ifFalse:[ |
|
3175 |
special := (sel between:startVisLineNr and:endVisLineNr) |
|
3176 |
] |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3177 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3178 |
special ifFalse:[ |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3179 |
^ super redrawFromVisibleLine:startVisLineNr to:endVisLineNr |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3180 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3181 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3182 |
selNo := sel. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3183 |
selNo > startVisLineNr ifTrue:[ |
393 | 3184 |
super redrawFromVisibleLine:startVisLineNr to:(selNo - 1) |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3185 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3186 |
self redrawVisibleLine:selNo. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3187 |
selNo < endVisLineNr ifTrue:[ |
393 | 3188 |
super redrawFromVisibleLine:(selNo + 1) to:endVisLineNr |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3189 |
] |
393 | 3190 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3191 |
"Modified: / 21.6.1998 / 02:42:17 / cg" |
125 | 3192 |
! |
3193 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3194 |
redrawVisibleLine:visLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3195 |
"redraw a single line. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3196 |
Must check, if any is in the selection and handle this case. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3197 |
Otherwise draw using supers method." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3198 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3199 |
|listLine fg bg newFont oldFont id dObj y| |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3200 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3201 |
fg := fgColor. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3202 |
bg := bgColor. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3203 |
listLine := self visibleLineToListLine:visLineNr. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3204 |
listLine notNil ifTrue:[ |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3205 |
(self isInSelection:listLine) ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3206 |
^ self drawVisibleLineSelected:visLineNr |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3207 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3208 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3209 |
visualBlock notNil ifTrue:[ |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3210 |
y := self yOfVisibleLine:visLineNr. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3211 |
|
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3212 |
backgroundAlreadyClearedColor == bg ifFalse:[ |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3213 |
self paint:bg. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3214 |
self fillRectangleX:margin y:y - (lineSpacing//2) |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3215 |
width:(width - (2 * margin)) |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3216 |
height:fontHeight. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3217 |
]. |
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3218 |
|
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3219 |
dObj := visualBlock value:self value:listLine. |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3220 |
self paint:fg on:bg. |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3221 |
dObj displayOn:self x:textStartLeft y:y + font ascent opaque:true. |
1600
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3222 |
^ self |
bc8ba748da8a
handle visualBlock / selectedVisualBlock (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
1513
diff
changeset
|
3223 |
]. |
2290
1c602645fc3a
visualBlock / selectedVisualBlock drawing fixed
Claus Gittinger <cg@exept.de>
parents:
2264
diff
changeset
|
3224 |
|
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3225 |
listAttributes notNil ifTrue:[ |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3226 |
((self line:listLine hasAttribute:#halfIntensity) |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3227 |
or:[ (self lineIsEnabled:listLine) not ]) ifTrue:[ |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3228 |
fg := halfIntensityFgColor |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3229 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3230 |
(self line:listLine hasAttribute:#bold) ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3231 |
newFont := font asBold. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3232 |
(font bold |
1988 | 3233 |
or:[id := (newFont onDevice:device) fontId. |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3234 |
id isNil]) |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3235 |
ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3236 |
" |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3237 |
mhmh - what can be done, if the font is already bold ? |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3238 |
or no such font is available |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3239 |
" |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3240 |
fgColor brightness > 0.5 ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3241 |
fg := fgColor darkened "darkened". |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3242 |
] ifFalse:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3243 |
fg := fgColor lightened "lightened" |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3244 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3245 |
(fg brightness - bg brightness) abs < 0.25 ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3246 |
bgColor brightness > 0.5 ifTrue:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3247 |
fg := fg darkened. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3248 |
] ifFalse:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3249 |
fg := fg lightened |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3250 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3251 |
] |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3252 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3253 |
id notNil ifTrue:[ |
437
b7d544102a9e
oops - did not restore font (when boldifying)
Claus Gittinger <cg@exept.de>
parents:
429
diff
changeset
|
3254 |
oldFont := font. |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3255 |
self basicFont:newFont. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3256 |
self drawVisibleLine:visLineNr with:fg and:bg. |
437
b7d544102a9e
oops - did not restore font (when boldifying)
Claus Gittinger <cg@exept.de>
parents:
429
diff
changeset
|
3257 |
self basicFont:oldFont. |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3258 |
] ifFalse:[ |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3259 |
self drawVisibleLine:visLineNr with:fg and:bg. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3260 |
]. |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3261 |
^ self |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3262 |
] |
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3263 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3264 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3265 |
^ self drawVisibleLine:visLineNr with:fg and:bg |
384
0f2676690760
fixed boldify when replacementFonts are involved
Claus Gittinger <cg@exept.de>
parents:
364
diff
changeset
|
3266 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3267 |
"Modified: / 8.8.1998 / 03:42:13 / cg" |
125 | 3268 |
! |
3269 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3270 |
redrawVisibleLine:visLineNr col:colNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3271 |
"redraw a single character. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3272 |
Must check, if its in the selection and handle this case." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3273 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3274 |
(self visibleLineNeedsSpecialCare:visLineNr) ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3275 |
^ self redrawVisibleLine:visLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3276 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3277 |
super redrawVisibleLine:visLineNr col:colNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3278 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3279 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3280 |
redrawVisibleLine:visLineNr from:startCol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3281 |
"redraw from a col to the right end. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3282 |
Must check, if its in the selection and handle this case." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3283 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3284 |
(self visibleLineNeedsSpecialCare:visLineNr) ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3285 |
^ self redrawVisibleLine:visLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3286 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3287 |
super redrawVisibleLine:visLineNr from:startCol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3288 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3289 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3290 |
redrawVisibleLine:visLineNr from:startCol to:endCol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3291 |
"redraw from a startCol to endCol. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3292 |
Must check, if its in the selection and handle this case." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3293 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3294 |
(self visibleLineNeedsSpecialCare:visLineNr) ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3295 |
^ self redrawVisibleLine:visLineNr |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3296 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3297 |
super redrawVisibleLine:visLineNr from:startCol to:endCol |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3298 |
! ! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3299 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3300 |
!SelectionInListView methodsFor:'selections'! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3301 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3302 |
deselect |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3303 |
"deselect; Model or actionBlock notifications are made. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3304 |
To deselect without notifications, use #setSelection:nil." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3305 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3306 |
self selection:nil |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3307 |
|
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3308 |
"Modified: 25.5.1996 / 13:03:47 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3309 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3310 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3311 |
deselectWithoutRedraw |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3312 |
"deselect without redraw or notifications. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3313 |
No model or actionBlock notifications are made." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3314 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3315 |
selection := nil |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3316 |
|
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3317 |
"Modified: 25.5.1996 / 13:04:14 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3318 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3319 |
|
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3320 |
expandSelectionToX:x y:y |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3321 |
"used with button-motion and shift-press; |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3322 |
expand the selection to include all items from the clicked one, |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3323 |
up to the one under the mouse pointer" |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3324 |
|
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3325 |
|movedLine delta oldSelection any| |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3326 |
|
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3327 |
clickLine isNil ifTrue:[^ self]. |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3328 |
|
997 | 3329 |
movedLine := self visibleLineToAbsoluteLine:(self visibleLineOfY:y). |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3330 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3331 |
self multipleSelectOk ifTrue:[ |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3332 |
selectionAtClickTime isNil ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3333 |
selectionAtClickTime := selection copy. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3334 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3335 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3336 |
false "movedLine == clickLine" ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3337 |
any := false. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3338 |
|
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3339 |
oldSelection := selection copy. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3340 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3341 |
"/ undo any |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3342 |
1 to:(clickLine-1 min:movedLine) do:[:ln | |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3343 |
|isSelected wasSelected| |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3344 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3345 |
isSelected := self isInSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3346 |
wasSelected := self is:ln inSelection:selectionAtClickTime. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3347 |
isSelected ~~ wasSelected ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3348 |
wasSelected ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3349 |
self addToSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3350 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3351 |
] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3352 |
self removeFromSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3353 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3354 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3355 |
] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3356 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3357 |
(clickLine+1 max:movedLine) to:list size do:[:ln | |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3358 |
|isSelected wasSelected| |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3359 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3360 |
isSelected := self isInSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3361 |
wasSelected := self is:ln inSelection:selectionAtClickTime. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3362 |
isSelected ~~ wasSelected ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3363 |
wasSelected ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3364 |
self addToSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3365 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3366 |
] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3367 |
self removeFromSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3368 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3369 |
]. |
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
3370 |
] |
997 | 3371 |
]. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3372 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3373 |
delta := (clickLine < movedLine) ifTrue:[1] ifFalse:[-1]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3374 |
clickLine to:movedLine by:delta do:[:ln | |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3375 |
|isSelected doSelect doUnselect| |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3376 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3377 |
doSelect := doUnselect := false. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3378 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3379 |
isSelected := self isInSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3380 |
selectMode == true ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3381 |
doSelect := isSelected not |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3382 |
] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3383 |
selectMode == false ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3384 |
doUnselect := isSelected |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3385 |
] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3386 |
selectMode == #toggle ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3387 |
doUnselect := isSelected. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3388 |
doSelect := doUnselect not. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3389 |
] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3390 |
] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3391 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3392 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3393 |
doSelect ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3394 |
self addToSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3395 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3396 |
] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3397 |
doUnselect ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3398 |
self removeFromSelection:ln. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3399 |
any := true. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3400 |
] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3401 |
] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3402 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3403 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3404 |
"/ oldSel := selection copy. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3405 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3406 |
"/ (clickLine+delta) to:movedLine by:delta do:[:ln | |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3407 |
"/ (self isInSelection:ln) ifTrue:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3408 |
"/ self removeFromSelection:ln |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3409 |
"/ ] ifFalse:[ |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3410 |
"/ self addToSelection:ln |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3411 |
"/ ] |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3412 |
"/ ]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3413 |
any ifTrue:[ |
2334
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3414 |
selection ~= oldSelection ifTrue:[ |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3415 |
self selectionChangedFrom:oldSelection. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3416 |
] |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3417 |
]. |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3418 |
"/ any ifTrue:[ |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3419 |
"/ self selectionChangedFrom:oldSelection |
94cdb9b2d1f9
avoid bad list update due to automatically lost selection
Claus Gittinger <cg@exept.de>
parents:
2330
diff
changeset
|
3420 |
"/ ] |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3421 |
] |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3422 |
]. |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3423 |
"/ clickLine := movedLine. |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3424 |
|
2115
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
3425 |
"Created: / 14.11.1996 / 15:48:10 / cg" |
c994e244b8cf
with multipleSelectOK, also expand/shrink the seletction
Claus Gittinger <cg@exept.de>
parents:
2102
diff
changeset
|
3426 |
"Modified: / 3.2.2000 / 22:13:50 / cg" |
882
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3427 |
! |
38df470ab769
shift-button now expands a selection blockWise;
Claus Gittinger <cg@exept.de>
parents:
869
diff
changeset
|
3428 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3429 |
firstInSelection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3430 |
"return the index of the first selected line - nil if there is no selection" |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3431 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3432 |
|next sz| |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3433 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3434 |
selection isNil ifTrue:[^ nil]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3435 |
selection isCollection ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3436 |
selection size == 0 ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3437 |
^ nil |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3438 |
]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3439 |
^ selection min |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3440 |
]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3441 |
^ selection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3442 |
! |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3443 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3444 |
hasSelection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3445 |
"return true, if the view has a selection" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3446 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3447 |
self multipleSelectOk ifTrue:[ |
2407
bbf31d2267ea
fixed #hasSelection with multipleSelectOk
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
3448 |
^ selection size > 0 |
bbf31d2267ea
fixed #hasSelection with multipleSelectOk
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
3449 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3450 |
^ selection notNil |
125 | 3451 |
! |
3452 |
||
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3453 |
is:aNumber inSelection:aSelection |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3454 |
"return true, if line, aNumber is in the selection" |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3455 |
|
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3456 |
aSelection isNil ifTrue:[^ false]. |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3457 |
self multipleSelectOk ifTrue:[ |
2318
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3458 |
^ (aSelection includes:aNumber) |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3459 |
]. |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3460 |
^ (aNumber == aSelection) |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3461 |
! |
d4bea07df2cd
fixed multi-select extension (i.e. press-motion)
Claus Gittinger <cg@exept.de>
parents:
2314
diff
changeset
|
3462 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3463 |
isInSelection:aNumber |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3464 |
"return true, if line, aNumber is in the selection" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3465 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3466 |
selection isNil ifTrue:[^ false]. |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3467 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3468 |
^ (selection includes:aNumber) |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3469 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3470 |
^ (aNumber == selection) |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3471 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3472 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3473 |
lastInSelection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3474 |
"return the index of the last selected line - nil if there is no selection" |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3475 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3476 |
|next sz| |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3477 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3478 |
selection isNil ifTrue:[^ nil]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3479 |
selection isCollection ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3480 |
selection size == 0 ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3481 |
^ nil |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3482 |
]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3483 |
^ selection max |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3484 |
]. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3485 |
^ selection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3486 |
! |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3487 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3488 |
makeSelectionVisible |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3489 |
"scroll to make the selection line visible" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3490 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3491 |
|line| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3492 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3493 |
selection notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3494 |
self multipleSelectOk ifTrue:[ |
2148
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3495 |
selection isEmpty ifTrue:[^ self]. |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3496 |
"/ dont move, if any in the selection isVisible |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3497 |
selection do:[:aSelectedLine | |
2165
6c4bfa91517f
ensure fullyVisible in #makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
3498 |
(self lineIsFullyVisible:aSelectedLine) ifTrue:[ |
2148
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3499 |
^ self |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3500 |
] |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3501 |
]. |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3502 |
line := selection first. |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3503 |
] ifFalse:[ |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3504 |
line := selection |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3505 |
]. |
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3506 |
self makeLineVisible:line |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3507 |
] |
2148
a3077508aaa6
do not scroll in makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2142
diff
changeset
|
3508 |
|
2165
6c4bfa91517f
ensure fullyVisible in #makeSelectionVisible
Claus Gittinger <cg@exept.de>
parents:
2161
diff
changeset
|
3509 |
"Modified: / 24.2.2000 / 17:48:00 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3510 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3511 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3512 |
nextAfterSelection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3513 |
"return the index of the next selectable entry after the selection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3514 |
Wrap at end." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3515 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3516 |
^ self nextSelectableAfter:selection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3517 |
! |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3518 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3519 |
nextSelectableAfter:indexOrIndexCollection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3520 |
"return the index of the next selectable entry after the indexOrIndexCollection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3521 |
Wrap at end." |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3522 |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3523 |
|next sz| |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3524 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3525 |
indexOrIndexCollection isNil ifTrue:[ |
1244 | 3526 |
next := firstLineShown |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3527 |
] ifFalse:[ |
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3528 |
indexOrIndexCollection isCollection ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3529 |
indexOrIndexCollection size == 0 ifTrue:[ |
1244 | 3530 |
next := firstLineShown |
3531 |
] ifFalse:[ |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3532 |
next := indexOrIndexCollection max + 1 |
1244 | 3533 |
] |
3534 |
] ifFalse:[ |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3535 |
next := indexOrIndexCollection + 1 |
1244 | 3536 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3537 |
]. |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3538 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3539 |
(self isValidSelection:next) ifFalse:[ |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3540 |
sz := self size. |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3541 |
next > sz ifTrue:[ |
1244 | 3542 |
next := 1. |
3543 |
] ifFalse:[ |
|
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3544 |
[next <= sz |
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3545 |
and:[(self isValidSelection:next) not ]] whileTrue:[ |
1244 | 3546 |
next := next + 1 |
3547 |
]. |
|
3548 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3549 |
]. |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3550 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3551 |
(self isValidSelection:next) ifFalse:[ |
1244 | 3552 |
next := nil |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3553 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3554 |
^ next |
1640
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3555 |
|
1ddc9c17b4bf
skip over disabled lines, when moving selection via cursor keys.
Claus Gittinger <cg@exept.de>
parents:
1638
diff
changeset
|
3556 |
"Modified: / 8.8.1998 / 03:36:55 / cg" |
125 | 3557 |
! |
3558 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3559 |
numberOfSelections |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3560 |
"return the number of selected entries" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3561 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3562 |
|sz| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3563 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3564 |
selection isNil ifTrue:[^ 0]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3565 |
sz := selection size. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3566 |
sz > 0 ifTrue:[^ sz]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3567 |
^ 1 |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3568 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3569 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3570 |
previousBeforeSelection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3571 |
"return the index of the previous selectable entry before the selection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3572 |
Wrap at beginning." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3573 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3574 |
^ self previousSelectableBefore:selection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3575 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3576 |
! |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3577 |
|
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3578 |
previousSelectableBefore:indexOrIndexCollection |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3579 |
"return the index of the previous selectable entry before the indexOrIndexCollection. |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3580 |
Wrap at beginning." |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3581 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3582 |
|prev| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3583 |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3584 |
indexOrIndexCollection isNil ifTrue:[ |
1244 | 3585 |
prev := firstLineShown - 1 |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3586 |
] ifFalse:[ |
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3587 |
indexOrIndexCollection isCollection ifTrue:[ |
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3588 |
indexOrIndexCollection size == 0 ifTrue:[ |
1244 | 3589 |
prev := firstLineShown - 1 |
3590 |
] ifFalse:[ |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3591 |
prev := indexOrIndexCollection min - 1 |
1244 | 3592 |
] |
3593 |
] ifFalse:[ |
|
2194
d0487f4d4865
skip over disabled items, when changing the selection
Claus Gittinger <cg@exept.de>
parents:
2187
diff
changeset
|
3594 |
prev := indexOrIndexCollection - 1 |
1244 | 3595 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3596 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3597 |
(self isValidSelection:prev) ifFalse:[ |
1244 | 3598 |
prev < 1 ifTrue:[ |
3599 |
prev := self size. |
|
3600 |
] ifFalse:[ |
|
3601 |
[prev >= 1 |
|
3602 |
and:[(self isValidSelection:prev) not]] whileTrue:[ |
|
3603 |
prev := prev - 1 |
|
3604 |
]. |
|
3605 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3606 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3607 |
(self isValidSelection:prev) ifFalse:[ |
1244 | 3608 |
prev := nil |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3609 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3610 |
^ prev |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3611 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3612 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3613 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3614 |
selectAll |
886 | 3615 |
"select all entries. |
3616 |
Model and/or actionBlock notification IS done." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3617 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3618 |
|oldSelection| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3619 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3620 |
self multipleSelectOk ifTrue:[ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3621 |
oldSelection := selection. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3622 |
selection := OrderedCollection withAll:(1 to:self size). |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
3623 |
self invalidate. |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3624 |
self selectionChangedFrom:oldSelection. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3625 |
] |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3626 |
|
886 | 3627 |
"Modified: 15.11.1996 / 17:00:26 / cg" |
125 | 3628 |
! |
3629 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3630 |
selectElement:anObject |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3631 |
"select the element with same printString as the argument, anObject. |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3632 |
Scroll to make the new selection visible. |
886 | 3633 |
Model and/or actionBlock notification IS done." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3634 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3635 |
|lineNo| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3636 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3637 |
list notNil ifTrue:[ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3638 |
items notNil ifTrue:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3639 |
lineNo := items indexOf:anObject ifAbsent:nil |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3640 |
] ifFalse:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3641 |
lineNo := list indexOf:(anObject printString) ifAbsent:nil. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3642 |
]. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3643 |
lineNo notNil ifTrue:[self selection:lineNo] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3644 |
] |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3645 |
|
886 | 3646 |
"Modified: 15.11.1996 / 17:01:05 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3647 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3648 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3649 |
selectElementWithoutScroll:anObject |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3650 |
"select the element with same printString as the argument, anObject. |
886 | 3651 |
Do not scroll. |
3652 |
*** No model and/or actionBlock notification is done here." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3653 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3654 |
|lineNo| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3655 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3656 |
list notNil ifTrue:[ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3657 |
items notNil ifTrue:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3658 |
lineNo := items indexOf:anObject ifAbsent:nil |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3659 |
] ifFalse:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3660 |
lineNo := list indexOf:(anObject printString) ifAbsent:nil. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3661 |
]. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3662 |
lineNo notNil ifTrue:[self selectWithoutScroll:lineNo] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3663 |
] |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3664 |
|
886 | 3665 |
"Modified: 15.11.1996 / 17:01:17 / cg" |
125 | 3666 |
! |
3667 |
||
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3668 |
selectNext |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3669 |
"select next line or first visible if there is currrently no selection. |
886 | 3670 |
Wrap at end. |
3671 |
Model and/or actionBlock notification IS done." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3672 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3673 |
self selection:(self nextAfterSelection) |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3674 |
|
886 | 3675 |
"Modified: 15.11.1996 / 17:01:27 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3676 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3677 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3678 |
selectPrevious |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3679 |
"select previous line or previous visible if there is currently no selection. |
886 | 3680 |
Wrap at beginning. |
3681 |
Model and/or actionBlock notification IS done." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3682 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3683 |
self selection:(self previousBeforeSelection). |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3684 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3685 |
"Modified: 26.9.1995 / 09:41:16 / stefan" |
886 | 3686 |
"Modified: 15.11.1996 / 17:01:34 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3687 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3688 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3689 |
selectWithoutScroll:aNumberOrNilOrCollection |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3690 |
"select line, aNumber or deselect if argument is nil. |
886 | 3691 |
*** No model and/or actionBlock notification is done here." |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3692 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3693 |
|prevSelection newSelection multipleSelectOk| |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3694 |
|
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3695 |
multipleSelectOk := self multipleSelectOk. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3696 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3697 |
newSelection := aNumberOrNilOrCollection. |
2314
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3698 |
multipleSelectOk ifTrue:[ |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3699 |
(newSelection notNil |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3700 |
and:[newSelection isNumber not]) ifTrue:[ |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3701 |
newSelection := newSelection select:[:each | each notNil]. |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3702 |
newSelection size == 0 ifTrue:[newSelection := nil]. |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3703 |
]. |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3704 |
]. |
03348b8ae78b
empty-list with cursorUp/Down lead into debugger
Claus Gittinger <cg@exept.de>
parents:
2290
diff
changeset
|
3705 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3706 |
newSelection notNil ifTrue:[ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3707 |
(self isValidSelection:newSelection) ifFalse:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3708 |
newSelection := nil |
1484 | 3709 |
]. |
3710 |
newSelection == 0 ifTrue:[ |
|
3711 |
newSelection := nil |
|
3712 |
] ifFalse:[ |
|
3713 |
(newSelection isCollection |
|
3714 |
and:[newSelection size == 0]) ifTrue:[ |
|
3715 |
newSelection := nil |
|
3716 |
] |
|
3717 |
]. |
|
3718 |
||
3719 |
newSelection notNil ifTrue:[ |
|
3720 |
multipleSelectOk ifTrue:[ |
|
3721 |
newSelection isCollection ifFalse:[ |
|
3722 |
newSelection := OrderedCollection with:newSelection |
|
3723 |
] |
|
3724 |
] |
|
3725 |
]. |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3726 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3727 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3728 |
(newSelection = selection) ifTrue: [^ self]. |
125 | 3729 |
|
3730 |
" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3731 |
redraw old selection unhighlighted |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3732 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3733 |
selection notNil ifTrue: [ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3734 |
prevSelection := selection. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3735 |
selection := nil. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3736 |
multipleSelectOk ifTrue:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3737 |
prevSelection do:[:line | |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3738 |
self redrawElement:line |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3739 |
] |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3740 |
] ifFalse:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3741 |
self redrawElement:prevSelection |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3742 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3743 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3744 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3745 |
selection := newSelection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3746 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3747 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3748 |
redraw new selection unhighlighted |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3749 |
" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3750 |
newSelection notNil ifTrue:[ |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3751 |
multipleSelectOk ifTrue:[ |
1484 | 3752 |
"/ newSelection isCollection ifFalse:[ |
3753 |
"/ selection := OrderedCollection with:newSelection. |
|
3754 |
"/ ]. |
|
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3755 |
selection do:[:line | |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3756 |
self redrawElement:line |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3757 |
] |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3758 |
] ifFalse:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3759 |
self redrawElement:selection |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3760 |
] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3761 |
] |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3762 |
|
886 | 3763 |
"Modified: 15.11.1996 / 16:58:46 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3764 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3765 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3766 |
selection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3767 |
"return the selection index or collection of indices (if multipleSelect is on)" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3768 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3769 |
^ selection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3770 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3771 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3772 |
selection:aNumberOrNil |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3773 |
"select line, aNumber or deselect if argument is nil; |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3774 |
scroll to make the selected line visible. |
886 | 3775 |
The model and/or actionBlock IS notified." |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3776 |
|
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3777 |
|oldSelection| |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3778 |
|
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3779 |
oldSelection := selection. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3780 |
self setSelection:aNumberOrNil. |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3781 |
selection ~= oldSelection ifTrue:[ |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3782 |
self selectionChangedFrom:oldSelection |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3783 |
] |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3784 |
|
1638 | 3785 |
"Modified: / 7.8.1998 / 13:36:34 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3786 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3787 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3788 |
selectionAsCollection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3789 |
"return the selection as a collection of line numbers. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3790 |
This allows users of this class to enumerate independent of |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3791 |
the multipleSelect style." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3792 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3793 |
selection isNil ifTrue:[^ #()]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3794 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3795 |
"/ self multipleSelectOk ifTrue:[ |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3796 |
"/ ^ (OrderedCollection new) add:selection; yourself. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3797 |
"/ ]. |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3798 |
self multipleSelectOk ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3799 |
^ (OrderedCollection new) add:selection; yourself. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3800 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3801 |
^ selection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3802 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3803 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3804 |
selectionChangedFrom:oldSelection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3805 |
"selection has changed. Call actionblock and/or send changeMessage if defined" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3806 |
|
2503
05307dff92f1
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
3807 |
|changeArg actionArg| |
970 | 3808 |
|
3809 |
changeArg := actionArg := self argForChangeMessage. |
|
965
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3810 |
|
1010 | 3811 |
"/ |
3812 |
"/ the MVC way of doing things - notify model via changeMsg |
|
3813 |
"/ |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3814 |
self multipleSelectOk ifFalse:[ |
965
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3815 |
"/ ST80 sends 0 as index, if the same selection is reselected ... |
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3816 |
selection == oldSelection ifTrue:[ |
970 | 3817 |
changeArg := 0 |
965
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3818 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3819 |
]. |
2125
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3820 |
|
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3821 |
"/ must take care, if model is == to the selection-collection |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3822 |
"/ in this case, we must force a change on the model |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3823 |
"/ (valueHolder would not send a change in the == case) |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3824 |
"/ Q: should this be done in #sendChangeMessage ? |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3825 |
model isValueModel ifTrue:[ |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3826 |
model value == changeArg ifTrue:[ |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3827 |
model setValue:nil. |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3828 |
] |
f9000f830c2c
tuned multiselect (no new collection).
Claus Gittinger <cg@exept.de>
parents:
2124
diff
changeset
|
3829 |
]. |
970 | 3830 |
self sendChangeMessageWith:changeArg. |
965
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3831 |
|
1010 | 3832 |
"/ |
3833 |
"/ the ST/X way of doing things - perform the actionBlock |
|
3834 |
"/ |
|
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
3835 |
actionBlock notNil ifTrue:[ |
2503
05307dff92f1
use new #valueWithOptionalArg
Claus Gittinger <cg@exept.de>
parents:
2481
diff
changeset
|
3836 |
actionBlock valueWithOptionalArgument:actionArg |
1745
cca5376d130d
doubleClickAction also gets index or value depending upon
Claus Gittinger <cg@exept.de>
parents:
1744
diff
changeset
|
3837 |
]. |
965
ff8e6542eb13
when both model & actionBlocks are present,
Claus Gittinger <cg@exept.de>
parents:
941
diff
changeset
|
3838 |
|
1010 | 3839 |
"Modified: 14.2.1997 / 16:49:09 / cg" |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3840 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3841 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3842 |
selectionDo:aBlock |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3843 |
"perform aBlock for each nr in the selection. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3844 |
For single selection, it is called once for the items nr. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3845 |
For multiple selections, it is called for each." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3846 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3847 |
selection notNil ifTrue:[ |
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3848 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3849 |
selection do:aBlock |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3850 |
] ifFalse:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3851 |
aBlock value:selection |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3852 |
]. |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3853 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3854 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3855 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3856 |
selectionValue |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3857 |
"return the selection value i.e. the text in the selected line. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3858 |
For multiple selections a collection containing the entries is returned." |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3859 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3860 |
self multipleSelectOk ifTrue:[ |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3861 |
selection isNil ifTrue:[^ #()]. |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3862 |
^ selection collect:[:nr | self at:nr] |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3863 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3864 |
selection isNil ifTrue:[^ nil]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3865 |
^ self at:selection |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3866 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3867 |
|
988 | 3868 |
selectionValueAsCollection |
3869 |
"return the selection values as a collection - allows selectionValues to |
|
3870 |
be enumerated independent of the multiSelect settings" |
|
3871 |
||
3872 |
selection isNil ifTrue:[^ #()]. |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3873 |
self multipleSelectOk ifTrue:[ |
988 | 3874 |
^ selection collect:[:nr | self at:nr] |
3875 |
]. |
|
3876 |
^ Array with:(self at:selection) |
|
3877 |
! |
|
3878 |
||
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3879 |
setSelectElement:anObject |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3880 |
"select the element with same printString as the argument, anObject. |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3881 |
Scroll to make the new selection visible. |
886 | 3882 |
*** No model and/or actionBlock notification is done here." |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3883 |
|
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3884 |
|size lineNo coll s| |
1358 | 3885 |
|
3886 |
list isNil ifTrue:[ |
|
3887 |
^ self |
|
3888 |
]. |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3889 |
self multipleSelectOk ifTrue:[ |
1358 | 3890 |
(size := anObject size) == 0 ifTrue:[ |
3891 |
^ self setSelection:nil |
|
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3892 |
]. |
1358 | 3893 |
coll := OrderedCollection new:size. |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3894 |
anObject do:[:o | |
1358 | 3895 |
items notNil ifTrue:[ |
2229
ece191c81264
use indexOf: instead of findFirst:
Claus Gittinger <cg@exept.de>
parents:
2227
diff
changeset
|
3896 |
lineNo := items indexOf:o |
1358 | 3897 |
] ifFalse:[ |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3898 |
lineNo := list findFirst:[:el | o string = el string] |
1358 | 3899 |
]. |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3900 |
lineNo ~~ 0 ifTrue:[ |
1358 | 3901 |
coll add:lineNo |
3902 |
] |
|
3903 |
]. |
|
3904 |
^ self setSelection:coll |
|
3905 |
]. |
|
2124
b4123a418b82
oops - care for nil arg in setSelection
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
3906 |
anObject isNil ifTrue:[ |
b4123a418b82
oops - care for nil arg in setSelection
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
3907 |
^ self setSelection:nil |
b4123a418b82
oops - care for nil arg in setSelection
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
3908 |
]. |
b4123a418b82
oops - care for nil arg in setSelection
Claus Gittinger <cg@exept.de>
parents:
2122
diff
changeset
|
3909 |
|
1358 | 3910 |
items notNil ifTrue:[ |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3911 |
lineNo := items findFirst:[:el | anObject = el] |
1358 | 3912 |
] ifFalse:[ |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3913 |
s := anObject string. |
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3914 |
lineNo := list findFirst:[:el | s = el string] |
1358 | 3915 |
]. |
2122
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3916 |
lineNo ~~ 0 ifTrue:[ |
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3917 |
self setSelection:lineNo |
eaf474215daa
setSelect with emphasized items fixed
Claus Gittinger <cg@exept.de>
parents:
2115
diff
changeset
|
3918 |
] |
686
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3919 |
! |
03328d8ef2b6
more selection:/setSelection: stuff
Claus Gittinger <cg@exept.de>
parents:
681
diff
changeset
|
3920 |
|
2232
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
3921 |
setSelection:aNumberOrNilOrCollection |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3922 |
"select line, aNumber or deselect if argument is nil; |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3923 |
scroll to make the selected line visible. |
886 | 3924 |
*** No model and/or actionBlock notification is done here." |
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3925 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3926 |
|multipleSelectOk| |
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3927 |
|
2232
b65df4a6af2d
when the selection is lost (due to a changed list),
Claus Gittinger <cg@exept.de>
parents:
2229
diff
changeset
|
3928 |
self selectWithoutScroll:aNumberOrNilOrCollection. |
2235
b51a9d465386
selection should be a colletion if multiSelect is on (keyPress)
Claus Gittinger <cg@exept.de>
parents:
2234
diff
changeset
|
3929 |
|
2446
3771875cd836
multipleSelectOK as method (to allow redef)
Claus Gittinger <cg@exept.de>
parents:
2429
diff
changeset
|
3930 |
multipleSelectOk := self multipleSelectOk. |
2339 | 3931 |
((multipleSelectOk |
3932 |
and:[aNumberOrNilOrCollection isNumber or:[aNumberOrNilOrCollection size > 0]]) |
|
3933 |
or:[multipleSelectOk not |
|
3934 |
and:[aNumberOrNilOrCollection notNil]]) ifTrue:[ |
|
1638 | 3935 |
self makeSelectionVisible |
3936 |
] |
|
3937 |
||
3938 |
"Created: / 25.5.1996 / 12:23:18 / cg" |
|
3939 |
"Modified: / 7.8.1998 / 13:36:42 / cg" |
|
681
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3940 |
! |
9347a4f72cc9
#selection: now does a notification / #setSelection: does not
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
3941 |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3942 |
toggleSelection:aNumber |
886 | 3943 |
"toggle selection-state of entry, aNumber. |
3944 |
*** No model and/or actionBlock notification is done here." |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3945 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3946 |
(self isInSelection:aNumber) ifTrue:[ |
886 | 3947 |
self removeFromSelection:aNumber |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3948 |
] ifFalse:[ |
886 | 3949 |
self addToSelection:aNumber |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3950 |
] |
886 | 3951 |
|
3952 |
"Modified: 15.11.1996 / 17:02:08 / cg" |
|
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3953 |
! |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3954 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3955 |
valueIsInSelection:someString |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3956 |
"return true, if someString is in the selection" |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3957 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3958 |
|sel| |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3959 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3960 |
selection isNil ifTrue:[^ false]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3961 |
sel := self selectionValue. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3962 |
self numberOfSelections > 1 ifTrue:[ |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3963 |
^ (sel includes:someString) |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3964 |
]. |
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3965 |
^ (someString = sel) |
125 | 3966 |
! ! |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3967 |
|
869
4b09e6fe33b6
allow multiSelect modifier to be changed
Claus Gittinger <cg@exept.de>
parents:
838
diff
changeset
|
3968 |
!SelectionInListView class methodsFor:'documentation'! |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3969 |
|
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3970 |
version |
2633
96d7e5d626ae
redraw bug fix (highlightFrame leftover when deleting lines)
Claus Gittinger <cg@exept.de>
parents:
2597
diff
changeset
|
3971 |
^ '$Header: /cvs/stx/stx/libwidg/SelectionInListView.st,v 1.205 2002-10-11 13:09:56 cg Exp $' |
320
b2ca0310ead0
fixed error when resized empty and multiSelectOk
Claus Gittinger <cg@exept.de>
parents:
271
diff
changeset
|
3972 |
! ! |