YesNoBox.st
changeset 125 3ffa271732f7
parent 119 59758ff5b841
child 130 338e856bddc9
equal deleted inserted replaced
124:7abd3a234296 125:3ffa271732f7
    19 
    19 
    20 YesNoBox comment:'
    20 YesNoBox comment:'
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.14 1995-05-03 00:39:01 claus Exp $
    24 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.15 1995-05-09 01:57:16 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !YesNoBox class methodsFor:'documentation'!
    27 !YesNoBox class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.14 1995-05-03 00:39:01 claus Exp $
    45 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.15 1995-05-09 01:57:16 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
    70     Since implemented in Object, everyone understands confirm. You can pass
    70     Since implemented in Object, everyone understands confirm. You can pass
    71     a question message (but not change the buttons labels).
    71     a question message (but not change the buttons labels).
    72     Use is:
    72     Use is:
    73 	self confirm:'some question'  
    73 	self confirm:'some question'  
    74     and will return true or false.
    74     and will return true or false.
       
    75 
       
    76     For compatibility with ST-80, use:
       
    77 	Dialog confirm:'hello'
    75 "
    78 "
    76 !
    79 !
    77 
    80 
    78 examples
    81 examples
    79 "
    82 "
   122 	(YesNoBox new confirm:'yes or no:') ifTrue:[
   125 	(YesNoBox new confirm:'yes or no:') ifTrue:[
   123 	    Transcript showCr:'yes'
   126 	    Transcript showCr:'yes'
   124 	] ifFalse:[
   127 	] ifFalse:[
   125 	    Transcript showCr:'no'
   128 	    Transcript showCr:'no'
   126 	]
   129 	]
       
   130 
       
   131     or:
       
   132 
       
   133 	(Dialog confirm:'yes or no:') ifTrue:[
       
   134 	    Transcript showCr:'yes'
       
   135 	] ifFalse:[
       
   136 	    Transcript showCr:'no'
       
   137 	]
   127 "
   138 "
   128 ! !
   139 ! !
   129 
   140 
   130 !YesNoBox class methodsFor:'styles'!
   141 !YesNoBox class methodsFor:'styles'!
   131 
   142 
   166     buttonPanel layout:#fitSpace.  "/ looks better; should it come from the StyleSheet ?
   177     buttonPanel layout:#fitSpace.  "/ looks better; should it come from the StyleSheet ?
   167 
   178 
   168     textLabel label:'please Confirm'.
   179     textLabel label:'please Confirm'.
   169     okButton label:(resources at:'yes').
   180     okButton label:(resources at:'yes').
   170 
   181 
   171     noButton := Button new.
   182     noButton := Button abortButton.
   172     buttonPanel addSubView:noButton before:okButton.
   183     buttonPanel addSubView:noButton before:okButton.
   173     noButton label:(resources at:'no').
   184     noButton label:(resources at:'no').
   174     noButton height:(okButton height).
   185     noButton height:(okButton height).
   175     noButton model:self; change:#noPressed
   186     noButton model:self; change:#noPressed
   176 !
   187 !