BorderedWrapper.st
author Claus Gittinger <cg@exept.de>
Wed, 29 May 1996 00:43:39 +0200
changeset 278 f2382bb48850
child 283 f28c462b9d13
permissions -rw-r--r--
intitial checkin

BoundedWrapper subclass:#BorderedWrapper
	instanceVariableNames:'border inset insideColor'
	classVariableNames:''
	poolDictionaries:''
	category:'Graphics-Display Objects'
!

!BorderedWrapper class methodsFor:'documentation'!

examples
"
                                                                        [exBegin]
    |t s v e component|

    t := StandardSystemView extent:250@200.
    s := HVScrollableView for:View miniScroller:true in:t.
    s origin:0.0@0.0 corner:1.0@1.0.
    v := s scrolledView.

    e := Rectangle origin:0@0 corner:80@80.
    component := FillingWrapper on:e.
    component foregroundColor:Color red.
    v addComponent:(BorderedWrapper on:component at:10@10).

    e := EllipticalArc boundingBox:(0@0 corner:80@80)
                     startAngle:0 sweepAngle:360.
    component := StrokingWrapper on:e.
    component lineWidth:5.
    v addComponent:(BorderedWrapper on:component at:10@10).

    e := Arrow from:0@0 to:50@150.
    component := StrokingWrapper on:e.
    component lineWidth:2.
    v addComponent:(BorderedWrapper on:component at:100@100).

    t open
                                                                        [exEnd]
"
! !

!BorderedWrapper class methodsFor:'instance creation'!

on:aComponent in:aLayout border:aBorder
    ^ (super on:aComponent in:aLayout) border:aBorder

    "Created: 28.5.1996 / 23:15:00 / cg"
! !

!BorderedWrapper methodsFor:'accessing'!

border
    "return border"

    ^ border

    "Created: 28.5.1996 / 23:15:15 / cg"
!

border:something
    "set border"

    border := something.

    "Created: 28.5.1996 / 23:15:15 / cg"
! !

!BorderedWrapper methodsFor:'displaying'!

displayOn:aGC
    |bounds x y w h tX tY|

    super displayOn:aGC.

    bounds := self bounds.
    x := bounds left rounded.
    y := bounds top rounded.
    w := bounds width rounded.
    h := bounds height rounded.

    tX := aGC translation x.
    tY := aGC translation y.

    aGC drawEdgesForX:x+tX
                    y:y+tY
                width:w
               height:h
                level:1 
               shadow:Color black 
                light:Color white
           halfShadow:Color grey 
            halfLight:Color grey
                style:#iris

    "Modified: 29.5.1996 / 00:36:00 / cg"
! !

!BorderedWrapper class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/BorderedWrapper.st,v 1.1 1996-05-28 22:43:05 cg Exp $'
! !