DialogBox.st
changeset 5975 4512d959e3c3
parent 5974 2c1342bfc0b2
child 5993 8934110278a3
equal deleted inserted replaced
5974:2c1342bfc0b2 5975:4512d959e3c3
  6230 
  6230 
  6231     |optOutHolder1 optOutHolder2|
  6231     |optOutHolder1 optOutHolder2|
  6232 
  6232 
  6233     optOutHolder1 := false asValue.
  6233     optOutHolder1 := false asValue.
  6234     optOutHolder2 := false asValue.
  6234     optOutHolder2 := false asValue.
  6235     Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
  6235     [
  6236         |box|
  6236         Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
  6237 
  6237             |box|
  6238         box := ex box.
  6238 
  6239         box verticalPanel add:((CheckBox label:labelString1) model:optOutHolder1).
  6239             box := ex box.
  6240         box verticalPanel add:((CheckBox label:labelString2) model:optOutHolder2).
  6240             box verticalPanel add:((CheckBox label:labelString1) model:optOutHolder1).
  6241     ] do:boxOpeningBlock.
  6241             box verticalPanel add:((CheckBox label:labelString2) model:optOutHolder2).
  6242     optOutHolder1 value ifTrue:[ optOutAction1 value ].
  6242         ] do:boxOpeningBlock.
  6243     optOutHolder2 value ifTrue:[ optOutAction2 value ].
  6243     ] ensure:[
       
  6244         optOutHolder1 value ifTrue:[ optOutAction1 value ].
       
  6245         optOutHolder2 value ifTrue:[ optOutAction2 value ].
       
  6246     ].
  6244 
  6247 
  6245     "
  6248     "
  6246      Dialog 
  6249      Dialog 
  6247         withOptoutOption:[Transcript flash] labelled:'opt out1' 
  6250         withOptoutOption:[Transcript flash] labelled:'opt out1' 
  6248         andOptoutOption:[Transcript show:'wow'] labelled:'opt out2' 
  6251         andOptoutOption:[Transcript show:'wow'] labelled:'opt out2' 
  6249         do:[ Dialog confirm:'some question' ].
  6252         do:[ Dialog confirm:'some question' ].
  6250     "
  6253     "
  6251 
  6254 
  6252     "Created: / 18-11-2016 / 11:26:06 / cg"
  6255     "Created: / 18-11-2016 / 11:26:06 / cg"
       
  6256     "Modified: / 22-11-2016 / 04:21:10 / cg"
  6253 !
  6257 !
  6254 
  6258 
  6255 withOptoutOption:optOutAction labelled:labelString do:boxOpeningBlock
  6259 withOptoutOption:optOutAction labelled:labelString do:boxOpeningBlock
  6256     "launch a Dialog to warn user. 
  6260     "launch a Dialog to warn user. 
  6257      Add a 'do not show this dialog again'-like checkbox,
  6261      Add a 'do not show this dialog again'-like checkbox,
  6258      and call optOutAction after the dialog, if the checkbox was indeed checked."
  6262      and call optOutAction after the dialog, if the checkbox was indeed checked."
  6259 
  6263 
  6260     |holder|
  6264     |holder|
  6261 
  6265 
  6262     holder := false asValue.
  6266     holder := false asValue.
  6263     Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
  6267     [
  6264         |box|
  6268         Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
  6265 
  6269             |box|
  6266         box := ex box.
  6270 
  6267         box verticalPanel add:((CheckBox label:labelString) model:holder).
  6271             box := ex box.
  6268     ] do:boxOpeningBlock.
  6272             box verticalPanel add:((CheckBox label:labelString) model:holder).
  6269     holder value ifTrue:[optOutAction value]
  6273         ] do:boxOpeningBlock.
       
  6274     ] ensure:[
       
  6275         holder value ifTrue:[optOutAction value]
       
  6276     ]
  6270 
  6277 
  6271     "
  6278     "
  6272      Dialog 
  6279      Dialog 
  6273         withOptoutOption:[Transcript flash] 
  6280         withOptoutOption:[Transcript flash] 
  6274         labelled:'opt out' 
  6281         labelled:'opt out' 
  6275         do:[ Dialog confirm:'some question' ].
  6282         do:[ Dialog confirm:'some question' ].
  6276     "
  6283     "
  6277 
  6284 
  6278     "Modified: / 22-11-2016 / 04:08:48 / cg"
  6285     "Modified: / 22-11-2016 / 04:20:38 / cg"
  6279 !
  6286 !
  6280 
  6287 
  6281 withOptoutOption:optOutAction labelled:labelString warn:warnString
  6288 withOptoutOption:optOutAction labelled:labelString warn:warnString
  6282     "launch a Dialog to warn user. 
  6289     "launch a Dialog to warn user. 
  6283      Add a 'do not show this dialog again'-like checkbox,
  6290      Add a 'do not show this dialog again'-like checkbox,