#UI_ENHANCEMENT by cg draft
authorClaus Gittinger <cg@exept.de>
Fri, 19 Jul 2019 21:49:42 +0200
changeset 3715 8e37e3d91789
parent 3714 d3314ff81424
child 3716 08e97653176e
#UI_ENHANCEMENT by cg class: ShowMeHowItWorks added: #randomThankYou changed: #doStream: #showing:do: (send #realize instead of #showAtPointer)
ShowMeHowItWorks.st
--- a/ShowMeHowItWorks.st	Fri Jul 19 21:33:44 2019 +0200
+++ b/ShowMeHowItWorks.st	Fri Jul 19 21:49:42 2019 +0200
@@ -131,25 +131,30 @@
 
     <action>
     
-    |messageView talkDone|
+    |xLatedMessage messageView talkDone|
 
+    xLatedMessage := application notNil 
+                        ifTrue:[application resources string:message]
+                        ifFalse:[message].
+                        
     self assert:(operationsOrNothing isNil or:[operationsOrNothing isSequenceable]).
 
-    messageView := ActiveHelpView for:message.
+    messageView := ActiveHelpView for:xLatedMessage.
     "/ messageView shapeStyle:#cartoon.
     [
+        messageView origin:(Screen current pointerPosition).
         messageView realize.
 
         self talking ifTrue:[
             talkDone := Semaphore new.
             [
-                self tell:message.
+                self tell:xLatedMessage.
                 talkDone signal
             ] fork.
             
             "/
             "/ allow speaker some headoff
-            Delay waitForSeconds:(message size / 20).
+            Delay waitForSeconds:(xLatedMessage size / 30).
         ].
 
         operationsOrNothing notEmptyOrNil ifTrue:[
@@ -163,8 +168,7 @@
     ].
 
     "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
-    "Modified: / 19-07-2019 / 15:59:52 / Claus Gittinger"
-    "Modified (comment): / 19-07-2019 / 18:54:43 / Claus Gittinger"
+    "Modified: / 19-07-2019 / 21:37:07 / Claus Gittinger"
 !
 
 wait:seconds
@@ -523,6 +527,36 @@
     "Created: / 19-07-2019 / 11:36:21 / Claus Gittinger"
 !
 
+randomThankYou
+    ^ #(
+        'thank you, for watching'
+        'thank you for watching'
+        'thank you'
+        'have a good day'
+        'have fun'
+        'have fun with expecco'
+        'have fun with expecco, by the way: expecco comes from the latin word: peccare, which means: "to sin"'
+        'happy hacking'
+        'happy hacking, I hope you liked what you saw'
+        'hope you liked it'
+        'see you again'
+        'please give feedback, and let us know, if you liked it'
+        'if you have any questions, please contact exept'
+        'if you need more information, please take a look at the wiki'
+    ) atRandom
+
+    "
+     OperatingSystem speak:'have fun with expecco'
+     OperatingSystem speak:'have fun with expecco, by the way: expecco comes from the latin word: peccare, which means: "to sin"'
+     OperatingSystem speak:'happy hacking, I hope you liked what you saw'
+     OperatingSystem speak:'please give feedback, and let us know, if you liked it'
+     OperatingSystem speak:'if you have any questions, please contact exept'
+     OperatingSystem speak:'if you need more information, please take a look at the wiki'
+    "
+
+    "Created: / 19-07-2019 / 21:39:18 / Claus Gittinger"
+!
+
 tell:message
     self talking ifTrue:[
         OperatingSystem speak:message.
@@ -792,17 +826,21 @@
 !
 
 doStream:specStream
-    |previousStream|
+    |previousStream resources|
 
+    resources := self class classResources.
+    
     previousStream := opStream.
     [
         opStream := specStream.
         [opStream atEnd] whileFalse:[
             self nextCommand.
             Display shiftDown ifTrue:[
-                (Dialog confirm:(self class classResources stringWithCRs:'Stop the demonstration?'))
+                self tell:(resources string:'you pressed the shift key, do you want to stop the show?').
+                (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?'))
                 ifTrue:[
-                    self tell:'you stopped the show, thank you, for watching'.
+                    self tell:(resources string:'you stopped the show,').
+                    self tell:(resources string:(self randomThankYou)).
                     ^ AbortOperationRequest raise
                 ].    
             ].    
@@ -840,7 +878,7 @@
 END"
 
     "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
-    "Modified: / 19-07-2019 / 18:56:13 / Claus Gittinger"
+    "Modified: / 19-07-2019 / 21:41:43 / Claus Gittinger"
 !
 
 nextCommand