author | Claus Gittinger <cg@exept.de> |
Sat, 02 Apr 2016 17:06:23 +0200 | |
changeset 4988 | c7bdd5dff83e |
parent 2567 | f86f5d9bfc4e |
child 5412 | 0cf5d087ba0c |
permissions | -rw-r--r-- |
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 |
" |
|
4988 | 12 |
"{ Package: 'stx:libwidg2' }" |
343 | 13 |
|
4988 | 14 |
"{ NameSpace: Smalltalk }" |
1818 | 15 |
|
343 | 16 |
Object subclass:#TabWidget |
697 | 17 |
instanceVariableNames:'model tabView label disabledLabel printableLabel anchor extent |
18 |
lineNr fgColor labelType' |
|
343 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'Views-Interactors' |
|
22 |
! |
|
23 |
||
1818 | 24 |
TabWidget subclass:#Mac |
343 | 25 |
instanceVariableNames:'' |
26 |
classVariableNames:'' |
|
27 |
poolDictionaries:'' |
|
28 |
privateIn:TabWidget |
|
29 |
! |
|
30 |
||
1818 | 31 |
TabWidget subclass:#Window |
343 | 32 |
instanceVariableNames:'' |
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:TabWidget |
|
36 |
! |
|
37 |
||
38 |
!TabWidget class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
42 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
||
53 |
||
54 |
! |
|
55 |
||
56 |
documentation |
|
57 |
" |
|
58 |
instances represent (& draw) the tabs of a tabWidget. |
|
59 |
||
60 |
[author:] |
|
61 |
Claus Atzkern |
|
62 |
||
63 |
[see also:] |
|
64 |
TabView |
|
65 |
" |
|
66 |
! ! |
|
67 |
||
68 |
!TabWidget class methodsFor:'instance creation'! |
|
69 |
||
367 | 70 |
labels:aList for:aTabView |
71 |
"create tabs based on labels for a tabview |
|
343 | 72 |
" |
367 | 73 |
|list maxX maxY lftIns topIns level style| |
74 |
||
75 |
maxX := 0. |
|
76 |
maxY := 0. |
|
77 |
style := aTabView style. |
|
78 |
lftIns := style at:#labelLeftInset. |
|
1350 | 79 |
topIns := style at:#labelTopInset. |
367 | 80 |
level := style at:#tabLevel. |
81 |
||
409 | 82 |
aTabView device isNil ifTrue:[ |
2567 | 83 |
self error:'Tabview has no device' |
409 | 84 |
]. |
697 | 85 |
|
86 |
list := aList collect:[:anEntry||y x tab lbl| |
|
87 |
tab := self new label:anEntry for:aTabView. |
|
88 |
lbl := tab printableLabel. |
|
89 |
||
90 |
(y := lbl heightOn:aTabView) > maxY ifTrue:[maxY := y]. |
|
91 |
(x := lbl widthOn:aTabView) > maxX ifTrue:[maxX := x]. |
|
92 |
||
93 |
tab |
|
367 | 94 |
]. |
95 |
||
96 |
style at:#labelMaxX put:maxX. |
|
97 |
style at:#labelMaxY put:maxY. |
|
98 |
||
99 |
maxY := maxY + topIns |
|
100 |
+ (style at:#labelBottomInset) |
|
101 |
+ (2 * level). |
|
102 |
||
103 |
maxX := maxX + lftIns + (style at:#labelRightInset). |
|
104 |
||
105 |
style at:#maxX put:maxX. |
|
106 |
style at:#maxY put:maxY. |
|
107 |
style at:#labelAnchor put:( lftIns @ (topIns +level) ). |
|
108 |
||
109 |
self validateDimensions:style. |
|
369 | 110 |
maxY := style at:#maxY. |
111 |
maxX := style at:#maxX. |
|
112 |
||
113 |
"/ caused by vertical layout for images |
|
114 |
maxX < maxY ifTrue:[style at:#maxX put:maxY]. |
|
367 | 115 |
^ list |
1350 | 116 |
|
117 |
"Modified: / 4.5.1999 / 02:15:33 / cg" |
|
367 | 118 |
! |
119 |
||
120 |
validateDimensions:aStyle |
|
121 |
"validate dimensions for a style; could be redifined |
|
122 |
" |
|
343 | 123 |
! ! |
124 |
||
125 |
!TabWidget class methodsFor:'accessing'! |
|
126 |
||
419 | 127 |
computeColorsOn:aView style:aStyle |
128 |
"set colors dependent on selection color |
|
129 |
" |
|
4988 | 130 |
|viewsDevice unselectedColor selectedColor avgSelectedColor avgUnSelectedColor| |
1476 | 131 |
|
4988 | 132 |
viewsDevice := aView device. |
419 | 133 |
|
134 |
selectedColor := aView viewBackground. |
|
135 |
unselectedColor := selectedColor lightened. |
|
1335 | 136 |
avgSelectedColor := selectedColor averageColorIn:(0@0 corner:7@7). |
137 |
avgUnSelectedColor := unselectedColor averageColorIn:(0@0 corner:7@7). |
|
419 | 138 |
|
4988 | 139 |
aStyle at:#shadowColorSelected put:(avgSelectedColor darkened onDevice:viewsDevice). |
140 |
aStyle at:#lightColorSelected put:(avgSelectedColor lightened onDevice:viewsDevice). |
|
141 |
aStyle at:#shadowColorUnselected put:(avgUnSelectedColor darkened onDevice:viewsDevice). |
|
142 |
aStyle at:#lightColorUnselected put:(avgUnSelectedColor lightened onDevice:viewsDevice). |
|
419 | 143 |
|
144 |
aStyle at:#unselectedColor put:unselectedColor. |
|
145 |
aStyle at:#selectedColor put:selectedColor. |
|
146 |
aStyle at:#labelColor put:Color black. |
|
1350 | 147 |
|
148 |
"Modified: / 4.5.1999 / 02:16:32 / cg" |
|
419 | 149 |
! |
150 |
||
151 |
computeColorsOn:aView style:aStyle selectionColor:aSelectedColor |
|
152 |
"set colors dependent on selection color |
|
153 |
" |
|
4988 | 154 |
|viewsDevice unselectedColor selectedColor avgSelectedColor avgUnSelectedColor| |
1335 | 155 |
|
156 |
"/ CG: this seems to be no longer needed ... |
|
419 | 157 |
|
4988 | 158 |
viewsDevice := aView device. |
1476 | 159 |
|
419 | 160 |
unselectedColor := aView viewBackground. |
161 |
selectedColor := unselectedColor lightened. |
|
162 |
||
1335 | 163 |
avgSelectedColor := selectedColor averageColorIn:(0@0 corner:7@7). |
164 |
avgUnSelectedColor := unselectedColor averageColorIn:(0@0 corner:7@7). |
|
419 | 165 |
|
4988 | 166 |
aStyle at:#shadowColorSelected put:(avgSelectedColor darkened onDevice:viewsDevice). |
167 |
aStyle at:#lightColorSelected put:(avgSelectedColor lightened onDevice:viewsDevice). |
|
168 |
aStyle at:#shadowColorUnselected put:(avgUnSelectedColor darkened onDevice:viewsDevice). |
|
169 |
aStyle at:#lightColorUnselected put:(avgUnSelectedColor lightened onDevice:viewsDevice). |
|
419 | 170 |
|
171 |
aStyle at:#unselectedColor put:unselectedColor. |
|
172 |
aStyle at:#selectedColor put:selectedColor. |
|
173 |
aStyle at:#labelColor put:Color black. |
|
174 |
! |
|
175 |
||
343 | 176 |
tabStyleOn:aView |
177 |
"returns default tab style |
|
178 |
" |
|
419 | 179 |
|style| |
343 | 180 |
|
419 | 181 |
style := IdentityDictionary new. |
343 | 182 |
|
183 |
style at:#widget put:self. |
|
419 | 184 |
self computeColorsOn:aView style:style. |
343 | 185 |
|
367 | 186 |
style at:#expandSelection put:0@0. "/ expand selection extent x y when raised |
187 |
style at:#tabLevel put:0. "/ level |
|
1350 | 188 |
style at:#labelTopInset put:4. "/ additional top label inset |
351 | 189 |
style at:#labelBottomInset put:4. "/ additional bottom inset |
367 | 190 |
style at:#labelLeftInset put:4. "/ label left inset |
191 |
style at:#labelRightInset put:4. "/ label right inset |
|
192 |
style at:#rightCovered put:0. "/ covers right tab for n pixels |
|
343 | 193 |
|
194 |
^ style |
|
1350 | 195 |
|
196 |
"Modified: / 4.5.1999 / 02:15:50 / cg" |
|
343 | 197 |
! |
198 |
||
199 |
widgetClass:aWidget |
|
367 | 200 |
|wdgt name| |
343 | 201 |
|
367 | 202 |
name := aWidget asString. |
203 |
wdgt := Smalltalk classNamed:( self name asString, '::', name ). |
|
343 | 204 |
|
367 | 205 |
wdgt notNil ifTrue:[ |
206 |
^ wdgt |
|
343 | 207 |
]. |
367 | 208 |
^ Smalltalk classNamed:name |
343 | 209 |
! ! |
210 |
||
367 | 211 |
!TabWidget methodsFor:'accessing'! |
212 |
||
213 |
label |
|
214 |
^ label |
|
215 |
! |
|
216 |
||
217 |
lineNr |
|
218 |
"returns line number |
|
219 |
" |
|
220 |
^ lineNr |
|
221 |
! |
|
222 |
||
223 |
lineNr:aLineNr |
|
224 |
"change line number |
|
225 |
" |
|
226 |
lineNr := aLineNr |
|
697 | 227 |
! |
228 |
||
229 |
printableLabel |
|
230 |
||
231 |
|lbl dev| |
|
232 |
||
233 |
printableLabel notNil ifTrue:[ |
|
234 |
^ printableLabel |
|
235 |
]. |
|
236 |
||
237 |
model isNil ifTrue:[ |
|
238 |
lbl := label |
|
239 |
] ifFalse:[ |
|
240 |
lbl := model rawLabel |
|
241 |
]. |
|
242 |
||
243 |
dev := tabView device. |
|
244 |
||
245 |
lbl isImage ifTrue:[ |
|
246 |
labelType := #image. |
|
247 |
printableLabel := lbl onDevice:dev. |
|
248 |
disabledLabel := printableLabel lightened onDevice:dev. |
|
249 |
] ifFalse:[ |
|
250 |
labelType := #string. |
|
251 |
||
252 |
printableLabel := lbl ? ''. |
|
253 |
disabledLabel := printableLabel copy. |
|
254 |
||
255 |
lbl class == LabelAndIcon ifTrue:[ |
|
256 |
lbl := printableLabel icon onDevice:dev. |
|
257 |
printableLabel icon:lbl. |
|
258 |
disabledLabel icon:(lbl lightened onDevice:dev). |
|
259 |
] |
|
260 |
]. |
|
261 |
^ printableLabel |
|
367 | 262 |
! ! |
263 |
||
1818 | 264 |
!TabWidget methodsFor:'accessing-dimensions'! |
343 | 265 |
|
367 | 266 |
anchor |
267 |
"returns the tab origin |
|
268 |
" |
|
269 |
^ anchor |
|
270 |
||
271 |
! |
|
272 |
||
273 |
anchor:anAnchor |
|
274 |
"change the tab anchor; no redraw |
|
275 |
" |
|
276 |
anchor := anAnchor |
|
277 |
||
278 |
! |
|
279 |
||
280 |
anchor:anAnchor extent:anExtent |
|
281 |
"change anchor and extent; no redraw |
|
282 |
" |
|
283 |
anchor := anAnchor. |
|
284 |
extent := anExtent. |
|
343 | 285 |
|
286 |
||
287 |
! |
|
288 |
||
289 |
extent |
|
290 |
"return the tab extent |
|
291 |
" |
|
292 |
^ extent |
|
293 |
! |
|
294 |
||
295 |
extent:anExtent |
|
296 |
"change the tab extent; no redraw |
|
297 |
" |
|
298 |
extent := anExtent |
|
299 |
! |
|
300 |
||
367 | 301 |
preferredExtentX |
302 |
"returns my preferred extent x |
|
343 | 303 |
" |
367 | 304 |
^ (tabView styleAt:#maxX) |
305 |
- (tabView styleAt:#labelMaxX) |
|
697 | 306 |
+ (self printableLabel widthOn:tabView). |
350 | 307 |
! |
308 |
||
367 | 309 |
preferredExtentY |
310 |
"returns my preferred extent y |
|
343 | 311 |
" |
367 | 312 |
^ (tabView styleAt:#maxY) |
313 |
- (tabView styleAt:#labelMaxY) |
|
697 | 314 |
+ (self printableLabel heightOn:tabView). |
367 | 315 |
! ! |
343 | 316 |
|
367 | 317 |
!TabWidget methodsFor:'basic drawing'! |
343 | 318 |
|
367 | 319 |
redrawAtBottom:isSelected |
320 |
"redraw tab at bottom of view |
|
343 | 321 |
" |
367 | 322 |
^ self subclassResponsibility |
343 | 323 |
! |
324 |
||
367 | 325 |
redrawAtLeft:isSelected |
326 |
"redraw tab at left of view |
|
343 | 327 |
" |
367 | 328 |
^ self subclassResponsibility |
343 | 329 |
! |
330 |
||
367 | 331 |
redrawAtRight:isSelected |
332 |
"redraw tab at right of view |
|
343 | 333 |
" |
367 | 334 |
^ self subclassResponsibility |
335 |
! |
|
343 | 336 |
|
367 | 337 |
redrawAtTop:isSelected |
338 |
"redraw tab at top of view |
|
339 |
" |
|
340 |
^ self subclassResponsibility |
|
343 | 341 |
! ! |
342 |
||
697 | 343 |
!TabWidget methodsFor:'change & update'! |
344 |
||
345 |
labelChanged |
|
346 |
printableLabel := nil |
|
347 |
! ! |
|
348 |
||
343 | 349 |
!TabWidget methodsFor:'drawing'! |
350 |
||
369 | 351 |
redraw:isSelected |
352 |
"redraw tab |
|
353 |
" |
|
697 | 354 |
|direction| |
369 | 355 |
|
356 |
direction := tabView direction. |
|
357 |
||
697 | 358 |
direction == #top ifTrue:[ |
359 |
self redrawAtTop:isSelected |
|
369 | 360 |
] ifFalse:[ |
697 | 361 |
direction == #bottom ifTrue:[ |
362 |
self redrawAtBottom:isSelected |
|
369 | 363 |
] ifFalse:[ |
697 | 364 |
direction == #right ifTrue:[ self redrawAtRight:isSelected ] |
365 |
ifFalse:[ self redrawAtLeft:isSelected ] |
|
366 |
] |
|
369 | 367 |
]. |
697 | 368 |
self redrawLabel |
392 | 369 |
! |
370 |
||
419 | 371 |
redrawLabel |
372 |
"redraw label only |
|
373 |
" |
|
703 | 374 |
|fg direction origin originX originY anchor anchorX anchorY x y label| |
419 | 375 |
|
697 | 376 |
label := self printableLabel. |
419 | 377 |
direction := tabView direction. |
378 |
anchor := tabView styleAt:#labelAnchor. |
|
703 | 379 |
anchorX := anchor x. |
380 |
anchorY := anchor y. |
|
419 | 381 |
origin := self computeOrigin. |
703 | 382 |
originX := origin x. |
383 |
originY := origin y. |
|
419 | 384 |
|
697 | 385 |
"/ set label color |
386 |
||
387 |
self printableLabel. |
|
388 |
||
389 |
self isEnabled ifTrue:[ |
|
390 |
label := printableLabel. |
|
391 |
(model notNil and:[(fg := model foregroundColor) notNil]) ifTrue:[ |
|
392 |
fgColor = fg ifFalse:[ |
|
1476 | 393 |
fgColor := fg onDevice:(tabView device) |
697 | 394 |
]. |
395 |
tabView paint:fgColor |
|
396 |
] ifFalse:[ |
|
397 |
tabView paintColor:#labelColor |
|
398 |
] |
|
399 |
] ifFalse:[ |
|
400 |
label := disabledLabel. |
|
401 |
tabView paintColor:#shadowColorUnselected. |
|
402 |
]. |
|
419 | 403 |
|
404 |
(direction == #top or:[direction == #bottom]) ifTrue:[ |
|
703 | 405 |
y := originY. |
406 |
x := originX + anchorX. |
|
419 | 407 |
|
408 |
direction == #top ifTrue:[ |
|
703 | 409 |
y := y + anchorY. |
419 | 410 |
] ifFalse:[ |
703 | 411 |
y := y - anchorY - (label heightOn:tabView). |
419 | 412 |
]. |
697 | 413 |
labelType == #string ifTrue:[ |
414 |
y := y + tabView fontAscent |
|
415 |
]. |
|
419 | 416 |
] ifFalse:[ |
417 |
direction == #right ifTrue:[ |
|
703 | 418 |
x := originX - anchorY - (label heightOn:tabView). |
419 | 419 |
] ifFalse:[ |
703 | 420 |
x := originX + anchorY. |
419 | 421 |
]. |
703 | 422 |
y := originY + anchorX. |
419 | 423 |
|
697 | 424 |
labelType == #string ifTrue:[ |
425 |
x := x + tabView fontDescent. |
|
703 | 426 |
"/ workaround for a bug in display-with-angle, |
427 |
"/ iff displayed string is a labelAndIcon. |
|
428 |
"/ (In this case, display is always opaque, and the current |
|
429 |
"/ backgroundPaint color is used to fill the underlying rectangle) |
|
430 |
"/ |
|
431 |
tabView backgroundPaint:(tabView getBackgroundPaintForTab:self). |
|
419 | 432 |
tabView displayString:label x:x y:y angle:90. |
433 |
^ self. |
|
434 |
]. |
|
435 |
]. |
|
436 |
label displayOn:tabView x:x y:y. |
|
369 | 437 |
! ! |
438 |
||
439 |
!TabWidget methodsFor:'initialization'! |
|
440 |
||
441 |
label:aLabel for:aTabView |
|
442 |
"initialize attributes |
|
443 |
" |
|
444 |
tabView := aTabView. |
|
445 |
label := aLabel. |
|
697 | 446 |
model := (label isKindOf:TabItem) ifTrue:[label] ifFalse:[nil] |
447 |
||
369 | 448 |
! ! |
449 |
||
450 |
!TabWidget methodsFor:'private'! |
|
451 |
||
367 | 452 |
computeCorner |
2567 | 453 |
"compute corner" |
454 |
||
367 | 455 |
|d c| |
456 |
||
457 |
c := anchor + extent. |
|
458 |
d := tabView direction. |
|
459 |
||
460 |
d == #top ifTrue:[^ ( c x @ (tabView extent y) )]. |
|
461 |
d == #left ifTrue:[^ ( (tabView extent x) @ c y ) ]. |
|
462 |
d == #right ifTrue:[^ ( 0 @ c y )]. |
|
463 |
d == #bottom ifTrue:[^ ( c x @ 0 )]. |
|
464 |
||
2567 | 465 |
self error:'unknown direction'. |
367 | 466 |
! |
467 |
||
468 |
computeOrigin |
|
2567 | 469 |
"compute origin" |
470 |
||
367 | 471 |
|d| |
472 |
||
473 |
d := tabView direction. |
|
474 |
||
475 |
d == #top ifTrue:[ ^ anchor x @ ((tabView extent y) - anchor y) ]. |
|
476 |
d == #left ifTrue:[ ^ ((tabView extent x) - anchor x) @ anchor y ]. |
|
477 |
d == #right ifTrue:[ ^ anchor ]. |
|
478 |
d == #bottom ifTrue:[ ^ anchor ]. |
|
479 |
||
2567 | 480 |
self error:'unknown direction'. |
343 | 481 |
! ! |
482 |
||
483 |
!TabWidget methodsFor:'queries'! |
|
484 |
||
485 |
containsPoint:aPoint |
|
367 | 486 |
"return true, if a point is contained in the tab |
343 | 487 |
" |
1220 | 488 |
|d origin |
489 |
originX "{ Class: SmallInteger }" |
|
490 |
originY "{ Class: SmallInteger }" |
|
491 |
w "{ Class: SmallInteger }" |
|
492 |
h "{ Class: SmallInteger }" |
|
493 |
x "{ Class: SmallInteger }" |
|
494 |
y "{ Class: SmallInteger }"| |
|
343 | 495 |
|
367 | 496 |
d := tabView direction. |
343 | 497 |
x := aPoint x. |
367 | 498 |
y := aPoint y. |
343 | 499 |
|
367 | 500 |
origin := self computeOrigin. |
1220 | 501 |
originX := origin x. |
502 |
originY := origin y. |
|
503 |
w := extent x. |
|
504 |
h := extent y. |
|
367 | 505 |
|
506 |
(d == #top or:[d == #bottom]) ifTrue:[ |
|
1220 | 507 |
((x >= originX) and:[x <= (originX + w)]) ifTrue:[ |
367 | 508 |
d == #top ifTrue:[ |
1220 | 509 |
^ ((y >= originY) and:[y <= (originY + h)]) |
367 | 510 |
]. |
1220 | 511 |
^ ((y <= originY) and:[y >= (originY - h)]) |
367 | 512 |
] |
513 |
] ifFalse:[ |
|
1220 | 514 |
((y >= originY) and:[y <= (originY + h)]) ifTrue:[ |
367 | 515 |
d == #right ifTrue:[ |
1220 | 516 |
^ ((x <= originX) and:[x >= (originX - w)]) |
367 | 517 |
]. |
1220 | 518 |
^ ((x >= originX) and:[x <= (originX + w)]) |
367 | 519 |
] |
343 | 520 |
]. |
367 | 521 |
^ false |
549 | 522 |
! |
523 |
||
524 |
intersects:aRectangle |
|
525 |
"return true, if the intersection between the tab widget and |
|
526 |
the argument, aRectangle is not empty |
|
527 |
" |
|
551 | 528 |
|origin corner direction irect| |
549 | 529 |
|
530 |
origin := self computeOrigin. |
|
531 |
corner := self computeCorner. |
|
532 |
||
533 |
direction := tabView direction. |
|
534 |
||
535 |
direction == #top ifTrue:[ |
|
551 | 536 |
irect := (Rectangle origin:origin corner:corner) |
537 |
] ifFalse:[ |
|
538 |
direction == #bottom ifTrue:[ |
|
539 |
irect := (Rectangle origin:(origin x @ corner y) corner:(corner x @ origin y)) |
|
540 |
] ifFalse:[ |
|
541 |
direction == #right ifTrue:[ |
|
542 |
irect := (Rectangle origin:(corner x @ origin y) corner:(origin x @ corner y)) |
|
543 |
] ifFalse:[ |
|
544 |
irect := (Rectangle origin:origin corner:corner) |
|
545 |
] |
|
546 |
] |
|
549 | 547 |
]. |
548 |
||
551 | 549 |
^ aRectangle intersects:irect |
697 | 550 |
! |
551 |
||
552 |
isEnabled |
|
553 |
||
554 |
^ (tabView isEnabled and:[(model isNil or:[model isEnabled])]) |
|
555 |
||
556 |
! |
|
557 |
||
558 |
model |
|
559 |
^ model |
|
560 |
||
549 | 561 |
! ! |
562 |
||
1818 | 563 |
!TabWidget::Mac class methodsFor:'accessing'! |
564 |
||
565 |
tabStyleOn:aView |
|
566 |
|style| |
|
567 |
||
568 |
style := super tabStyleOn:aView. |
|
569 |
style at:#tabLevel put:2. |
|
570 |
^ style. |
|
571 |
! ! |
|
572 |
||
573 |
!TabWidget::Mac class methodsFor:'calculate dimensions'! |
|
574 |
||
575 |
validateDimensions:aStyle |
|
576 |
"validate dimensions for a style; could be redifined |
|
577 |
" |
|
578 |
|maxY maxX anchor lftIns| |
|
579 |
||
580 |
maxY := aStyle at:#maxY. |
|
581 |
maxX := (aStyle at:#maxX) - (aStyle at:#labelLeftInset). |
|
582 |
anchor := aStyle at:#labelAnchor. |
|
583 |
lftIns := maxY // 2. |
|
584 |
||
585 |
anchor x:lftIns. |
|
586 |
||
587 |
aStyle at:#maxX put:(maxX + lftIns + maxY). |
|
588 |
aStyle at:#rightCovered put:(maxY // 2). |
|
589 |
! ! |
|
590 |
||
591 |
!TabWidget::Mac methodsFor:'drawing'! |
|
592 |
||
593 |
redrawAtBottom:isSelected |
|
594 |
"redraw tab at bottom of view |
|
595 |
" |
|
596 |
|origin corner level polygon x y x1 eX eY shadowColor lightColor| |
|
597 |
||
598 |
isSelected ifFalse:[ |
|
599 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
600 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
601 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
602 |
] ifTrue:[ |
|
603 |
lightColor := tabView styleAt:#lightColorSelected. |
|
604 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
605 |
tabView paint:(tabView styleAt:#selectedColor). |
|
606 |
]. |
|
607 |
polygon := Array new:5. |
|
608 |
origin := self computeOrigin. |
|
609 |
corner := self computeCorner. |
|
610 |
level := tabView styleAt:#tabLevel. |
|
611 |
||
612 |
x := origin x. |
|
613 |
y := origin y. |
|
614 |
eX := corner x. |
|
615 |
eY := corner y. |
|
616 |
x1 := eX - (tabView styleAt:#maxY). |
|
617 |
||
618 |
polygon at:1 put:(Point x:x y:eY). |
|
619 |
polygon at:2 put:(Point x:x y:y). |
|
620 |
polygon at:3 put:(Point x:x1 y:y). |
|
621 |
polygon at:4 put:(Point x:eX y:(y-extent y)). |
|
622 |
polygon at:5 put:(Point x:eX y:eY). |
|
623 |
||
624 |
tabView fillPolygon:polygon. |
|
625 |
tabView paint:lightColor. |
|
626 |
||
627 |
1 to:level do:[:i| |
|
628 |
"/ removed: cg |
|
629 |
"/ tabView displayLineFromX:x+1 y:y-i toX:x1+i y:y-i. |
|
630 |
tabView displayLineFromX:x+i y:y-1 toX:x+i y:1. |
|
631 |
]. |
|
632 |
tabView paint:shadowColor. |
|
633 |
||
634 |
"/ added: cg |
|
635 |
1 to:(level-2) do:[:i| |
|
636 |
tabView displayLineFromX:x+1 y:y-i toX:x1+i y:y-i. |
|
637 |
]. |
|
638 |
tabView displayPolygon:polygon. |
|
639 |
||
640 |
isSelected ifFalse:[ |
|
641 |
tabView displayLineFromX:x y:eY toX:eX y:eY. |
|
642 |
] |
|
643 |
||
644 |
"Modified: / 21.5.1998 / 01:16:32 / cg" |
|
645 |
! |
|
646 |
||
647 |
redrawAtLeft:isSelected |
|
648 |
"redraw tab at left of view |
|
649 |
" |
|
650 |
|origin corner polygon level x y y1 eX eY shadowColor lightColor| |
|
651 |
||
652 |
isSelected ifFalse:[ |
|
653 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
654 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
655 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
656 |
] ifTrue:[ |
|
657 |
lightColor := tabView styleAt:#lightColorSelected. |
|
658 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
659 |
tabView paint:(tabView styleAt:#selectedColor). |
|
660 |
]. |
|
661 |
polygon := Array new:5. |
|
662 |
origin := self computeOrigin. |
|
663 |
corner := self computeCorner. |
|
664 |
level := tabView styleAt:#tabLevel. |
|
665 |
||
666 |
x := origin x. |
|
667 |
y := origin y. |
|
668 |
eX := corner x. |
|
669 |
eY := corner y. |
|
670 |
y1 := eY - (tabView styleAt:#maxY). |
|
671 |
||
672 |
polygon at:1 put:(Point x:eX y:y). |
|
673 |
polygon at:2 put:(Point x:x y:y). |
|
674 |
polygon at:3 put:(Point x:x y:y1). |
|
675 |
polygon at:4 put:(Point x:(x+extent x) y:eY). |
|
676 |
polygon at:5 put:(Point x:eX y:eY). |
|
677 |
||
678 |
tabView fillPolygon:polygon. |
|
679 |
tabView paint:lightColor. |
|
680 |
||
681 |
1 to:level do:[:i| |
|
682 |
tabView displayLineFromX:eX y:y+i toX:x+2 y:y+i. |
|
683 |
tabView displayLineFromX:x+i y:y+1 toX:x+i y:y1+i. |
|
684 |
]. |
|
685 |
tabView paint:shadowColor. |
|
686 |
tabView displayPolygon:polygon. |
|
687 |
||
688 |
isSelected ifFalse:[ |
|
689 |
tabView displayLineFromX:eX-1 y:y toX:eX-1 y:eY. |
|
690 |
] |
|
691 |
! |
|
692 |
||
693 |
redrawAtRight:isSelected |
|
694 |
"redraw tab at right of view |
|
695 |
" |
|
696 |
|origin corner level polygon x y y1 eY shadowColor lightColor| |
|
697 |
||
698 |
isSelected ifFalse:[ |
|
699 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
700 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
701 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
702 |
] ifTrue:[ |
|
703 |
lightColor := tabView styleAt:#lightColorSelected. |
|
704 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
705 |
tabView paint:(tabView styleAt:#selectedColor). |
|
706 |
]. |
|
707 |
polygon := Array new:5. |
|
708 |
origin := self computeOrigin. |
|
709 |
corner := self computeCorner. |
|
710 |
level := tabView styleAt:#tabLevel. |
|
711 |
||
712 |
x := origin x. |
|
713 |
y := origin y. |
|
714 |
eY := corner y. |
|
715 |
y1 := eY - (tabView styleAt:#maxY). |
|
716 |
||
717 |
polygon at:1 put:(Point x:0 y:y). |
|
718 |
polygon at:2 put:(Point x:x y:y). |
|
719 |
polygon at:3 put:(Point x:x y:y1). |
|
720 |
polygon at:4 put:(Point x:(x-extent x) y:eY). |
|
721 |
polygon at:5 put:(Point x:0 y:eY). |
|
722 |
||
723 |
tabView fillPolygon:polygon. |
|
724 |
tabView paint:lightColor. |
|
725 |
||
726 |
1 to:level do:[:i| |
|
727 |
tabView displayLineFromX:0 y:y+i toX:x-1 y:y+i. |
|
728 |
"/ removed: cg |
|
729 |
"/ tabView displayLineFromX:x-i y:y+1 toX:x-i y:y1+i. |
|
730 |
]. |
|
731 |
tabView paint:shadowColor. |
|
732 |
tabView displayPolygon:polygon. |
|
733 |
||
734 |
"/ added: cg |
|
735 |
1 to:level-2 do:[:i| |
|
736 |
tabView displayLineFromX:x-i y:y+1 toX:x-i y:y1+i. |
|
737 |
]. |
|
738 |
||
739 |
isSelected ifFalse:[ |
|
740 |
tabView displayLineFromX:0 y:y toX:0 y:eY. |
|
741 |
] |
|
742 |
||
743 |
"Modified: / 21.5.1998 / 01:16:24 / cg" |
|
744 |
! |
|
745 |
||
746 |
redrawAtTop:isSelected |
|
747 |
"redraw tab at top of view |
|
748 |
" |
|
749 |
|origin corner level polygon x y x1 eX eY shadowColor lightColor| |
|
750 |
||
751 |
isSelected ifFalse:[ |
|
752 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
753 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
754 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
755 |
] ifTrue:[ |
|
756 |
lightColor := tabView styleAt:#lightColorSelected. |
|
757 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
758 |
tabView paint:(tabView styleAt:#selectedColor). |
|
759 |
]. |
|
760 |
polygon := Array new:5. |
|
761 |
origin := self computeOrigin. |
|
762 |
corner := self computeCorner. |
|
763 |
level := tabView styleAt:#tabLevel. |
|
764 |
||
765 |
x := origin x. |
|
766 |
y := origin y. |
|
767 |
eX := corner x - 1. |
|
768 |
eY := corner y. |
|
769 |
x1 := eX - (tabView styleAt:#maxY). |
|
770 |
||
771 |
polygon at:1 put:(Point x:x y:eY). |
|
772 |
polygon at:2 put:(Point x:x y:y). |
|
773 |
polygon at:3 put:(Point x:x1 y:y). |
|
774 |
polygon at:4 put:(Point x:eX y:(y+extent y)). |
|
775 |
polygon at:5 put:(Point x:eX y:eY). |
|
776 |
||
777 |
tabView fillPolygon:polygon. |
|
778 |
tabView paint:lightColor. |
|
779 |
||
780 |
1 to:level do:[:i| |
|
781 |
tabView displayLineFromX:x+i y:eY toX:x+i y:y+1. |
|
782 |
tabView displayLineFromX:x+1 y:y+i toX:x1+i y:y+i. |
|
783 |
]. |
|
784 |
tabView paint:shadowColor. |
|
785 |
tabView displayPolygon:polygon. |
|
786 |
||
787 |
isSelected ifFalse:[ |
|
788 |
tabView displayLineFromX:x y:eY-1 toX:eX y:eY-1. |
|
789 |
] |
|
790 |
||
791 |
||
792 |
! ! |
|
793 |
||
367 | 794 |
!TabWidget::Window class methodsFor:'accessing'! |
350 | 795 |
|
796 |
tabStyleOn:aView |
|
474 | 797 |
|style| |
350 | 798 |
|
799 |
style := super tabStyleOn:aView. |
|
800 |
||
367 | 801 |
style at:#expandSelection put:4@4. |
802 |
style at:#tabLevel put:2. |
|
1381 | 803 |
style at:#labelTopInset put:0. |
804 |
style at:#labelBottomInset put:0. |
|
367 | 805 |
style at:#roundedEdges put:true. |
806 |
^ style |
|
350 | 807 |
|
1381 | 808 |
"Modified: / 20.5.1999 / 19:18:04 / cg" |
350 | 809 |
! ! |
810 |
||
367 | 811 |
!TabWidget::Window class methodsFor:'calculate dimensions'! |
812 |
||
813 |
validateDimensions:aStyle |
|
814 |
"validate dimensions for a style; could be redifined |
|
815 |
" |
|
816 |
|maxY anchor| |
|
350 | 817 |
|
367 | 818 |
(aStyle at:#roundedEdges) ifTrue:[ |
819 |
maxY := aStyle at:#maxY. |
|
820 |
aStyle at:#maxY put:(maxY + 3). |
|
821 |
anchor := aStyle at:#labelAnchor. |
|
822 |
anchor y:(anchor y + 1). |
|
823 |
aStyle at:#labelAnchor put:anchor. |
|
824 |
] |
|
825 |
||
826 |
||
827 |
||
350 | 828 |
|
829 |
||
830 |
! ! |
|
831 |
||
367 | 832 |
!TabWidget::Window methodsFor:'drawing'! |
833 |
||
834 |
redrawAtBottom:isSelected |
|
835 |
"redraw tab at bottom of view |
|
836 |
" |
|
474 | 837 |
|origin corner y x xR yB tabLevel roundedEdges shadowColor lightColor| |
367 | 838 |
|
839 |
origin := self computeOrigin. |
|
840 |
corner := self computeCorner. |
|
841 |
x := origin x. |
|
842 |
y := origin y. |
|
843 |
xR := corner x - 1. |
|
844 |
yB := 0. |
|
845 |
||
846 |
roundedEdges := tabView styleAt:#roundedEdges. |
|
847 |
tabLevel := (tabView styleAt:#tabLevel) - 1. |
|
848 |
||
849 |
isSelected ifFalse:[ |
|
850 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
851 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
852 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
853 |
] ifTrue:[ |
|
854 |
tabView paint:(tabView styleAt:#selectedColor). |
|
855 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
856 |
lightColor := tabView styleAt:#lightColorSelected. |
|
857 |
]. |
|
858 |
||
859 |
roundedEdges ifTrue:[y := y - 2]. |
|
860 |
tabView fillRectangle:(Rectangle left:x top:yB extent:(extent x @ y)). |
|
350 | 861 |
|
367 | 862 |
roundedEdges ifTrue:[ |
863 |
tabView displayLineFromX:x-1 y:y toX:xR y:y. |
|
864 |
y := y - 1. |
|
865 |
||
866 |
tabView paint:lightColor. |
|
867 |
tabView displayPointX:x y:y+1. |
|
868 |
tabView displayPointX:x+1 y:y+1. |
|
894
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
869 |
|
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
870 |
tabView paint:shadowColor. |
367 | 871 |
tabView displayLineFromX:x+1 y:y+2 toX:xR-1 y:y+2. |
872 |
tabView displayLineFromX:x+2 y:y+3 toX:xR-2 y:y+3. |
|
873 |
||
874 |
0 to:tabLevel do:[:i | |
|
875 |
tabView displayPointX:xR-i y:y. |
|
876 |
tabView displayPointX:xR-i y:y+1. |
|
877 |
tabView displayPointX:xR-1-i y:y+2. |
|
878 |
]. |
|
879 |
tabView displayPointX:xR-2 y:y+3. |
|
880 |
tabView displayPointX:xR-3 y:y+3. |
|
881 |
]. |
|
882 |
||
883 |
tabView paint:lightColor. |
|
884 |
||
885 |
0 to:tabLevel do:[:i | |
|
886 |
roundedEdges ifFalse:[ |
|
887 |
tabView displayLineFromX:x y:y-i toX:xR y:y-i "/ upper edge |
|
888 |
]. |
|
889 |
tabView displayLineFromX:x+i y:y+1 toX:x+i y:yB. "/ left edge |
|
890 |
]. |
|
891 |
y := y + 1. |
|
892 |
tabView paint:shadowColor. |
|
893 |
||
894 |
0 to:tabLevel do:[:i | |
|
895 |
tabView displayLineFromX:xR-i y:y-i toX:xR-i y:yB. "/ right edge |
|
896 |
]. |
|
350 | 897 |
|
894
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
898 |
"Modified: / 21.5.1998 / 01:07:01 / cg" |
350 | 899 |
! |
900 |
||
367 | 901 |
redrawAtLeft:isSelected |
902 |
"redraw tab at left of view |
|
350 | 903 |
" |
474 | 904 |
|origin corner y x xR yB tabLevel roundedEdges shadowColor lightColor| |
367 | 905 |
|
906 |
origin := self computeOrigin. |
|
907 |
corner := self computeCorner. |
|
908 |
x := origin x. |
|
909 |
y := origin y. |
|
910 |
xR := corner x. |
|
911 |
yB := corner y. |
|
912 |
||
913 |
roundedEdges := tabView styleAt:#roundedEdges. |
|
914 |
tabLevel := (tabView styleAt:#tabLevel) - 1. |
|
915 |
||
916 |
isSelected ifFalse:[ |
|
917 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
918 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
919 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
920 |
] ifTrue:[ |
|
921 |
tabView paint:(tabView styleAt:#selectedColor). |
|
922 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
923 |
lightColor := tabView styleAt:#lightColorSelected. |
|
924 |
]. |
|
925 |
tabView fillRectangle:(Rectangle left:x top:y extent:(xR @ extent y)). |
|
926 |
||
927 |
roundedEdges ifTrue:[ |
|
928 |
tabView displayLineFromX:x y:y toX:x y:yB. |
|
929 |
||
930 |
tabView paint:lightColor. |
|
931 |
tabView displayPointX:x y:y+1. |
|
932 |
tabView displayPointX:x y:y+2. |
|
933 |
tabView displayLineFromX:x-1 y:y+2 toX:x-1 y:yB-1. |
|
934 |
tabView displayLineFromX:x-2 y:y+3 toX:x-2 y:yB-1. |
|
935 |
||
936 |
tabView paint:shadowColor. |
|
350 | 937 |
|
367 | 938 |
0 to:tabLevel do:[:i | |
939 |
tabView displayPointX:x y:yB-i. |
|
940 |
tabView displayPointX:x-1 y:yB-i-1. |
|
941 |
tabView displayPointX:x-2 y:yB-i-2. |
|
942 |
]. |
|
943 |
]. |
|
944 |
tabView paint:lightColor. |
|
945 |
||
946 |
0 to:tabLevel do:[:i | |
|
947 |
roundedEdges ifFalse:[ |
|
948 |
tabView displayLineFromX:x+i y:y+i toX:x+i y:yB. "/ upper edge |
|
949 |
]. |
|
950 |
tabView displayLineFromX:x y:y+i toX:xR y:y+i. "/ left edge |
|
951 |
]. |
|
952 |
tabView paint:shadowColor. |
|
350 | 953 |
|
367 | 954 |
0 to:tabLevel do:[:i | |
955 |
tabView displayLineFromX:x+i y:yB-i toX:xR y:yB-i. |
|
956 |
]. |
|
957 |
||
958 |
! |
|
959 |
||
960 |
redrawAtRight:isSelected |
|
961 |
"redraw tab at right of view |
|
962 |
" |
|
474 | 963 |
|origin corner y x xR yB tabLevel roundedEdges shadowColor lightColor| |
367 | 964 |
|
965 |
origin := self computeOrigin. |
|
966 |
corner := self computeCorner. |
|
967 |
x := origin x. |
|
968 |
y := origin y. |
|
969 |
xR := corner x - 1. |
|
970 |
yB := corner y. |
|
971 |
||
972 |
roundedEdges := tabView styleAt:#roundedEdges. |
|
973 |
tabLevel := (tabView styleAt:#tabLevel) - 1. |
|
350 | 974 |
|
975 |
isSelected ifFalse:[ |
|
367 | 976 |
tabView paint:(tabView styleAt:#unselectedColor). |
350 | 977 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
367 | 978 |
lightColor := tabView styleAt:#lightColorUnselected. |
350 | 979 |
] ifTrue:[ |
367 | 980 |
tabView paint:(tabView styleAt:#selectedColor). |
350 | 981 |
shadowColor := tabView styleAt:#shadowColorSelected. |
367 | 982 |
lightColor := tabView styleAt:#lightColorSelected. |
350 | 983 |
]. |
367 | 984 |
tabView fillRectangle:(Rectangle left:0 top:y extent:(x @ extent y)). |
985 |
||
986 |
roundedEdges ifTrue:[ |
|
987 |
tabView displayLineFromX:x y:y toX:x y:yB. |
|
350 | 988 |
|
367 | 989 |
tabView paint:lightColor. |
990 |
tabView displayPointX:x y:y+1. |
|
991 |
tabView displayPointX:x y:y+2. |
|
894
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
992 |
|
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
993 |
tabView paint:shadowColor. |
367 | 994 |
tabView displayLineFromX:x+1 y:y+2 toX:x+1 y:yB-1. |
995 |
tabView displayLineFromX:x+2 y:y+3 toX:x+2 y:yB-1. |
|
996 |
||
997 |
0 to:tabLevel do:[:i | |
|
998 |
tabView displayPointX:x y:yB-i. |
|
999 |
tabView displayPointX:x+1 y:yB-i-1. |
|
1000 |
tabView displayPointX:x+2 y:yB-i-2. |
|
1001 |
]. |
|
1002 |
]. |
|
350 | 1003 |
tabView paint:lightColor. |
1004 |
||
367 | 1005 |
0 to:tabLevel do:[:i | |
1006 |
roundedEdges ifFalse:[ |
|
1007 |
tabView displayLineFromX:x-i y:y+i toX:x-i y:yB. "/ upper edge |
|
1008 |
]. |
|
1009 |
tabView displayLineFromX:x y:y+i+1 toX:0 y:y+i+1. "/ left edge |
|
1010 |
]. |
|
1011 |
tabView paint:shadowColor. |
|
1012 |
||
1013 |
0 to:tabLevel do:[:i | |
|
1014 |
tabView displayLineFromX:x-i+1 y:yB-i toX:1 y:yB-i. |
|
1015 |
]. |
|
894
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1016 |
|
d5a703c21f7a
fixed shadow/light colors in tab-drawing
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1017 |
"Modified: / 21.5.1998 / 01:04:41 / cg" |
367 | 1018 |
! |
1019 |
||
1020 |
redrawAtTop:isSelected |
|
1021 |
"redraw tab at top of view |
|
1022 |
" |
|
474 | 1023 |
|origin corner y x xR yB tabLevel roundedEdges shadowColor lightColor| |
367 | 1024 |
|
1025 |
origin := self computeOrigin. |
|
1026 |
corner := self computeCorner. |
|
1027 |
x := origin x. |
|
1028 |
y := origin y. |
|
1029 |
xR := corner x - 1. |
|
1030 |
yB := corner y. |
|
1031 |
||
1032 |
roundedEdges := tabView styleAt:#roundedEdges. |
|
1033 |
tabLevel := (tabView styleAt:#tabLevel) - 1. |
|
1034 |
||
1035 |
isSelected ifFalse:[ |
|
1036 |
tabView paint:(tabView styleAt:#unselectedColor). |
|
1037 |
shadowColor := tabView styleAt:#shadowColorUnselected. |
|
1038 |
lightColor := tabView styleAt:#lightColorUnselected. |
|
1039 |
] ifTrue:[ |
|
1040 |
tabView paint:(tabView styleAt:#selectedColor). |
|
1041 |
shadowColor := tabView styleAt:#shadowColorSelected. |
|
1042 |
lightColor := tabView styleAt:#lightColorSelected. |
|
350 | 1043 |
]. |
1044 |
||
367 | 1045 |
roundedEdges ifTrue:[ y := y + 2]. |
1046 |
tabView fillRectangle:(Rectangle left:x top:y extent:((extent x) @ yB)). |
|
1047 |
||
1048 |
roundedEdges ifTrue:[ |
|
1049 |
y := y + 1. |
|
1050 |
tabView displayLineFromX:x y:y-1 toX:xR y:y-1. |
|
1051 |
tabView displayLineFromX:x+1 y:y-2 toX:xR-1 y:y-2. |
|
1052 |
tabView displayLineFromX:x+2 y:y-3 toX:xR-2 y:y-3. |
|
1053 |
||
1054 |
tabView paint:lightColor. |
|
1055 |
||
1056 |
0 to:tabLevel do:[:i | |
|
1057 |
tabView displayPointX:x+i y:y-1. |
|
1058 |
tabView displayPointX:x+1+i y:y-1-1. |
|
1059 |
tabView displayLineFromX:x+2+i y:y-3-i toX:xR-1-i y:y-3-i. "/ top |
|
1060 |
]. |
|
1061 |
||
1062 |
tabView paint:shadowColor. |
|
1063 |
0 to:tabLevel do:[:i | |
|
1064 |
tabView displayPointX:xR-i y:y. |
|
1065 |
tabView displayPointX:xR-i y:y-1. |
|
1066 |
tabView displayPointX:xR-1-i y:y-1-1. |
|
1067 |
]. |
|
1068 |
tabView displayPointX:xR-2 y:y-1-1-1. |
|
1069 |
tabView displayPointX:xR-3 y:y-1-1-1. |
|
350 | 1070 |
]. |
1071 |
||
367 | 1072 |
tabView paint:lightColor. |
1073 |
0 to:tabLevel do:[:i | |
|
1074 |
roundedEdges ifFalse:[ |
|
1075 |
tabView displayLineFromX:x y:y+i toX:xR y:y+i. "/ upper edge |
|
1076 |
]. |
|
1077 |
tabView displayLineFromX:x+i y:y toX:x+i y:yB. "/ left edge |
|
1078 |
]. |
|
1079 |
tabView paint:shadowColor. |
|
1080 |
0 to:tabLevel do:[:i | |
|
1081 |
tabView displayLineFromX:xR-i y:y+i toX:xR-i y:yB. "/ right edge |
|
1082 |
]. |
|
350 | 1083 |
! ! |
1084 |
||
343 | 1085 |
!TabWidget class methodsFor:'documentation'! |
1086 |
||
1087 |
version |
|
4988 | 1088 |
^ '$Header$' |
343 | 1089 |
! ! |
4988 | 1090 |