eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'WarningBox':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: WarningBox


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--TopView
                  |
                  +--StandardSystemView
                     |
                     +--ModalBox
                        |
                        +--DialogBox
                           |
                           +--InfoBox
                              |
                              +--WarningBox
                                 |
                                 +--YesNoBox

Package:
stx:libwidg
Category:
Views-DialogBoxes
Version:
rev: 1.37 date: 2018/03/01 21:53:52
user: mawalch
file: WarningBox.st directory: libwidg
module: stx stc-classLibrary: libwidg
Author:
Claus Gittinger

Description:


Historic note:
     originally, ST/X had separate classes for the various entry methods;
     there were YesNoBox, EnterBox, InfoBox and so on.
     In the meantime, the DialogBox class (and therefore its alias: Dialog)
     is going to duplicate most functionality found in these classes.

     In the future, those existing subclasses' functionality might
     be moved fully into Dialog, and the subclasses be replaced by dummy
     delegators. (They will be kept for backward compatibility, though).



 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'.

 Since showing warnings is a common action, a convenient method has been
 added to Object; thus you can use:

     self warn:'oops - headcrash'

 everywhere in your code.


Related information:

    DialogBox
    InfoBox
    YesNoBox
    [introduction to view programming]

Class protocol:

defaults
o  defaultLabel
(comment from inherited method)
return the boxes default window title.

icon bitmap
o  errorIconBitmap
return the bitmap shown as icon in my instances.
This is the default image; you can overwrite this in a concrete
instance with the image: message

o  iconBitmap
return the bitmap shown as icon in my instances.
This is the default image; you can overwrite this in a concrete
instance with the image: message

o  warnIconBitmap
return the bitmap shown as icon in my instances.
This is the default image; you can overwrite this in a concrete
instance with the image: message

styles
o  updateStyleCache
extract values from the styleSheet and cache them in class variables.
Here, the cached infoBitmap is simply flushed.


Instance protocol:

queries
o  beepWhenOpening


Examples:


Notice, the preferred use is via the DialogBox class messages, such as
    Dialog warn:'Attention !'
these (DialogBox) mesages are compatible with VW and should therefore be used for portability. Direct reference to WarnBox is only required for highly specialized boxes. standard warning dialogs (recommended, since these are ST-80 compatible interfaces)
    Dialog warn:'you should not do this'
since all objects support the #warn message, you can also simply use (for any self):
    self warn:'you should not do this'
with attributed text:
    Dialog warn:(Text string:'you should not do this'
                      emphasis:#color->Color red)
specifying more details of the warnBox (low level entries). label of OK-button:
    |aBox|

    aBox := WarningBox title:'Press ''OK'' to continue'.
    aBox okText:'OK'.
    aBox showAtPointer.
accessing the ok-Button component and changing its color:
    |aBox|

    aBox := WarningBox title:'Do you really want to do this ?'.
    aBox okText:'yes, go on'.
    aBox okButton foregroundColor:Color red.
    aBox showAtPointer.
since warnboxes are much like infoBoxes, all of look can be changed like described there:
    |image aBox|

    aBox := WarningBox title:'Press ''OK'' to continue'.
    aBox okText:'yes, continue'.
    image := Image fromFile:'bitmaps/SmalltalkX.xbm' inPackage:'stx:libtool'.
    aBox form:image.
    aBox showAtPointer.


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Mon, 23 Jul 2018 11:36:39 GMT