WarningBox.st
author claus
Wed, 24 Aug 1994 01:38:59 +0200
changeset 51 e895ac4cc7c8
parent 38 4b9b70b2cc87
child 59 450ce95a72a4
permissions -rw-r--r--
support non-string entries

"
 COPYRIGHT (c) 1993 by Claus Gittinger
              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.
"

InfoBox subclass:#WarningBox
       instanceVariableNames:''
       classVariableNames:'WarnBitmap'
       poolDictionaries:''
       category:'Views-DialogBoxes'
!

WarningBox comment:'
COPYRIGHT (c) 1993 by Claus Gittinger
              All Rights Reserved

$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.4 1994-08-07 13:23:39 claus Exp $
'!

!WarningBox class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1993 by Claus Gittinger
              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.
"
!

version
"
$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.4 1994-08-07 13:23:39 claus Exp $
"
!

documentation
"
    this class implements a pop-up box to show an information message. 
    WarningBoxes are basically InfoBoxes with a different bitmap-image.
    (also, they add a beep when popping up)

    They are created with:

        aBox := WarningBox title:'some title'.

    and shown with:

        aBox showAtPointer

    The default box shows 'yes' in its button; this can be changed with:

        aBox okText:'some string'.


    Examples:

        |aBox|

        aBox := WarningBox title:'Press ''OK'' to continue'.
        aBox okText:'OK'.
        aBox showAtPointer.

"
! !

!WarningBox methodsFor:'initialization'!

initFormBitmap
    WarnBitmap isNil ifTrue:[
        WarnBitmap := Form fromFile:'Warning.xbm' resolution:100 on:Display 
    ].
    formLabel form:WarnBitmap
! !

!WarningBox methodsFor:'realization'!

show
    "added bell to wake up user"

    device beep.
    super show
! 

showAtPointer
    "added bell to wake up user"

    device beep.
    super showAtPointer
! !