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