YesNoBox.st
changeset 355 a55f62047156
parent 253 f071ff350cd5
child 373 da46657e62bc
equal deleted inserted replaced
354:dcad6936bfa6 355:a55f62047156
    33 "
    33 "
    34 !
    34 !
    35 
    35 
    36 documentation
    36 documentation
    37 "
    37 "
       
    38    Historic note:
       
    39         originally, ST/X had separate classes for the various entry methods;
       
    40         there were YesNoBox, EnterBox, InfoBox and so on.
       
    41         In the meantime, the DialogBox class (and therefore its alias: Dialog)
       
    42         is going to duplicate most funcionality found in these classes.
       
    43 
       
    44         In the future, those existing subclasses' functionality is going to
       
    45         be moved fully into Dialog, and the subclasses will be replaced by dummy
       
    46         delegators. (They will be kept for backward compatibility, though).
       
    47 
       
    48 
       
    49 
    38     this class implements yes-no boxes by adding another (no-) Button to the WarnBox-View.
    50     this class implements yes-no boxes by adding another (no-) Button to the WarnBox-View.
    39     They are created with:
    51     They are created with:
    40 
    52 
    41 	aBox := YesNoBox title:'some title'.
    53         aBox := YesNoBox title:'some title'.
    42 	aBox okAction:[ .. some action to be performed when ok is pressed ].
    54         aBox okAction:[ .. some action to be performed when ok is pressed ].
    43 
    55 
    44     and finally shown with:
    56     and finally shown with:
    45 
    57 
    46 	aBox showAtPointer
    58         aBox showAtPointer
    47 
    59 
    48     The default box shows 'yes' and 'no' in its buttons; this can be changed with:
    60     The default box shows 'yes' and 'no' in its buttons; this can be changed with:
    49 
    61 
    50 	aBox yesText:'some string'.
    62         aBox yesText:'some string'.
    51 	aBox noText:'some string'.
    63         aBox noText:'some string'.
    52 
    64 
    53     There is also protocol to set both button titles in one message.
    65     There is also protocol to set both button titles in one message.
    54     Also, the action associated to the noButton can be changed.
    66     Also, the action associated to the noButton can be changed.
    55 
    67 
    56     For very simple yes/no queries, you can also use the much simpler confirm:.
    68     For very simple yes/no queries, you can also use the much simpler confirm:.
    57     Since implemented in Object, everyone understands confirm. You can pass
    69     Since implemented in Object, everyone understands confirm. You can pass
    58     a question message (but not change the buttons labels).
    70     a question message (but not change the buttons labels).
    59     Use is:
    71     Use is:
    60 	self confirm:'some question'  
    72         self confirm:'some question'  
    61     and will return true or false.
    73     and will return true or false.
    62 
    74 
    63     For compatibility with ST-80, use:
    75     For compatibility with ST-80, use:
    64 	Dialog confirm:'hello'
    76         Dialog confirm:'hello'
    65 "
    77 "
    66 !
    78 !
    67 
    79 
    68 examples
    80 examples
    69 "
    81 "
   346 ! !
   358 ! !
   347 
   359 
   348 !YesNoBox class methodsFor:'documentation'!
   360 !YesNoBox class methodsFor:'documentation'!
   349 
   361 
   350 version
   362 version
   351     ^ '$Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.22 1995-12-13 16:30:35 cg Exp $'
   363     ^ '$Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.23 1996-02-11 09:54:26 cg Exp $'
   352 ! !
   364 ! !