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