DialogBox.st
changeset 5017 3e5feb8b83da
parent 5011 a8c0c89fadca
child 5028 394487f4945d
equal deleted inserted replaced
5016:50b7e331691e 5017:3e5feb8b83da
  1322                         emphasizeFrom:16 to:20 with:(#color->Color red))
  1322                         emphasizeFrom:16 to:20 with:(#color->Color red))
  1323     "
  1323     "
  1324 
  1324 
  1325     "Modified: / 29-05-1996 / 15:23:14 / cg"
  1325     "Modified: / 29-05-1996 / 15:23:14 / cg"
  1326     "Created: / 20-01-2012 / 15:54:26 / cg"
  1326     "Created: / 20-01-2012 / 15:54:26 / cg"
       
  1327 !
       
  1328 
       
  1329 withOptoutOption:optOutAction labelled:labelString warn:warnString
       
  1330     "launch a Dialog to warn user. Add a 'do not show this dialog again'-like checkbox,
       
  1331      and call optOutAction after the warning if checked."
       
  1332 
       
  1333     |holder|
       
  1334 
       
  1335     holder := false asValue.
       
  1336     Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
       
  1337         |box|
       
  1338 
       
  1339         box := ex box.
       
  1340         box verticalPanel
       
  1341             add:((CheckBox label:labelString) model:holder).
       
  1342     ] do:[
       
  1343         self warn:warnString
       
  1344     ].
       
  1345     holder value ifTrue: optOutAction
       
  1346 
       
  1347     "
       
  1348      Dialog withOptoutOption:[Transcript flash] labelled:'opt out' warn:'some warning'.
       
  1349     "
  1327 ! !
  1350 ! !
  1328 
  1351 
  1329 !DialogBox class methodsFor:'confirmation dialogs'!
  1352 !DialogBox class methodsFor:'confirmation dialogs'!
  1330 
  1353 
  1331 confirm:aString
  1354 confirm:aString
 10122 ! !
 10145 ! !
 10123 
 10146 
 10124 !DialogBox class methodsFor:'documentation'!
 10147 !DialogBox class methodsFor:'documentation'!
 10125 
 10148 
 10126 version
 10149 version
 10127     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.353 2014-04-30 22:36:23 cg Exp $'
 10150     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.354 2014-05-06 19:44:25 cg Exp $'
 10128 !
 10151 !
 10129 
 10152 
 10130 version_CVS
 10153 version_CVS
 10131     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.353 2014-04-30 22:36:23 cg Exp $'
 10154     ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.354 2014-05-06 19:44:25 cg Exp $'
 10132 ! !
 10155 ! !
 10133 
 10156 
 10134 
 10157 
 10135 DialogBox initialize!
 10158 DialogBox initialize!