ShowMeHowItWorks.st
changeset 3714 d3314ff81424
parent 3713 fa10e87dbf04
child 3715 8e37e3d91789
equal deleted inserted replaced
3713:fa10e87dbf04 3714:d3314ff81424
   103     "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger"
   103     "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger"
   104     "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger"
   104     "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger"
   105 !
   105 !
   106 
   106 
   107 show:message
   107 show:message
   108     "execute operations while showing (and speaking) some message."
   108     "showing (and speak) some message."
   109 
   109 
   110     <action>
   110     <action>
   111     
   111     
   112     self showing:message do:nil
   112     self showing:message do:nil
   113 
   113 
   114     "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
   114     "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
       
   115     "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
       
   116 !
       
   117 
       
   118 show:message for:seconds
       
   119     "showing (and speak) some message and wait for some time."
       
   120 
       
   121     <action>
       
   122     
       
   123     self show:message.
       
   124     self wait:seconds.
       
   125 
       
   126     "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
   115 !
   127 !
   116 
   128 
   117 showing:message do:operationsOrNothing
   129 showing:message do:operationsOrNothing
   118     "execute operations while showing (and speaking) some message."
   130     "execute operationsOrNothing while showing (and speaking) some message."
   119 
   131 
   120     <action>
   132     <action>
   121     
   133     
   122     |messageView talkDone|
   134     |messageView talkDone|
   123 
   135 
   150         talkDone wait.
   162         talkDone wait.
   151     ].
   163     ].
   152 
   164 
   153     "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
   165     "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
   154     "Modified: / 19-07-2019 / 15:59:52 / Claus Gittinger"
   166     "Modified: / 19-07-2019 / 15:59:52 / Claus Gittinger"
       
   167     "Modified (comment): / 19-07-2019 / 18:54:43 / Claus Gittinger"
   155 !
   168 !
   156 
   169 
   157 wait:seconds
   170 wait:seconds
   158     <action>
   171     <action>
   159     
   172     
   785     [
   798     [
   786         opStream := specStream.
   799         opStream := specStream.
   787         [opStream atEnd] whileFalse:[
   800         [opStream atEnd] whileFalse:[
   788             self nextCommand.
   801             self nextCommand.
   789             Display shiftDown ifTrue:[
   802             Display shiftDown ifTrue:[
   790                 self tell:'you stopped the shou, thank you, for watching'.
   803                 (Dialog confirm:(self class classResources stringWithCRs:'Stop the demonstration?'))
   791                 ^ AbortOperationRequest raise
   804                 ifTrue:[
       
   805                     self tell:'you stopped the show, thank you, for watching'.
       
   806                     ^ AbortOperationRequest raise
       
   807                 ].    
   792             ].    
   808             ].    
   793         ].    
   809         ].    
   794     ] ensure:[
   810     ] ensure:[
   795         opStream := previousStream
   811         opStream := previousStream
   796     ].
   812     ].
   822         )
   838         )
   823      )
   839      )
   824 END"
   840 END"
   825 
   841 
   826     "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
   842     "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
   827     "Modified: / 19-07-2019 / 16:02:51 / Claus Gittinger"
   843     "Modified: / 19-07-2019 / 18:56:13 / Claus Gittinger"
   828 !
   844 !
   829 
   845 
   830 nextCommand
   846 nextCommand
   831     self doCommand:(opStream next).
   847     self doCommand:(opStream next).
   832 
   848