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