343
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
|
|
14 |
View subclass:#TabView
|
418
|
15 |
instanceVariableNames:'list listHolder selection enabled action tabStyle useIndex
|
|
16 |
maxRawNr direction fitLastRow moveSelectedRow enableChannel
|
|
17 |
oldExtent'
|
343
|
18 |
classVariableNames:''
|
|
19 |
poolDictionaries:''
|
|
20 |
category:'Views-Interactors'
|
|
21 |
!
|
|
22 |
|
|
23 |
!TabView class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 1997 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
|
|
38 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
|
42 |
implements the tabs-view component of a noteBook.
|
|
43 |
May also be used on its own (without a surrounding noteBook).
|
|
44 |
|
|
45 |
The functionality is basically the same as provided by a
|
|
46 |
PopUpList or SelectionInListView, in that a valueHolder
|
|
47 |
gets a value assigned corresponding to the selected tab
|
|
48 |
from a list of possible tabs.
|
|
49 |
|
|
50 |
[author:]
|
|
51 |
Claus Atzkern
|
|
52 |
|
|
53 |
[see also:]
|
|
54 |
NoteBookView
|
369
|
55 |
SelectionInListView PopUpList ValueHolder TabWidget
|
343
|
56 |
"
|
|
57 |
|
|
58 |
!
|
|
59 |
|
|
60 |
examples
|
|
61 |
"
|
367
|
62 |
tabs at top of a view
|
343
|
63 |
[exBegin]
|
367
|
64 |
|top tab view inset|
|
|
65 |
|
|
66 |
top := StandardSystemView new label:'tabs at top'; extent:250@100.
|
499
|
67 |
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 0.0 in:top.
|
|
68 |
view := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
367
|
69 |
|
|
70 |
view viewBackground:(tab styleAt:#selectedColor).
|
|
71 |
tab direction:#top.
|
|
72 |
tab list:#( 'Foo' 'Bar' 'Baz' ).
|
|
73 |
inset := tab preferredSizeXorY.
|
|
74 |
tab bottomInset:(inset negated).
|
|
75 |
view topInset:inset.
|
|
76 |
tab action:[:aName|Transcript showCR:aName].
|
|
77 |
top open.
|
|
78 |
[exEnd]
|
343
|
79 |
|
367
|
80 |
tabs at bottom of a view; changing widget to MAC style
|
|
81 |
[exBegin]
|
|
82 |
|top tab view inset|
|
|
83 |
|
|
84 |
top := StandardSystemView new label:'tabs at bottom'; extent:250@100.
|
499
|
85 |
view := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
|
86 |
tab := TabView origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:top.
|
343
|
87 |
|
367
|
88 |
view viewBackground:(tab styleAt:#selectedColor).
|
|
89 |
tab direction:#bottom.
|
|
90 |
tab tabWidget:#Mac.
|
343
|
91 |
|
367
|
92 |
tab list:#( 'Foo' 'Bar' 'Baz' ).
|
|
93 |
inset := tab preferredSizeXorY.
|
|
94 |
tab topInset:(inset negated).
|
|
95 |
view bottomInset:inset.
|
|
96 |
tab action:[:aName|Transcript showCR:aName].
|
|
97 |
top open.
|
|
98 |
[exEnd]
|
343
|
99 |
|
367
|
100 |
tabs at right of a view
|
|
101 |
[exBegin]
|
|
102 |
|top tab view inset|
|
|
103 |
|
|
104 |
top := StandardSystemView new label:'tabs at right'; extent:100@250.
|
499
|
105 |
view := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
|
106 |
tab := TabView origin:1.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
367
|
107 |
|
|
108 |
view viewBackground:(tab styleAt:#selectedColor).
|
|
109 |
tab direction:#right.
|
|
110 |
tab list:#( 'Foo' 'Bar' 'Baz' ).
|
|
111 |
inset := tab preferredSizeXorY.
|
|
112 |
tab leftInset:(inset negated).
|
|
113 |
view rightInset:inset.
|
|
114 |
tab action:[:aName|Transcript showCR:aName].
|
343
|
115 |
top open.
|
367
|
116 |
[exEnd]
|
343
|
117 |
|
367
|
118 |
tabs at left of a view
|
343
|
119 |
[exBegin]
|
367
|
120 |
|top tab view inset|
|
|
121 |
|
|
122 |
top := StandardSystemView new label:'tabs at left'; extent:100@250.
|
499
|
123 |
tab := TabView origin:0.0 @ 0.0 corner:0.0 @ 1.0 in:top.
|
|
124 |
view := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
343
|
125 |
|
367
|
126 |
view viewBackground:(tab styleAt:#selectedColor).
|
|
127 |
tab direction:#left.
|
|
128 |
tab list:#( 'Foo' 'Bar' 'Baz' ).
|
|
129 |
inset := tab preferredSizeXorY.
|
|
130 |
tab rightInset:(inset negated).
|
|
131 |
view leftInset:inset.
|
|
132 |
tab action:[:aName|Transcript showCR:aName].
|
|
133 |
top open.
|
|
134 |
[exEnd]
|
343
|
135 |
|
367
|
136 |
changing default style( see TabWidget class ); useing index
|
|
137 |
[exBegin]
|
|
138 |
|top tab view|
|
|
139 |
|
|
140 |
top := StandardSystemView new label:'example'; extent:450@300.
|
499
|
141 |
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 40 in:top.
|
367
|
142 |
tab horizontalInset:10.
|
|
143 |
view := NoteBookFrameView origin:0.0 @ 40 corner:1.0 @ 1.0 in:top.
|
343
|
144 |
view horizontalInset:10.
|
|
145 |
view bottomInset:10.
|
|
146 |
view level:2.
|
|
147 |
view viewBackground:(Image fromFile:'bitmaps/gifImages/garfield.gif').
|
|
148 |
|
367
|
149 |
tab styleAt:#selectedColor put:(view viewBackground).
|
|
150 |
tab styleAt:#unselectedColor put:(Color grey:60).
|
|
151 |
tab styleAt:#expandSelection put:9@7.
|
343
|
152 |
|
367
|
153 |
tab list:#( 'Foo' 'Bar' 'Baz').
|
|
154 |
tab useIndex:true.
|
|
155 |
tab action:[:aName| Transcript showCR:aName ].
|
352
|
156 |
|
343
|
157 |
top open.
|
367
|
158 |
[exEnd]
|
343
|
159 |
|
|
160 |
|
367
|
161 |
using images and text
|
|
162 |
[exBegin]
|
|
163 |
|top tab view list|
|
|
164 |
|
|
165 |
top := StandardSystemView new label:'example'.
|
499
|
166 |
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
367
|
167 |
list := #( 'SBrowser' 'FBrowser' 'Debugger' ).
|
|
168 |
list := list collect:[:n | Image fromFile:'bitmaps/' , n , '.xbm'].
|
|
169 |
list add:'A Text'.
|
|
170 |
tab list:list.
|
|
171 |
tab action:[:indexOrNil| Transcript showCR:indexOrNil ].
|
|
172 |
top extent:(tab preferredExtent).
|
|
173 |
top open.
|
|
174 |
[exEnd]
|
343
|
175 |
|
367
|
176 |
using images and text; MAC style
|
|
177 |
[exBegin]
|
|
178 |
|top tab view list|
|
|
179 |
|
|
180 |
top := StandardSystemView new label:'example'.
|
499
|
181 |
tab := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
367
|
182 |
tab tabWidget:#Mac.
|
|
183 |
list := #( 'SBrowser' 'FBrowser' 'Debugger' ).
|
|
184 |
list := list collect:[:n | Image fromFile:'bitmaps/' , n , '.xbm'].
|
|
185 |
list add:'A Text'.
|
|
186 |
tab list:list.
|
|
187 |
tab action:[:indexOrNil| Transcript showCR:indexOrNil ].
|
|
188 |
top extent:(tab preferredExtent).
|
343
|
189 |
top open.
|
367
|
190 |
[exEnd]
|
343
|
191 |
|
367
|
192 |
tabs at top of view dealing with other models
|
|
193 |
|
|
194 |
[exBegin]
|
352
|
195 |
|top sel view l top2 s top3 p|
|
343
|
196 |
|
|
197 |
l := SelectionInList new.
|
|
198 |
l list:#('foo' 'bar' 'baz').
|
|
199 |
l selectionIndex:1.
|
|
200 |
|
|
201 |
top2 := StandardSystemView new.
|
367
|
202 |
top2 extent:100@100.
|
343
|
203 |
s := SelectionInListView origin:0.0@0.0 corner:1.0@1.0 in:top2.
|
|
204 |
s model:l.
|
|
205 |
top2 open.
|
|
206 |
|
|
207 |
top3 := StandardSystemView new.
|
367
|
208 |
top3 extent:100@100.
|
343
|
209 |
s := PopUpList in:top3.
|
|
210 |
s model:l.
|
|
211 |
top3 open.
|
|
212 |
|
499
|
213 |
top := StandardSystemView new label:'example'; extent:200@50.
|
|
214 |
sel := TabView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:top.
|
367
|
215 |
sel useIndex:true.
|
343
|
216 |
sel model:(l selectionIndexHolder).
|
|
217 |
sel listHolder:(l listHolder).
|
367
|
218 |
sel action:[:indexOrNil|Transcript showCR:indexOrNil].
|
343
|
219 |
top open.
|
|
220 |
[exEnd]
|
|
221 |
"
|
|
222 |
! !
|
|
223 |
|
|
224 |
!TabView class methodsFor:'defaults'!
|
|
225 |
|
|
226 |
defaultTabWidget
|
367
|
227 |
^ #Window
|
343
|
228 |
! !
|
|
229 |
|
|
230 |
!TabView methodsFor:'accessing'!
|
|
231 |
|
|
232 |
action:oneArgBlock
|
|
233 |
"set the action block to be performed on select; the argument to
|
|
234 |
the block is the selected index or nil in case of no selection.
|
|
235 |
"
|
|
236 |
action := oneArgBlock.
|
|
237 |
|
|
238 |
!
|
|
239 |
|
418
|
240 |
backgroundColor
|
|
241 |
^ viewBackground
|
|
242 |
!
|
|
243 |
|
343
|
244 |
list
|
|
245 |
"return the list
|
|
246 |
"
|
|
247 |
^ list
|
|
248 |
!
|
|
249 |
|
|
250 |
list:aList
|
|
251 |
"set the list
|
|
252 |
"
|
499
|
253 |
|widget hasChanged newSel|
|
376
|
254 |
|
|
255 |
aList size == list size ifTrue:[
|
|
256 |
list notNil ifTrue:[
|
|
257 |
list keysAndValuesDo:[:aKey :aTab|
|
|
258 |
(aTab label) = (aList at:aKey) ifFalse:[
|
499
|
259 |
hasChanged := true
|
376
|
260 |
]
|
|
261 |
]
|
|
262 |
].
|
499
|
263 |
hasChanged == true ifFalse:[^ self ].
|
376
|
264 |
].
|
343
|
265 |
|
|
266 |
aList size ~~ 0 ifTrue:[
|
499
|
267 |
selection notNil ifTrue:[newSel := (list at:selection) label].
|
|
268 |
list := (tabStyle at:#widget) labels:aList for:self.
|
|
269 |
|
|
270 |
newSel notNil ifTrue:[
|
|
271 |
(newSel := list findFirst:[:aTab| aTab label = newSel]) == 0 ifTrue:[
|
|
272 |
newSel := nil
|
|
273 |
]
|
|
274 |
].
|
|
275 |
] ifFalse:[
|
|
276 |
list := nil.
|
343
|
277 |
].
|
499
|
278 |
selection := newSel.
|
|
279 |
|
343
|
280 |
self shown ifTrue:[
|
|
281 |
self recomputeList.
|
418
|
282 |
self invalidate.
|
376
|
283 |
self changed:#preferredExtent
|
|
284 |
].
|
343
|
285 |
!
|
|
286 |
|
387
|
287 |
useIndex
|
|
288 |
"use index instead of name
|
|
289 |
"
|
|
290 |
^ useIndex
|
|
291 |
|
|
292 |
|
|
293 |
!
|
|
294 |
|
|
295 |
useIndex:aBoolean
|
|
296 |
"set/clear the useIndex flag. If set, both actionBlock and change-messages
|
|
297 |
are passed the index(indices) of the selection as argument.
|
|
298 |
If clear, the value(s) (i.e. the selected string) is passed.
|
|
299 |
Default is false."
|
|
300 |
|
|
301 |
useIndex := aBoolean
|
|
302 |
|
|
303 |
|
418
|
304 |
!
|
|
305 |
|
|
306 |
viewBackground:aColor
|
|
307 |
"update colors
|
|
308 |
"
|
|
309 |
super viewBackground:aColor.
|
|
310 |
TabWidget computeColorsOn:self style:tabStyle.
|
|
311 |
self invalidate.
|
387
|
312 |
! !
|
|
313 |
|
391
|
314 |
!TabView methodsFor:'accessing behavior'!
|
|
315 |
|
|
316 |
enabled
|
|
317 |
"returns true if tabs are enabled
|
|
318 |
"
|
|
319 |
^ enabled
|
|
320 |
!
|
|
321 |
|
|
322 |
enabled:aState
|
|
323 |
"set enabled state
|
|
324 |
"
|
|
325 |
|state|
|
|
326 |
|
|
327 |
state := aState ? true.
|
|
328 |
|
|
329 |
enabled ~~ state ifTrue:[
|
|
330 |
enabled := state.
|
499
|
331 |
self redrawLabels.
|
391
|
332 |
]
|
397
|
333 |
!
|
|
334 |
|
|
335 |
isEnabled:aState
|
|
336 |
"ST-80 compatibility; set enabled state
|
|
337 |
"
|
|
338 |
self enabled:aState
|
|
339 |
|
|
340 |
|
391
|
341 |
! !
|
|
342 |
|
387
|
343 |
!TabView methodsFor:'accessing channels/holders'!
|
|
344 |
|
|
345 |
enableChannel
|
|
346 |
"return a valueHolder for enable/disable
|
|
347 |
"
|
|
348 |
^ enableChannel
|
|
349 |
!
|
|
350 |
|
|
351 |
enableChannel:aValueHolderForBoolean
|
|
352 |
"set the valueHolder used for enable/disable
|
|
353 |
"
|
|
354 |
enableChannel notNil ifTrue:[
|
|
355 |
enableChannel removeDependent:self.
|
|
356 |
].
|
|
357 |
enableChannel := aValueHolderForBoolean.
|
|
358 |
|
|
359 |
enableChannel notNil ifTrue:[
|
|
360 |
enableChannel addDependent:self.
|
|
361 |
].
|
391
|
362 |
self enabled:(enableChannel value).
|
387
|
363 |
|
|
364 |
|
|
365 |
|
|
366 |
!
|
|
367 |
|
343
|
368 |
listHolder
|
|
369 |
"returns the list holder
|
|
370 |
"
|
|
371 |
^ listHolder
|
|
372 |
!
|
|
373 |
|
|
374 |
listHolder:aValueHolder
|
|
375 |
"change the list holder
|
|
376 |
"
|
|
377 |
listHolder notNil ifTrue:[
|
|
378 |
listHolder removeDependent:self.
|
|
379 |
].
|
387
|
380 |
|
343
|
381 |
listHolder := aValueHolder.
|
|
382 |
listHolder notNil ifTrue:[
|
|
383 |
listHolder addDependent:self.
|
|
384 |
self list:listHolder value.
|
|
385 |
self selection:model value.
|
|
386 |
].
|
|
387 |
!
|
|
388 |
|
|
389 |
model:aValueHolder
|
|
390 |
super model:aValueHolder.
|
500
|
391 |
|
343
|
392 |
model notNil ifTrue:[
|
|
393 |
self selection:(model value)
|
|
394 |
]
|
|
395 |
! !
|
|
396 |
|
367
|
397 |
!TabView methodsFor:'accessing dimension'!
|
|
398 |
|
|
399 |
preferredExtent
|
|
400 |
"compute max extent x/y based on one line
|
|
401 |
"
|
|
402 |
|x y ovl ext|
|
|
403 |
|
|
404 |
list size == 0 ifTrue:[^ 0 @ 0 ].
|
|
405 |
|
|
406 |
ovl := tabStyle at:#rightCovered.
|
|
407 |
x := ovl.
|
|
408 |
|
|
409 |
list do:[:aTab|
|
|
410 |
x := x - ovl + aTab preferredExtentX
|
|
411 |
].
|
|
412 |
y := (tabStyle at:#maxY)
|
|
413 |
+ ((tabStyle at:#expandSelection) y)
|
|
414 |
+ (self class viewSpacing).
|
|
415 |
|
369
|
416 |
(self isHorizontalDirection) ifTrue:[
|
367
|
417 |
^ x @ y
|
|
418 |
].
|
369
|
419 |
^ y @ x
|
367
|
420 |
!
|
|
421 |
|
|
422 |
preferredSizeXorY
|
|
423 |
"returns preferred size dependant on the current view layout and
|
|
424 |
the direction of the tabs
|
|
425 |
"
|
|
426 |
|y|
|
|
427 |
|
|
428 |
list size == 0 ifFalse:[
|
369
|
429 |
maxRawNr isNil ifTrue:[self recomputeList].
|
367
|
430 |
|
369
|
431 |
y := (maxRawNr * (tabStyle at:#maxY))
|
367
|
432 |
+ ((tabStyle at:#expandSelection) y)
|
|
433 |
+ (self class viewSpacing).
|
|
434 |
|
|
435 |
^ y
|
|
436 |
].
|
|
437 |
^ 0
|
|
438 |
! !
|
|
439 |
|
343
|
440 |
!TabView methodsFor:'accessing style'!
|
|
441 |
|
367
|
442 |
direction
|
369
|
443 |
"returns the direction of tabs as symbol. On default the value is
|
|
444 |
set to #top. Valid symbols are:
|
|
445 |
#top arrange tabs to be on top of a view
|
|
446 |
#bottom arrange tabs to be on bottom of a view
|
|
447 |
#left arrange tabs to be on left of a view
|
|
448 |
#right arrange tabs to be on right of a view
|
367
|
449 |
"
|
|
450 |
^ direction
|
|
451 |
|
|
452 |
!
|
|
453 |
|
|
454 |
direction:aDirection
|
369
|
455 |
"change the direction of tabs. On default the value is set to #top.
|
|
456 |
Valid symbols are:
|
|
457 |
#top arrange tabs to be on top of a view
|
|
458 |
#bottom arrange tabs to be on bottom of a view
|
|
459 |
#left arrange tabs to be on left of a view
|
|
460 |
#right arrange tabs to be on right of a view
|
367
|
461 |
"
|
374
|
462 |
direction ~~ aDirection ifTrue:[
|
|
463 |
direction := aDirection.
|
|
464 |
self changed:#direction
|
|
465 |
].
|
367
|
466 |
!
|
|
467 |
|
369
|
468 |
fitLastRow
|
|
469 |
"in case of true, the last row is expanded to the view size like all
|
|
470 |
other raws. In case of false all the tabs in the last raw keep their
|
|
471 |
preferred extent (x or y) dependant on the direction.
|
|
472 |
"
|
|
473 |
^ fitLastRow
|
|
474 |
!
|
|
475 |
|
|
476 |
fitLastRow:aBool
|
|
477 |
"in case of true, the last row is expanded to the view size like all
|
|
478 |
other raws. In case of false all the tabs in the last raw keep their
|
|
479 |
preferred extent (x or y) dependant on the direction.
|
|
480 |
"
|
|
481 |
fitLastRow := aBool
|
|
482 |
!
|
|
483 |
|
|
484 |
moveSelectedRow
|
|
485 |
"in case of true, the raw assigned to the tab will be moved
|
|
486 |
to the first line (to the view). Otherwise the position of
|
|
487 |
the view will be kept.
|
|
488 |
"
|
|
489 |
^ moveSelectedRow
|
|
490 |
!
|
|
491 |
|
|
492 |
moveSelectedRow:aBool
|
|
493 |
"in case of true, the raw assigned to the tab will be moved
|
|
494 |
to the first line (to the view). Otherwise the position of
|
|
495 |
the view will be kept.
|
|
496 |
"
|
|
497 |
moveSelectedRow := aBool
|
|
498 |
!
|
|
499 |
|
367
|
500 |
style
|
369
|
501 |
"returns the style sheet derived from the current widget class
|
367
|
502 |
"
|
|
503 |
^ tabStyle
|
|
504 |
!
|
|
505 |
|
343
|
506 |
styleAt:anIdentifier
|
369
|
507 |
"returns a specific entry into the widget description. For more information
|
|
508 |
see the specific widget class ( TabWidget ... ).
|
343
|
509 |
"
|
|
510 |
^ tabStyle at:anIdentifier
|
|
511 |
!
|
|
512 |
|
|
513 |
styleAt:anIdentifier put:something
|
369
|
514 |
"change a specific entry from the widget description. For more information
|
|
515 |
see the specific widget class ( TabWidget ... ).
|
343
|
516 |
"
|
352
|
517 |
tabStyle at:anIdentifier put:something.
|
343
|
518 |
!
|
|
519 |
|
352
|
520 |
tabWidget
|
369
|
521 |
"returns the current widget class as symbol
|
352
|
522 |
"
|
|
523 |
|widget|
|
|
524 |
|
|
525 |
widget := tabStyle at:#widget.
|
|
526 |
widget := widget nameWithoutPrefix asSymbol.
|
|
527 |
^ widget
|
|
528 |
!
|
|
529 |
|
343
|
530 |
tabWidget:aWidget
|
369
|
531 |
"change the current widget class. An existing list will be
|
|
532 |
recomputed and redrawn
|
343
|
533 |
"
|
369
|
534 |
|widget labels|
|
|
535 |
|
|
536 |
(self tabWidget) ~~ aWidget ifTrue:[
|
|
537 |
widget := TabWidget widgetClass:aWidget.
|
343
|
538 |
|
367
|
539 |
widget notNil ifTrue:[
|
369
|
540 |
tabStyle := widget tabStyleOn:self.
|
|
541 |
|
|
542 |
list notNil ifTrue:[
|
|
543 |
labels := list collect:[:aTab| aTab label].
|
|
544 |
list := widget labels:labels for:self.
|
|
545 |
|
|
546 |
self shown ifTrue:[
|
|
547 |
self recomputeList.
|
418
|
548 |
self invalidate.
|
369
|
549 |
]
|
|
550 |
]
|
343
|
551 |
]
|
367
|
552 |
]
|
343
|
553 |
! !
|
|
554 |
|
418
|
555 |
!TabView methodsFor:'accessing tabs'!
|
|
556 |
|
|
557 |
tabAt:anIndex
|
|
558 |
"get tab at an index or nil
|
|
559 |
"
|
|
560 |
(list size >= anIndex and:[anIndex ~~ 0]) ifTrue:[
|
|
561 |
^ list at:anIndex
|
|
562 |
].
|
|
563 |
^ nil
|
|
564 |
! !
|
|
565 |
|
343
|
566 |
!TabView methodsFor:'change & update'!
|
|
567 |
|
387
|
568 |
sizeChanged:how
|
|
569 |
"size of view changed
|
|
570 |
"
|
418
|
571 |
|extent delta|
|
387
|
572 |
|
418
|
573 |
list size ~~ 0 ifTrue:[
|
|
574 |
extent := super extent.
|
|
575 |
delta := oldExtent - extent.
|
|
576 |
|
|
577 |
(delta x > 1 or:[delta x < -1 or:[delta y > 1 or:[delta y < -1]]]) ifTrue:[
|
|
578 |
oldExtent := extent.
|
|
579 |
self recomputeList.
|
387
|
580 |
self changed:#preferredExtent.
|
|
581 |
]
|
|
582 |
].
|
418
|
583 |
super sizeChanged:how
|
387
|
584 |
|
|
585 |
!
|
|
586 |
|
343
|
587 |
update:something with:aParameter from:changedObject
|
369
|
588 |
"one of my models changed its value
|
343
|
589 |
"
|
391
|
590 |
changedObject == model ifTrue:[^ self selection:model value].
|
|
591 |
changedObject == listHolder ifTrue:[^ self list:(listHolder value)].
|
|
592 |
changedObject == enableChannel ifTrue:[^ self enabled:(enableChannel value)].
|
343
|
593 |
! !
|
|
594 |
|
|
595 |
!TabView methodsFor:'drawing'!
|
|
596 |
|
|
597 |
paintColor:aColorSymbol
|
369
|
598 |
"set the paint color derived from the symbol used as key into the current
|
|
599 |
style sheet to access the color
|
343
|
600 |
"
|
|
601 |
self paint:(tabStyle at:aColorSymbol)
|
|
602 |
!
|
|
603 |
|
499
|
604 |
redrawLabels
|
|
605 |
"redraw all the labels
|
|
606 |
"
|
|
607 |
|selectedTab|
|
|
608 |
|
|
609 |
(self shown and:[list size ~~ 0]) ifTrue:[
|
|
610 |
selection notNil ifTrue:[
|
|
611 |
selectedTab := list at:selection.
|
|
612 |
].
|
|
613 |
|
|
614 |
list reverseDo:[:aTab|
|
|
615 |
aTab ~~ selectedTab ifTrue:[
|
|
616 |
aTab redrawLabel
|
|
617 |
] ifFalse:[
|
|
618 |
self selectedTab:aTab redrawBlock:[aTab redrawLabel]
|
|
619 |
]
|
|
620 |
]
|
|
621 |
].
|
|
622 |
!
|
|
623 |
|
369
|
624 |
redrawRawAt:aRawNr
|
|
625 |
"redraw raw at a number; all contained tabs are drawn unselected
|
367
|
626 |
"
|
372
|
627 |
list reverseDo:[:aTab|aTab lineNr == aRawNr ifTrue:[aTab redraw:false]].
|
367
|
628 |
!
|
|
629 |
|
|
630 |
redrawSelection
|
|
631 |
"redraw current selection
|
|
632 |
"
|
499
|
633 |
|tab idx|
|
343
|
634 |
|
499
|
635 |
(selection notNil and:[self shown and:[list size ~~ 0]]) ifTrue:[
|
|
636 |
tab := list at:selection.
|
|
637 |
idx := tab lineNr.
|
|
638 |
self selectedTab:tab redrawBlock:[tab redraw:true].
|
|
639 |
[(idx := idx - 1) ~~ 0] whileTrue:[self redrawRawAt:idx].
|
|
640 |
].
|
|
641 |
!
|
|
642 |
|
|
643 |
redrawX:x y:y width:w height:h
|
|
644 |
"a region must be redrawn
|
|
645 |
"
|
|
646 |
|oldSelect|
|
|
647 |
|
|
648 |
self shown ifTrue:[
|
|
649 |
self paint:(self viewBackground).
|
|
650 |
self clearRectangleX:x y:y width:w height:h.
|
343
|
651 |
|
499
|
652 |
list size ~~ 0 ifTrue:[
|
|
653 |
maxRawNr to:1 by:-1 do:[:i| self redrawRawAt:i ].
|
|
654 |
|
|
655 |
selection notNil ifTrue:[
|
|
656 |
oldSelect := selection.
|
|
657 |
selection := nil.
|
|
658 |
self setSelection:oldSelect.
|
|
659 |
]
|
|
660 |
]
|
|
661 |
]
|
|
662 |
|
|
663 |
!
|
|
664 |
|
|
665 |
selectedTab:aTab redrawBlock:aRedrawBlock
|
|
666 |
"calculate extent of selection and evaluate the block which will
|
|
667 |
perform a redraw action
|
|
668 |
"
|
|
669 |
|tab size oldAnc newAnc oldExt newExt expSel expDlt x y|
|
343
|
670 |
|
367
|
671 |
tab := list at:selection.
|
|
672 |
oldAnc := tab anchor.
|
|
673 |
oldExt := tab extent.
|
|
674 |
expSel := tabStyle at:#expandSelection.
|
|
675 |
expDlt := expSel x.
|
|
676 |
|
369
|
677 |
(self isHorizontalDirection) ifTrue:[
|
367
|
678 |
newExt := oldExt + ( expDlt @ 0 ).
|
|
679 |
newAnc := oldAnc - ((expDlt//2) @ ((expSel y) negated)).
|
343
|
680 |
|
367
|
681 |
(x := newAnc x) < 0 ifTrue:[
|
|
682 |
newExt x:(newExt x + x).
|
|
683 |
newAnc x:0.
|
|
684 |
x := 0.
|
|
685 |
].
|
369
|
686 |
(x + newExt x) > (super extent x) ifTrue:[newExt x:((super extent x) - x)].
|
367
|
687 |
] ifFalse:[
|
|
688 |
newExt := oldExt + ( 0 @ expDlt ).
|
|
689 |
newAnc := oldAnc - (((expSel y) negated) @ (expDlt//2)).
|
343
|
690 |
|
367
|
691 |
(y := newAnc y) < 0 ifTrue:[
|
|
692 |
newExt y:(newExt y + y).
|
|
693 |
newAnc y:0.
|
|
694 |
y := 0.
|
|
695 |
].
|
369
|
696 |
(y + newExt y) > (super extent y) ifTrue:[newExt y:((super extent y) - y)].
|
343
|
697 |
].
|
|
698 |
|
367
|
699 |
tab anchor:newAnc extent:newExt.
|
499
|
700 |
aRedrawBlock value.
|
367
|
701 |
tab anchor:oldAnc extent:oldExt.
|
352
|
702 |
|
343
|
703 |
! !
|
|
704 |
|
|
705 |
!TabView methodsFor:'event handling'!
|
|
706 |
|
|
707 |
buttonPress:button x:x y:y
|
369
|
708 |
"a button is pressed; find tab under point and set the selection
|
343
|
709 |
"
|
499
|
710 |
|idx|
|
|
711 |
|
|
712 |
( self isEnabled
|
|
713 |
and:[list notNil
|
|
714 |
and:[(idx := list findFirst:[:aTab|aTab containsPoint:(x@y)]) ~~ 0]]
|
|
715 |
) ifTrue:[
|
|
716 |
self selection:idx
|
|
717 |
].
|
343
|
718 |
!
|
|
719 |
|
346
|
720 |
keyPress:aKey x:x y:y
|
|
721 |
"selection might change; look for corresponding list entry
|
|
722 |
"
|
418
|
723 |
|size newSel index|
|
346
|
724 |
|
391
|
725 |
(self isEnabled and:[(size := list size) ~~ 0]) ifTrue:[
|
372
|
726 |
(aKey == #CursorRight or:[aKey == #CursorDown]) ifTrue:[
|
346
|
727 |
(selection isNil or:[selection == size]) ifTrue:[
|
|
728 |
newSel := 1
|
|
729 |
] ifFalse:[
|
|
730 |
newSel := (selection + 1)
|
|
731 |
]
|
|
732 |
] ifFalse:[
|
372
|
733 |
(aKey == #CursorLeft or:[aKey == #CursorUp]) ifTrue:[
|
346
|
734 |
(selection isNil or:[selection == 1]) ifTrue:[
|
|
735 |
newSel := size
|
|
736 |
] ifFalse:[
|
|
737 |
newSel := (selection - 1)
|
|
738 |
]
|
418
|
739 |
] ifFalse:[
|
|
740 |
aKey isCharacter ifTrue:[
|
|
741 |
(selection isNil or:[selection == size]) ifTrue:[index := 1]
|
|
742 |
ifFalse:[index := selection + 1].
|
|
743 |
newSel := self findTabStartingWithKey:aKey startingAt:index.
|
|
744 |
|
|
745 |
(newSel == 0 and:[index ~~ 1]) ifTrue:[
|
|
746 |
newSel := self findTabStartingWithKey:aKey startingAt:1
|
|
747 |
]
|
|
748 |
]
|
346
|
749 |
]
|
|
750 |
]
|
|
751 |
].
|
|
752 |
|
418
|
753 |
(newSel isNil or:[newSel == 0]) ifTrue:[
|
|
754 |
super keyPress:aKey x:x y:y
|
|
755 |
].
|
|
756 |
self selection:newSel
|
|
757 |
|
343
|
758 |
! !
|
|
759 |
|
|
760 |
!TabView methodsFor:'initialization'!
|
|
761 |
|
387
|
762 |
destroy
|
|
763 |
listHolder notNil ifTrue:[
|
|
764 |
listHolder removeDependent:self.
|
|
765 |
].
|
|
766 |
enableChannel notNil ifTrue:[
|
|
767 |
enableChannel removeDependent:self.
|
|
768 |
].
|
|
769 |
super destroy.
|
|
770 |
!
|
|
771 |
|
343
|
772 |
initialize
|
|
773 |
"setup default attributes
|
|
774 |
"
|
|
775 |
|widget|
|
|
776 |
|
|
777 |
super initialize.
|
369
|
778 |
|
|
779 |
widget := TabWidget widgetClass:(self class defaultTabWidget).
|
|
780 |
tabStyle := widget tabStyleOn:self.
|
|
781 |
useIndex := false.
|
|
782 |
direction := #top.
|
|
783 |
fitLastRow := true.
|
|
784 |
moveSelectedRow := true.
|
391
|
785 |
enabled := true.
|
410
|
786 |
super font:(Label defaultFont on:device).
|
418
|
787 |
oldExtent := 0@0.
|
343
|
788 |
! !
|
|
789 |
|
|
790 |
!TabView methodsFor:'layout'!
|
|
791 |
|
369
|
792 |
changeRaw:aRawA with:aRawB
|
|
793 |
"exchange positions of two raws
|
|
794 |
"
|
|
795 |
|tabB tabA ancA ancB hrz|
|
|
796 |
|
372
|
797 |
tabA := list at:(list findFirst:[:aTab|aTab lineNr == aRawA]).
|
|
798 |
tabB := list at:(list findFirst:[:aTab|aTab lineNr == aRawB]).
|
369
|
799 |
hrz := (self isHorizontalDirection).
|
|
800 |
|
|
801 |
hrz ifTrue:[
|
|
802 |
ancA := tabA anchor y.
|
|
803 |
ancB := tabB anchor y.
|
|
804 |
] ifFalse:[
|
|
805 |
ancA := tabA anchor x.
|
|
806 |
ancB := tabB anchor x.
|
|
807 |
].
|
|
808 |
|
|
809 |
list do:[:aTab||ln|
|
|
810 |
(ln := aTab lineNr) == aRawB ifTrue:[
|
|
811 |
aTab lineNr:aRawA.
|
|
812 |
hrz ifTrue:[aTab anchor y:ancA]
|
|
813 |
ifFalse:[aTab anchor x:ancA]
|
|
814 |
] ifFalse:[
|
|
815 |
ln == aRawA ifTrue:[
|
|
816 |
aTab lineNr:aRawB.
|
|
817 |
hrz ifTrue:[aTab anchor y:ancB]
|
|
818 |
ifFalse:[aTab anchor x:ancB]
|
|
819 |
]
|
|
820 |
]
|
|
821 |
].
|
|
822 |
|
|
823 |
aRawB == maxRawNr ifTrue:[
|
|
824 |
self fitRawAt:aRawA.
|
|
825 |
self unfitLastRaw.
|
|
826 |
] ifFalse:[
|
|
827 |
aRawA == maxRawNr ifTrue:[
|
|
828 |
self fitRawAt:aRawB.
|
|
829 |
self unfitLastRaw.
|
|
830 |
]
|
|
831 |
]
|
|
832 |
!
|
|
833 |
|
|
834 |
fitRawAt:aRawNr
|
|
835 |
"fit raw to view's size
|
|
836 |
"
|
|
837 |
|last first tab ext org max size|
|
|
838 |
|
|
839 |
(aRawNr ~~ maxRawNr or:[fitLastRow]) ifFalse:[^ self].
|
|
840 |
|
|
841 |
last := list findLast:[:aTab| aTab lineNr == aRawNr ].
|
|
842 |
first := list findFirst:[:aTab| aTab lineNr == aRawNr ].
|
372
|
843 |
tab := list at:last.
|
369
|
844 |
size := last - first + 1.
|
|
845 |
org := 0.
|
|
846 |
|
|
847 |
(self isHorizontalDirection) ifTrue:[
|
|
848 |
max := super extent x.
|
|
849 |
ext := (max - ((tab anchor x) + (tab extent x))) // size.
|
|
850 |
|
|
851 |
ext > 1 ifTrue:[
|
372
|
852 |
first to:last do:[:i|
|
369
|
853 |
tab := list at:i.
|
|
854 |
tab extent x:((tab extent x) + ext).
|
|
855 |
tab anchor x:((tab anchor x) + org).
|
|
856 |
org := org + ext.
|
|
857 |
].
|
372
|
858 |
tab := list at:last.
|
369
|
859 |
].
|
|
860 |
tab extent x:(max - tab anchor x).
|
|
861 |
] ifFalse:[
|
|
862 |
max := super extent y.
|
|
863 |
ext := (max - ((tab anchor y) + (tab extent y))) // size.
|
|
864 |
|
|
865 |
ext > 1 ifTrue:[
|
372
|
866 |
first to:last do:[:i|
|
369
|
867 |
tab := list at:i.
|
|
868 |
tab extent y:((tab extent y) + ext).
|
|
869 |
tab anchor y:((tab anchor y) + org).
|
|
870 |
org := org + ext.
|
|
871 |
].
|
372
|
872 |
tab := list at:last.
|
369
|
873 |
].
|
|
874 |
tab extent y:(max - tab anchor y).
|
|
875 |
]
|
|
876 |
!
|
|
877 |
|
343
|
878 |
recomputeList
|
369
|
879 |
"recompute list
|
343
|
880 |
"
|
369
|
881 |
|tab maxY x y maxSz ovl|
|
343
|
882 |
|
367
|
883 |
list size ~~ 0 ifTrue:[
|
369
|
884 |
maxY := tabStyle at:#maxY.
|
|
885 |
ovl := tabStyle at:#rightCovered.
|
|
886 |
maxRawNr := 1.
|
|
887 |
|
|
888 |
(self isHorizontalDirection) ifTrue:[
|
|
889 |
maxSz := super extent x.
|
|
890 |
x := 0.
|
|
891 |
y := maxY.
|
|
892 |
|
372
|
893 |
list do:[:aTab||eX n|
|
369
|
894 |
eX := aTab preferredExtentX.
|
|
895 |
n := eX + x - ovl.
|
|
896 |
|
371
|
897 |
(n > maxSz and:[x ~~ 0]) ifTrue:[
|
369
|
898 |
maxRawNr := maxRawNr + 1.
|
|
899 |
x := 0.
|
|
900 |
y := y + maxY.
|
|
901 |
n := eX - ovl.
|
|
902 |
].
|
|
903 |
aTab lineNr:maxRawNr.
|
|
904 |
aTab anchor:x@y extent:(eX @ maxY).
|
|
905 |
x := n.
|
|
906 |
]
|
367
|
907 |
] ifFalse:[
|
369
|
908 |
maxSz := super extent y.
|
|
909 |
x := maxY.
|
|
910 |
y := 0.
|
|
911 |
|
372
|
912 |
list do:[:aTab||eY n|
|
369
|
913 |
eY := aTab preferredExtentX.
|
|
914 |
n := eY + y - ovl.
|
|
915 |
|
371
|
916 |
(n > maxSz and:[y ~~ 0]) ifTrue:[
|
369
|
917 |
maxRawNr := maxRawNr + 1.
|
|
918 |
y := 0.
|
|
919 |
x := x + maxY.
|
|
920 |
n := eY - ovl.
|
|
921 |
].
|
|
922 |
aTab lineNr:maxRawNr.
|
|
923 |
aTab anchor:x@y extent:(maxY @ eY).
|
|
924 |
y := n.
|
|
925 |
]
|
|
926 |
].
|
|
927 |
"/ fit raws to view
|
|
928 |
1 to:maxRawNr do:[:aLnNr|self fitRawAt:aLnNr].
|
367
|
929 |
].
|
|
930 |
!
|
|
931 |
|
369
|
932 |
unfitLastRaw
|
|
933 |
"use the preferred extent for all tabs in the last raw
|
367
|
934 |
"
|
369
|
935 |
|last first tab ovl anchor extent pos offset hrz|
|
343
|
936 |
|
369
|
937 |
fitLastRow ifTrue:[^ self].
|
|
938 |
|
|
939 |
last := list findLast:[:aTab| aTab lineNr == maxRawNr ].
|
|
940 |
first := list findFirst:[:aTab| aTab lineNr == maxRawNr ].
|
367
|
941 |
ovl := tabStyle at:#rightCovered.
|
369
|
942 |
pos := 0.
|
|
943 |
hrz := (self isHorizontalDirection).
|
367
|
944 |
|
372
|
945 |
first to:last do:[:i|
|
369
|
946 |
tab := list at:i.
|
|
947 |
anchor := tab anchor.
|
|
948 |
extent := tab extent.
|
|
949 |
offset := tab preferredExtentX.
|
367
|
950 |
|
369
|
951 |
hrz ifTrue:[
|
|
952 |
extent x:offset.
|
|
953 |
anchor x:pos
|
|
954 |
] ifFalse:[
|
|
955 |
extent y:offset.
|
|
956 |
anchor y:pos.
|
367
|
957 |
].
|
369
|
958 |
tab anchor:anchor extent:extent.
|
|
959 |
pos := pos + offset - ovl.
|
349
|
960 |
].
|
369
|
961 |
! !
|
343
|
962 |
|
373
|
963 |
!TabView methodsFor:'private'!
|
|
964 |
|
418
|
965 |
findTabStartingWithKey:aKey startingAt:anIndex
|
|
966 |
"get index of tab starting its label with a key or 0
|
|
967 |
"
|
|
968 |
|upper lower lbl|
|
|
969 |
|
|
970 |
(aKey isCharacter and:[anIndex <= list size]) ifFalse:[ ^ 0 ].
|
|
971 |
|
|
972 |
upper := aKey asUppercase.
|
|
973 |
lower := aKey asLowercase.
|
|
974 |
|
|
975 |
^ list findFirst:[:aTab|
|
|
976 |
lbl := aTab label string.
|
|
977 |
(lbl size ~~ 0 and:[lbl first == lower or:[lbl first == upper]])
|
|
978 |
] startingAt:anIndex
|
|
979 |
!
|
|
980 |
|
373
|
981 |
listIndexOf:something
|
|
982 |
"convert something to an index into list or nil.
|
|
983 |
"
|
|
984 |
|index|
|
|
985 |
|
|
986 |
something isString ifTrue:[
|
|
987 |
index := list findFirst:[:aTab|aTab label = something].
|
|
988 |
] ifFalse:[
|
|
989 |
index := something
|
|
990 |
].
|
|
991 |
index ~~ 0 ifTrue:[^ index]
|
|
992 |
ifFalse:[^ nil]
|
|
993 |
! !
|
|
994 |
|
369
|
995 |
!TabView methodsFor:'queries'!
|
343
|
996 |
|
387
|
997 |
isEnabled
|
391
|
998 |
"returns enabled state
|
|
999 |
"
|
|
1000 |
^ enabled
|
387
|
1001 |
!
|
|
1002 |
|
369
|
1003 |
isHorizontalDirection
|
|
1004 |
"returns true in case of direction is #top or #bottom
|
|
1005 |
"
|
|
1006 |
^ (direction == #top or:[direction == #bottom])
|
|
1007 |
|
367
|
1008 |
!
|
343
|
1009 |
|
369
|
1010 |
isVerticalDirection
|
|
1011 |
"returns true in case of direction is #left or #right
|
367
|
1012 |
"
|
369
|
1013 |
^ (direction == #left or:[direction == #right])
|
367
|
1014 |
|
343
|
1015 |
! !
|
|
1016 |
|
|
1017 |
!TabView methodsFor:'selection'!
|
|
1018 |
|
|
1019 |
selection
|
|
1020 |
"return the selection index or nil
|
|
1021 |
"
|
352
|
1022 |
useIndex ifTrue:[
|
500
|
1023 |
^ selection ? 0
|
352
|
1024 |
].
|
|
1025 |
|
|
1026 |
(selection notNil and:[list size >= selection]) ifTrue:[
|
|
1027 |
^ (list at:selection) label
|
|
1028 |
].
|
|
1029 |
^ nil
|
343
|
1030 |
!
|
|
1031 |
|
|
1032 |
selection:anIndexOrNil
|
|
1033 |
"change the selection to index or nil. The model and/or actionBlock is notified
|
|
1034 |
"
|
499
|
1035 |
|oldSel|
|
|
1036 |
|
|
1037 |
oldSel := selection.
|
|
1038 |
self setSelection:anIndexOrNil.
|
|
1039 |
oldSel ~~ selection ifTrue:[self selectionHasChanged].
|
|
1040 |
|
|
1041 |
!
|
|
1042 |
|
|
1043 |
selectionHasChanged
|
|
1044 |
"selection might change; raise notification
|
|
1045 |
"
|
352
|
1046 |
|sel|
|
343
|
1047 |
|
499
|
1048 |
sel := self selection.
|
343
|
1049 |
|
499
|
1050 |
model notNil ifTrue:[model value:sel].
|
|
1051 |
action notNil ifTrue:[action value:sel]
|
343
|
1052 |
|
|
1053 |
!
|
|
1054 |
|
373
|
1055 |
setSelection:something
|
343
|
1056 |
"change the selection to index or nil. No notifications are raised
|
|
1057 |
"
|
373
|
1058 |
|newSel lnNr tab last first exp x y w h|
|
343
|
1059 |
|
418
|
1060 |
list size == 0 ifTrue:[^ self].
|
373
|
1061 |
newSel := self listIndexOf:something.
|
|
1062 |
selection == newSel ifTrue:[^ self].
|
372
|
1063 |
|
352
|
1064 |
self shown ifFalse:[
|
373
|
1065 |
selection := newSel.
|
352
|
1066 |
^ self
|
|
1067 |
].
|
|
1068 |
|
445
|
1069 |
maxRawNr isNil ifTrue:[
|
|
1070 |
selection := newSel.
|
|
1071 |
self recomputeList.
|
|
1072 |
^ self invalidate.
|
|
1073 |
].
|
|
1074 |
|
373
|
1075 |
(newSel notNil and:[moveSelectedRow and:[(lnNr := (list at:newSel) lineNr) > 1]]) ifTrue:[
|
369
|
1076 |
self changeRaw:1 with:lnNr.
|
418
|
1077 |
selection := 1. "/ force a redraw
|
352
|
1078 |
].
|
|
1079 |
|
|
1080 |
selection notNil ifTrue:[
|
373
|
1081 |
maxRawNr > 1 ifTrue:[
|
418
|
1082 |
self paint:(self viewBackground). "/ total redraw
|
|
1083 |
self clear.
|
373
|
1084 |
selection := nil.
|
418
|
1085 |
maxRawNr to:1 by:-1 do:[:i| self redrawRawAt:i ].
|
373
|
1086 |
] ifFalse:[
|
|
1087 |
first := 1.
|
|
1088 |
|
499
|
1089 |
(selection ~~ 1 and:[(tabStyle at:#rightCovered) == 0]) ifTrue:[
|
373
|
1090 |
first := selection - 1
|
|
1091 |
].
|
|
1092 |
|
|
1093 |
(last := selection + 1) > list size ifTrue:[
|
|
1094 |
last := selection
|
|
1095 |
].
|
|
1096 |
exp := (tabStyle at:#expandSelection) x.
|
|
1097 |
tab := list at:selection.
|
|
1098 |
|
|
1099 |
self isHorizontalDirection ifTrue:[
|
|
1100 |
(x := tab anchor x - (exp // 2)) < 0 ifTrue:[x := 0].
|
|
1101 |
w := tab extent x + exp.
|
|
1102 |
h := super extent y.
|
|
1103 |
y := 0.
|
|
1104 |
] ifFalse:[
|
|
1105 |
(y := tab anchor y - (exp // 2)) < 0 ifTrue:[y := 0].
|
|
1106 |
h := tab extent y + exp.
|
|
1107 |
w := super extent x.
|
|
1108 |
x := 0.
|
|
1109 |
].
|
|
1110 |
self paint:(self viewBackground).
|
|
1111 |
self clearRectangleX:x y:y width:w height:h.
|
|
1112 |
|
|
1113 |
last to:first by:-1 do:[:i|
|
|
1114 |
tab := list at:i.
|
|
1115 |
tab redraw:false
|
|
1116 |
]
|
|
1117 |
]
|
352
|
1118 |
].
|
373
|
1119 |
selection := newSel.
|
367
|
1120 |
self redrawSelection.
|
343
|
1121 |
! !
|
|
1122 |
|
|
1123 |
!TabView class methodsFor:'documentation'!
|
|
1124 |
|
|
1125 |
version
|
500
|
1126 |
^ '$Header: /cvs/stx/stx/libwidg2/TabView.st,v 1.21 1997-08-26 15:35:29 ca Exp $'
|
343
|
1127 |
! !
|