PopUpBanner.st
author Claus Gittinger <cg@exept.de>
Mon, 07 Feb 2000 17:15:43 +0100
changeset 1339 9635acd44db9
parent 1338 aead0c7924f8
child 1340 6c5fdafe90a5
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 2000 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


PopUpView subclass:#PopUpBanner
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Views-Basic'
!

!PopUpBanner class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2000 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

!

documentation
"
    Shows a banner popUp (splash window);
    can be used at startup to make wait-time a bit more interesting.
    See use in smalltalk.rc / showBanner.rc / hideBanner.rc.

    [author:]
        Claus Gittinger
"

!

examples
"
                                                [exBegin]
    |img bannerView|

    img := Image fromFile:'banner1.xpm'.
    bannerView := PopUpBanner forImage:img.
    bannerView showCentered.

    Delay waitForSeconds:2.
    bannerView destroy
                                                [exEnd]
"

! !

!PopUpBanner class methodsFor:'instance creation'!

forImage:anImage
    |v|

    v := self new.
    v viewBackground:anImage.
    v cursor:Cursor wait.
    ^ v
! !

!PopUpBanner methodsFor:'activation'!

open
    "default for popUpBanners is to come up modeless"

    |center r1 r2|

    center := self center.
    r1 := (center corner:center) insetBy:-5.
    r2 := self origin corner:self corner.
    self device zoom:r1 to:r2 duration:300.

    self realize

!

showCentered
    self extent:viewBackground extent.
    self showAt:((self device extent // 2) - (viewBackground extent // 2))


! !

!PopUpBanner methodsFor:'deactivation'!

destroy
    |screen center r1 r2|

    screen := self device.
    center := self center.
    r1 := (center corner:center) insetBy:-5.
    r2 := self origin corner:self corner.
    super destroy.

    self device zoom:r2 to:r1 duration:300.

! !

!PopUpBanner methodsFor:'queries'!

grabWhenMapped
    ^ false
! !

!PopUpBanner class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/PopUpBanner.st,v 1.5 2000-02-07 16:15:43 cg Exp $'
! !