author | Claus Gittinger <cg@exept.de> |
Fri, 28 Jun 2019 09:21:50 +0200 | |
changeset 6078 | 08c9e2a47dc5 |
parent 5169 | b18ad544fca8 |
child 5970 | 53fd42d2c814 |
permissions | -rw-r--r-- |
5169 | 1 |
"{ Encoding: utf8 }" |
2 |
||
38 | 3 |
" |
4 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
2659
3af857eb52fb
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
1445
diff
changeset
|
14 |
"{ Package: 'stx:libwidg2' }" |
3af857eb52fb
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
1445
diff
changeset
|
15 |
|
4997 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
49 | 18 |
SimpleView subclass:#TabSpecRuler |
342 | 19 |
instanceVariableNames:'tabSpec titles handleStyle handleCursor movedTabIndex movedTabX |
20 |
synchronousOperation handleWidth fixedTabs tabsAreVariable |
|
1445
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
21 |
hiddenTabs masterView' |
200 | 22 |
classVariableNames:'DefaultHandleStyle' |
23 |
poolDictionaries:'' |
|
24 |
category:'Views-Misc' |
|
29 | 25 |
! |
26 |
||
27 |
!TabSpecRuler class methodsFor:'documentation'! |
|
28 |
||
38 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
36 | 43 |
documentation |
44 |
" |
|
326 | 45 |
It shows the tabulator positions of a TabulatorSpecification |
46 |
and allows its tab positions to be manipulated. |
|
47 |
(as shown in a FileBrowser, when the longList is enabled). |
|
200 | 48 |
|
326 | 49 |
[author] |
50 |
Claus Gittinger |
|
200 | 51 |
|
52 |
[see also:] |
|
53 |
TabulatorSpecification |
|
54 |
Ruler |
|
55 |
ListView |
|
36 | 56 |
" |
57 |
! |
|
58 |
||
29 | 59 |
examples |
60 |
" |
|
326 | 61 |
[exBegin] |
62 |
|top head spec| |
|
29 | 63 |
|
326 | 64 |
top := View new. |
65 |
top extent:300@100. |
|
29 | 66 |
|
326 | 67 |
head := TabSpecRuler in:top. |
68 |
head width:1.0. |
|
69 |
head level:1. |
|
29 | 70 |
|
326 | 71 |
spec := TabulatorSpecification new. |
72 |
spec unit:#inch. |
|
73 |
spec positions:#(0 1 2.5 3.5 4 5 ). |
|
74 |
spec align: #(#left #left #right #right #center #decimal ). |
|
29 | 75 |
|
326 | 76 |
head tabulatorSpecification:spec. |
77 |
top open. |
|
78 |
[exEnd] |
|
342 | 79 |
|
80 |
[exBegin] |
|
81 |
|top head spec| |
|
82 |
||
83 |
top := View new. |
|
84 |
top extent:300@100. |
|
85 |
||
86 |
head := TabSpecRuler in:top. |
|
87 |
head width:1.0. |
|
88 |
head level:1. |
|
89 |
head titles:#('col1' 'col2' 'col3' 'col4' 'col5' 'col6'). |
|
90 |
||
91 |
spec := TabulatorSpecification new. |
|
92 |
spec unit:#inch. |
|
93 |
spec positions:#(0 1 2.5 3.5 4 5 ). |
|
94 |
spec align: #(#left #left #right #right #center #decimal ). |
|
95 |
||
96 |
head tabulatorSpecification:spec. |
|
97 |
top open. |
|
98 |
[exEnd] |
|
29 | 99 |
" |
100 |
||
101 |
! ! |
|
102 |
||
103 |
!TabSpecRuler class methodsFor:'defaults'! |
|
104 |
||
105 |
updateStyleCache |
|
566 | 106 |
<resource: #style (#'tabRuler.handleStyle')> |
29 | 107 |
|
566 | 108 |
DefaultHandleStyle := StyleSheet at:'tabRuler.handleStyle'. |
109 |
||
110 |
"Modified: 20.10.1997 / 15:14:47 / cg" |
|
29 | 111 |
! ! |
112 |
||
200 | 113 |
!TabSpecRuler methodsFor:'accessing'! |
29 | 114 |
|
2741 | 115 |
beAsynchronous |
116 |
"clear synchronousOperation mode; |
|
117 |
if on, a move is immediately forwarded to dependents; |
|
118 |
of off, its forwarded when the mouse button is released." |
|
119 |
||
120 |
synchronousOperation := false. |
|
121 |
||
122 |
"Modified: 28.3.1997 / 15:02:07 / cg" |
|
123 |
! |
|
124 |
||
125 |
beSynchronous |
|
126 |
"set synchronousOperation mode; |
|
127 |
if on, a move is immediately forwarded to dependents; |
|
128 |
of off, its forwarded when the mouse button is released." |
|
129 |
||
130 |
synchronousOperation := true. |
|
131 |
||
132 |
"Modified: 28.3.1997 / 15:02:07 / cg" |
|
133 |
! |
|
134 |
||
328 | 135 |
fixedTabs |
136 |
"return the collection of tabIndices which are fixed; |
|
137 |
or nil, if all are variable" |
|
138 |
||
139 |
^ fixedTabs |
|
140 |
||
141 |
"Created: 28.3.1997 / 15:02:29 / cg" |
|
142 |
"Modified: 28.3.1997 / 15:03:05 / cg" |
|
143 |
! |
|
144 |
||
145 |
fixedTabs:something |
|
146 |
"set the collection of tabIndices which are fixed; |
|
147 |
nil, if all are to be variable" |
|
148 |
||
149 |
fixedTabs := something. |
|
150 |
||
151 |
"Created: 28.3.1997 / 15:02:29 / cg" |
|
152 |
"Modified: 28.3.1997 / 15:03:18 / cg" |
|
153 |
! |
|
154 |
||
330 | 155 |
hiddenTabs |
156 |
"return the collection of tabs which are to be hidden |
|
157 |
(or nil if all are to be shown)" |
|
158 |
||
159 |
^ hiddenTabs |
|
160 |
||
161 |
"Created: 28.3.1997 / 15:35:54 / cg" |
|
162 |
"Modified: 28.3.1997 / 15:36:18 / cg" |
|
163 |
! |
|
164 |
||
165 |
hiddenTabs:something |
|
166 |
"set the collection of tabs which are to be hidden |
|
167 |
(or nil if all are to be shown)" |
|
168 |
||
169 |
hiddenTabs := something. |
|
170 |
||
171 |
"Created: 28.3.1997 / 15:35:54 / cg" |
|
172 |
"Modified: 28.3.1997 / 15:36:24 / cg" |
|
173 |
! |
|
174 |
||
2741 | 175 |
isSynchronous |
176 |
"return the synchronousOperation mode settings value" |
|
177 |
||
178 |
^ synchronousOperation |
|
179 |
||
180 |
"Created: 28.3.1997 / 15:01:17 / cg" |
|
181 |
"Modified: 28.3.1997 / 15:02:20 / cg" |
|
182 |
! |
|
183 |
||
1445
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
184 |
masterView:aView |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
185 |
"set my master view - if non-nil, I will follow the masters scroll-offset" |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
186 |
|
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
187 |
masterView notNil ifTrue:[ |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
188 |
masterView removeDependent:self |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
189 |
]. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
190 |
masterView := aView. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
191 |
masterView notNil ifTrue:[ |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
192 |
masterView addDependent:self |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
193 |
]. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
194 |
|
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
195 |
! |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
196 |
|
328 | 197 |
synchronousOperation |
3644 | 198 |
<resource: #obsolete> |
328 | 199 |
"return the synchronousOperation mode settings value" |
200 |
||
2741 | 201 |
self obsoleteMethodWarning:'use #isSynchronous'. |
328 | 202 |
^ synchronousOperation |
203 |
||
204 |
"Created: 28.3.1997 / 15:01:17 / cg" |
|
205 |
"Modified: 28.3.1997 / 15:02:20 / cg" |
|
206 |
! |
|
207 |
||
208 |
synchronousOperation:something |
|
3644 | 209 |
<resource: #obsolete> |
328 | 210 |
"set/clear synchronousOperation mode; |
211 |
if on, a move is immediately forwarded to dependents; |
|
212 |
of off, its forwarded when the mouse button is released." |
|
213 |
||
2741 | 214 |
self obsoleteMethodWarning:'use #beSynchronous / #beAsynchronous'. |
328 | 215 |
synchronousOperation := something. |
216 |
||
217 |
"Modified: 28.3.1997 / 15:02:07 / cg" |
|
218 |
! |
|
219 |
||
220 |
tabsAreVariable |
|
221 |
"return the value of the instance variable 'tabsAreVariable' (automatically generated)" |
|
222 |
||
223 |
^ tabsAreVariable |
|
224 |
||
225 |
"Created: 28.3.1997 / 15:05:27 / cg" |
|
226 |
! |
|
227 |
||
228 |
tabsAreVariable:something |
|
229 |
"set/clear movability of tabs. If false, tab positions are only |
|
230 |
displayed - but cannot be moved by the user. |
|
231 |
The default is true." |
|
232 |
||
233 |
tabsAreVariable := something. |
|
234 |
||
235 |
"Created: 28.3.1997 / 15:05:27 / cg" |
|
236 |
"Modified: 28.3.1997 / 15:06:19 / cg" |
|
237 |
! |
|
238 |
||
200 | 239 |
tabulatorSpecification:aTabSpec |
240 |
"set my tabulator specification" |
|
29 | 241 |
|
365
4228b1451bc9
redraw when the spec is changed
Claus Gittinger <cg@exept.de>
parents:
342
diff
changeset
|
242 |
tabSpec := aTabSpec. |
2659
3af857eb52fb
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
1445
diff
changeset
|
243 |
self invalidate |
29 | 244 |
|
365
4228b1451bc9
redraw when the spec is changed
Claus Gittinger <cg@exept.de>
parents:
342
diff
changeset
|
245 |
"Modified: 18.4.1997 / 18:16:07 / cg" |
342 | 246 |
! |
247 |
||
248 |
titles:aCollectionOfStrings |
|
249 |
titles := aCollectionOfStrings |
|
250 |
||
251 |
"Created: 1.4.1997 / 13:52:37 / cg" |
|
29 | 252 |
! ! |
253 |
||
326 | 254 |
!TabSpecRuler methodsFor:'event handling'! |
255 |
||
256 |
buttonMotion:state x:x y:y |
|
257 |
"mouse-button was moved while pressed; |
|
258 |
redraw thumb at its new position and, if scroll-mode is asynchronous, |
|
259 |
the scroll action is performed" |
|
260 |
||
261 |
|left right limit1 limit2 minSpacing newX| |
|
262 |
||
263 |
movedTabIndex notNil ifTrue:[ |
|
328 | 264 |
minSpacing := 5. |
265 |
||
326 | 266 |
left := limit1 := 0. |
267 |
movedTabIndex > 1 ifTrue:[ |
|
268 |
left := self positionOfTabAtIndex:(movedTabIndex-1). |
|
269 |
limit1 := left + minSpacing. |
|
270 |
]. |
|
271 |
right := limit2 := width. |
|
272 |
movedTabIndex < tabSpec size ifTrue:[ |
|
273 |
right := self positionOfTabAtIndex:(movedTabIndex+1). |
|
274 |
limit2 := right - minSpacing. |
|
275 |
]. |
|
276 |
newX := (x max:limit1) min:limit2. |
|
277 |
x ~= newX ifTrue:[ |
|
278 |
self cursor:Cursor stop. |
|
279 |
] ifFalse:[ |
|
280 |
self cursor:handleCursor |
|
281 |
]. |
|
282 |
newX ~= movedTabX ifTrue:[ |
|
283 |
movedTabX := newX. |
|
284 |
self clearRectangleX:left+handleWidth y:0 |
|
285 |
width:(right-left-handleWidth-handleWidth) height:height. |
|
342 | 286 |
movedTabIndex ~~ 1 ifTrue:[ |
287 |
self redrawTitleAtIndex:(movedTabIndex - 1). |
|
288 |
]. |
|
326 | 289 |
self redrawTabAtIndex:movedTabIndex. |
290 |
synchronousOperation == true ifTrue:[ |
|
291 |
self moveTabAtIndex:movedTabIndex toX:movedTabX |
|
292 |
] |
|
293 |
] |
|
294 |
] ifFalse:[ |
|
328 | 295 |
(self canMoveTabAtX:x) ifTrue:[ |
326 | 296 |
self cursor:handleCursor |
297 |
] ifFalse:[ |
|
298 |
self cursor:(Cursor normal) |
|
299 |
] |
|
300 |
] |
|
301 |
||
342 | 302 |
"Modified: 1.4.1997 / 15:21:16 / cg" |
326 | 303 |
! |
304 |
||
305 |
buttonPress:button x:x y:y |
|
306 |
"mouse-button was pressed; |
|
307 |
start moving the tab" |
|
308 |
||
328 | 309 |
movedTabIndex := nil. |
310 |
(self canMoveTabAtX:x) ifTrue:[ |
|
311 |
movedTabIndex := self indexOfTabAtX:x. |
|
326 | 312 |
self cursor:handleCursor. |
313 |
] |
|
314 |
||
328 | 315 |
"Modified: 28.3.1997 / 15:13:15 / cg" |
326 | 316 |
! |
317 |
||
318 |
buttonRelease:button x:x y:y |
|
319 |
"mouse-button was pressed; |
|
320 |
start moving the tab" |
|
321 |
||
322 |
|idx| |
|
323 |
||
324 |
idx := movedTabIndex. |
|
325 |
movedTabIndex := nil. |
|
328 | 326 |
idx notNil ifTrue:[ |
327 |
synchronousOperation == true ifFalse:[ |
|
328 |
self moveTabAtIndex:idx toX:movedTabX |
|
329 |
] |
|
326 | 330 |
] |
331 |
||
328 | 332 |
"Modified: 28.3.1997 / 15:10:23 / cg" |
326 | 333 |
! |
334 |
||
335 |
pointerLeave:state |
|
336 |
"mouse left view - restore cursor." |
|
337 |
||
338 |
self cursor:(Cursor normal). |
|
339 |
||
340 |
"Created: 28.3.1997 / 13:37:52 / cg" |
|
1445
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
341 |
! |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
342 |
|
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
343 |
update:something with:aParameter from:changedObject |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
344 |
changedObject == masterView ifTrue:[ |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
345 |
something == #originOfContents ifTrue:[ |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
346 |
self scrollTo:(masterView viewOrigin x @ 0). |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
347 |
]. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
348 |
]. |
326 | 349 |
! ! |
350 |
||
29 | 351 |
!TabSpecRuler methodsFor:'initialization'! |
352 |
||
353 |
initStyle |
|
354 |
super initStyle. |
|
355 |
||
326 | 356 |
handleStyle := DefaultHandleStyle. |
4997 | 357 |
handleCursor := (VariablePanel cursorForOrientation:#horizontal onDevice:device) onDevice:device. |
326 | 358 |
self is3D ifTrue:[ |
359 |
handleWidth := 2. |
|
360 |
] ifFalse:[ |
|
361 |
handleWidth := 1 |
|
362 |
] |
|
363 |
||
1157
7e64e555a971
pass device to #cursorForOrientation.
Claus Gittinger <cg@exept.de>
parents:
1120
diff
changeset
|
364 |
"Modified: / 30.9.1998 / 18:20:20 / cg" |
29 | 365 |
! |
366 |
||
367 |
initialize |
|
368 |
super initialize. |
|
369 |
||
328 | 370 |
tabsAreVariable := true. |
371 |
||
326 | 372 |
self enableMotionEvents. |
373 |
self enableEnterLeaveEvents. |
|
374 |
||
4517 | 375 |
self height:(gc font height + (2 * gc font descent)). |
29 | 376 |
|
377 |
" |
|
378 |
TabSpecRuler new open |
|
379 |
" |
|
326 | 380 |
|
328 | 381 |
"Modified: 28.3.1997 / 15:06:29 / cg" |
326 | 382 |
! ! |
383 |
||
384 |
!TabSpecRuler methodsFor:'private'! |
|
385 |
||
328 | 386 |
canMoveTabAtX:x |
387 |
|idx| |
|
388 |
||
389 |
tabsAreVariable ifTrue:[ |
|
390 |
(idx := self indexOfTabAtX:x) ~~ 0 ifTrue:[ |
|
391 |
(fixedTabs notNil and:[fixedTabs includes:idx]) ifFalse:[ |
|
392 |
^ true |
|
393 |
] |
|
394 |
] |
|
395 |
]. |
|
396 |
^ false |
|
397 |
||
398 |
"Created: 28.3.1997 / 15:12:05 / cg" |
|
399 |
"Modified: 28.3.1997 / 15:19:01 / cg" |
|
400 |
! |
|
401 |
||
402 |
indexOfTabAtX:x |
|
326 | 403 |
|xTab minDelta bestIndex| |
404 |
||
405 |
tabSpec isNil ifTrue:[^ 0]. |
|
406 |
bestIndex := 0. |
|
407 |
||
408 |
1 to:tabSpec size do:[:i | |
|
409 |
xTab := tabSpec positionOfTab:i on:self. |
|
410 |
(x between:(xTab-5) and:(xTab+5)) ifTrue:[ |
|
411 |
(minDelta isNil |
|
412 |
or:[(x - xTab) abs < minDelta]) ifTrue:[ |
|
413 |
minDelta := (x - xTab) abs. |
|
414 |
bestIndex := i. |
|
415 |
] |
|
416 |
] |
|
417 |
]. |
|
418 |
^ bestIndex |
|
419 |
||
420 |
"Modified: 28.3.1997 / 13:43:47 / cg" |
|
328 | 421 |
"Created: 28.3.1997 / 15:12:09 / cg" |
326 | 422 |
! |
423 |
||
424 |
moveTabAtIndex:idx toX:movedTabX |
|
328 | 425 |
|unitPosition| |
326 | 426 |
|
328 | 427 |
unitPosition := (tabSpec unitsPerPixelOn:self) * movedTabX. |
428 |
tabSpec moveTabAtIndex:idx to:unitPosition. |
|
429 |
||
430 |
"Modified: 28.3.1997 / 14:54:58 / cg" |
|
29 | 431 |
! ! |
432 |
||
1445
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
433 |
!TabSpecRuler methodsFor:'queries'! |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
434 |
|
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
435 |
widthOfContents |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
436 |
masterView notNil ifTrue:[^ masterView heightOfContents]. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
437 |
^ super heightOfContents. |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
438 |
|
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
439 |
! ! |
b272f318bdef
allow hooking me to a masterView.
Claus Gittinger <cg@exept.de>
parents:
1157
diff
changeset
|
440 |
|
200 | 441 |
!TabSpecRuler methodsFor:'redrawing'! |
442 |
||
443 |
drawHandleAtX:x type:handleType |
|
444 |
"redraw a tabulator handle" |
|
445 |
||
4517 | 446 |
self paint:self blackColor. |
326 | 447 |
self displayLineFromX:x y:0 toX:x y:height - 1. |
448 |
self is3D ifTrue:[ |
|
4517 | 449 |
self paint:self whiteColor. |
326 | 450 |
self displayLineFromX:x+1 y:0 toX:x+1 y:height - 1 |
451 |
] |
|
200 | 452 |
|
326 | 453 |
"Modified: 28.3.1997 / 14:35:48 / cg" |
454 |
! |
|
455 |
||
456 |
positionOfTabAtIndex:idx |
|
328 | 457 |
^ ( tabSpec positionOfTab:idx on:self ) rounded. |
326 | 458 |
|
459 |
"Created: 28.3.1997 / 14:26:28 / cg" |
|
328 | 460 |
"Modified: 28.3.1997 / 15:14:03 / cg" |
200 | 461 |
! |
29 | 462 |
|
200 | 463 |
redraw |
464 |
"redraw the handles from by tabSpec" |
|
465 |
||
326 | 466 |
tabSpec isNil ifTrue:[^ self]. |
467 |
shown ifFalse:[^ self]. |
|
468 |
||
2672 | 469 |
self clearView. |
326 | 470 |
1 to:tabSpec size do:[:idx | |
471 |
self redrawTabAtIndex:idx. |
|
472 |
] |
|
473 |
||
342 | 474 |
"Modified: 1.4.1997 / 15:13:16 / cg" |
326 | 475 |
! |
476 |
||
477 |
redrawTabAtIndex:idx |
|
478 |
"redraw a single handle" |
|
479 |
||
342 | 480 |
|x s| |
200 | 481 |
|
482 |
tabSpec isNil ifTrue:[^ self]. |
|
342 | 483 |
idx == movedTabIndex ifTrue:[ |
484 |
x := movedTabX |
|
485 |
] ifFalse:[ |
|
486 |
x := self positionOfTabAtIndex:idx. |
|
487 |
]. |
|
488 |
||
489 |
(hiddenTabs notNil and:[hiddenTabs includes:idx]) ifFalse:[ |
|
490 |
self drawHandleAtX:x type:(tabSpec typeOfTab:idx). |
|
491 |
]. |
|
492 |
||
493 |
titles notNil ifTrue:[ |
|
494 |
s := titles at:idx. |
|
5169 | 495 |
self paint:self blackColor. |
4517 | 496 |
s displayOn:self x:x+3 y:(gc font ascent). |
342 | 497 |
]. |
498 |
||
499 |
"Created: 28.3.1997 / 13:57:54 / cg" |
|
500 |
"Modified: 1.4.1997 / 15:29:19 / cg" |
|
501 |
! |
|
502 |
||
503 |
redrawTitleAtIndex:idx |
|
504 |
"redraw a single handle" |
|
505 |
||
506 |
|x s| |
|
507 |
||
508 |
tabSpec isNil ifTrue:[^ self]. |
|
509 |
titles isNil ifTrue:[^ self]. |
|
330 | 510 |
|
326 | 511 |
idx == movedTabIndex ifTrue:[ |
512 |
x := movedTabX |
|
513 |
] ifFalse:[ |
|
514 |
x := self positionOfTabAtIndex:idx. |
|
515 |
]. |
|
200 | 516 |
|
342 | 517 |
s := titles at:idx. |
5169 | 518 |
self paint:self blackColor. |
4517 | 519 |
s displayOn:self x:x+3 y:(gc font ascent). |
342 | 520 |
|
521 |
"Modified: 1.4.1997 / 15:20:31 / cg" |
|
29 | 522 |
! ! |
523 |
||
200 | 524 |
!TabSpecRuler class methodsFor:'documentation'! |
525 |
||
526 |
version |
|
4997 | 527 |
^ '$Header$' |
200 | 528 |
! ! |
4517 | 529 |