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