DialogBox.st
changeset 253 f071ff350cd5
parent 241 8a097fc712c3
child 276 431d83f33d8d
equal deleted inserted replaced
252:57168c4d1def 253:f071ff350cd5
     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 
    12 
    13 ModalBox subclass:#DialogBox
    13 ModalBox subclass:#DialogBox
    14 	 instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction
    14 	instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction
    15                 acceptReturnAsOK yPosition leftIndent rightIndent bindings
    15 		acceptReturnAsOK yPosition leftIndent rightIndent bindings
    16                 addedComponents inputFieldGroup acceptOnLeave acceptValue
    16 		addedComponents inputFieldGroup acceptOnLeave acceptValue
    17                 tabableElements'
    17 		tabableElements'
    18 	 classVariableNames:''
    18 	classVariableNames:''
    19 	 poolDictionaries:''
    19 	poolDictionaries:''
    20 	 category:'Views-DialogBoxes'
    20 	category:'Views-DialogBoxes'
    21 !
    21 !
    22 
    22 
    23 !DialogBox class methodsFor:'documentation'!
    23 !DialogBox class methodsFor:'documentation'!
    24 
    24 
    25 copyright
    25 copyright
   765     " 
   765     " 
   766      Dialog confirm:'really ?' initialAnswer:false
   766      Dialog confirm:'really ?' initialAnswer:false
   767     "
   767     "
   768 !
   768 !
   769 
   769 
       
   770 confirm:aString yesLabel:yesText noLabel:noText
       
   771     "launch a Dialog, which allows user to enter yes or no.
       
   772      return true for yes, false for no.
       
   773      The yes/no buttons labels are defined by yesText/noText."
       
   774 
       
   775     |box answer|
       
   776 
       
   777     box := YesNoBox title:aString.
       
   778     box yesLabel:yesText; noLabel:noText.
       
   779     box yesAction:[answer := true] noAction:[answer := false].
       
   780     box showAtPointer.
       
   781     box yesAction:nil noAction:nil.
       
   782     ^ answer
       
   783 
       
   784     " 
       
   785      Dialog confirm:'really ?' yesLabel:'oh well' noLabel:'nope'
       
   786     "
       
   787 
       
   788     "Modified: 13.12.1995 / 16:22:29 / cg"
       
   789 !
       
   790 
   770 confirmWithCancel:aString
   791 confirmWithCancel:aString
   771     "launch a Dialog, which allows user to enter yes, no and cancel.
   792     "launch a Dialog, which allows user to enter yes, no and cancel.
   772      return true for 'yes', false for 'no', nil for 'cancel'"
   793      return true for 'yes', false for 'no', nil for 'cancel'"
   773 
   794 
   774     |box answer|
   795     |box answer|
  1938 ! !
  1959 ! !
  1939 
  1960 
  1940 !DialogBox class methodsFor:'documentation'!
  1961 !DialogBox class methodsFor:'documentation'!
  1941 
  1962 
  1942 version
  1963 version
  1943     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.31 1995-12-07 22:15:09 cg Exp $'
  1964     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.32 1995-12-13 16:29:41 cg Exp $'
  1944 ! !
  1965 ! !