WarningBox.st
changeset 5894 317a89cd0996
parent 3665 7ff70da31a25
child 6290 9c06dcc35aaa
equal deleted inserted replaced
5893:01e54cac0ec3 5894:317a89cd0996
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libwidg' }"
    12 "{ Package: 'stx:libwidg' }"
    13 
    13 
       
    14 "{ NameSpace: Smalltalk }"
       
    15 
    14 InfoBox subclass:#WarningBox
    16 InfoBox subclass:#WarningBox
    15 	instanceVariableNames:''
    17 	instanceVariableNames:''
    16 	classVariableNames:'WarnBitmap ErrorBitmap'
    18 	classVariableNames:'WarnBitmap ErrorBitmap'
    17 	poolDictionaries:''
    19 	poolDictionaries:''
    18 	category:'Views-DialogBoxes'
    20 	category:'Views-DialogBoxes'
    38 "
    40 "
    39    Historic note:
    41    Historic note:
    40         originally, ST/X had separate classes for the various entry methods;
    42         originally, ST/X had separate classes for the various entry methods;
    41         there were YesNoBox, EnterBox, InfoBox and so on.
    43         there were YesNoBox, EnterBox, InfoBox and so on.
    42         In the meantime, the DialogBox class (and therefore its alias: Dialog)
    44         In the meantime, the DialogBox class (and therefore its alias: Dialog)
    43         is going to duplicate most funcionality found in these classes.
    45         is going to duplicate most functionality found in these classes.
    44 
    46 
    45         In the future, those existing subclasses' functionality might
    47         In the future, those existing subclasses' functionality might
    46         be moved fully into Dialog, and the subclasses be replaced by dummy
    48         be moved fully into Dialog, and the subclasses be replaced by dummy
    47         delegators. (They will be kept for backward compatibility, though).
    49         delegators. (They will be kept for backward compatibility, though).
    48 
    50 
    49 
    51 
    50 
    52 
    51     this class implements a pop-up box to show an information message. 
    53     this class implements a pop-up box to show an information message.
    52     WarningBoxes are basically InfoBoxes with a different bitmap-image.
    54     WarningBoxes are basically InfoBoxes with a different bitmap-image.
    53     (also, they add a beep when popping up)
    55     (also, they add a beep when popping up)
    54 
    56 
    55     They are created with:
    57     They are created with:
    56 
    58 
    81 !
    83 !
    82 
    84 
    83 examples
    85 examples
    84 "
    86 "
    85     Notice, the preferred use is via the DialogBox class messages,
    87     Notice, the preferred use is via the DialogBox class messages,
    86     such as 
    88     such as
    87                                                                         [exBegin]
    89                                                                         [exBegin]
    88         Dialog warn:'Attention !!'
    90         Dialog warn:'Attention !!'
    89                                                                         [exEnd]
    91                                                                         [exEnd]
    90     these (DialogBox) mesages are compatible with VW and should therefore
    92     these (DialogBox) mesages are compatible with VW and should therefore
    91     be used for portability.
    93     be used for portability.
    99         Dialog warn:'you should not do this'
   101         Dialog warn:'you should not do this'
   100                                                                         [exEnd]
   102                                                                         [exEnd]
   101     since all objects support the #warn message,
   103     since all objects support the #warn message,
   102     you can also simply use (for any self):
   104     you can also simply use (for any self):
   103                                                                         [exBegin]
   105                                                                         [exBegin]
   104         self warn:'you should not do this' 
   106         self warn:'you should not do this'
   105                                                                         [exEnd]
   107                                                                         [exEnd]
   106 
   108 
   107     with attributed text:
   109     with attributed text:
   108                                                                         [exBegin]
   110                                                                         [exBegin]
   109         Dialog warn:(Text string:'you should not do this' 
   111         Dialog warn:(Text string:'you should not do this'
   110                           emphasis:#color->Color red)
   112                           emphasis:#color->Color red)
   111                                                                         [exEnd]
   113                                                                         [exEnd]
   112         
   114 
   113     specifying more details of the warnBox (low level entries).
   115     specifying more details of the warnBox (low level entries).
   114     label of OK-button:
   116     label of OK-button:
   115                                                                         [exBegin]
   117                                                                         [exBegin]
   116         |aBox|
   118         |aBox|
   117 
   119 
   254 ! !
   256 ! !
   255 
   257 
   256 !WarningBox class methodsFor:'documentation'!
   258 !WarningBox class methodsFor:'documentation'!
   257 
   259 
   258 version
   260 version
   259     ^ '$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.35 2008-07-14 19:33:37 cg Exp $'
   261     ^ '$Header$'
   260 ! !
   262 ! !
       
   263