DialogBox.st
changeset 2788 6e4b5ada3f89
parent 2787 401103ebccb7
child 2789 b6aacb0824d5
equal deleted inserted replaced
2787:401103ebccb7 2788:6e4b5ada3f89
  1529                    labels:(self classResources array:#('Cancel' 'No' 'Yes') )
  1529                    labels:(self classResources array:#('Cancel' 'No' 'Yes') )
  1530                   default:(#(nil false true) indexOf:default ifAbsent:nil)
  1530                   default:(#(nil false true) indexOf:default ifAbsent:nil)
  1531     "
  1531     "
  1532      Dialog confirmWithCancel:'really ?' default:false
  1532      Dialog confirmWithCancel:'really ?' default:false
  1533      Dialog confirmWithCancel:'really ?' default:true
  1533      Dialog confirmWithCancel:'really ?' default:true
       
  1534     "
       
  1535 !
       
  1536 
       
  1537 confirmWithCancel:aString default:defaultValue onCancel:cancelValue
       
  1538     "launch a Dialog, which allows user to enter yes, no and cancel.
       
  1539      return true for 'yes', false for 'no', cancelValues value for 'cancel'"
       
  1540 
       
  1541     |answer|
       
  1542 
       
  1543     answer := self confirmWithCancel:aString default:defaultValue.
       
  1544     answer isNil ifTrue:[
       
  1545         ^ cancelValue value
       
  1546     ].
       
  1547     ^ answer
       
  1548 
       
  1549     "
       
  1550      Dialog confirmWithCancel:'really ?' onCancel:[AbortSignal raise]
  1534     "
  1551     "
  1535 !
  1552 !
  1536 
  1553 
  1537 confirmWithCancel:aString labels:labelArray
  1554 confirmWithCancel:aString labels:labelArray
  1538     "launch a Dialog, which allows user to enter cancel, no or yes.
  1555     "launch a Dialog, which allows user to enter cancel, no or yes.
  7792 ! !
  7809 ! !
  7793 
  7810 
  7794 !DialogBox class methodsFor:'documentation'!
  7811 !DialogBox class methodsFor:'documentation'!
  7795 
  7812 
  7796 version
  7813 version
  7797     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.219 2003-08-19 15:03:04 cg Exp $'
  7814     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.220 2003-08-19 16:38:41 cg Exp $'
  7798 ! !
  7815 ! !
  7799 
  7816 
  7800 DialogBox initialize!
  7817 DialogBox initialize!