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