#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Tue, 12 Feb 2019 20:50:10 +0100
changeset 8625 beec97e88a69
parent 8624 a88b4a284416
child 8626 f2894e8528de
#REFACTORING by stefan class: DeviceWorkstation changed: #pointFromUserShowing:positionFeedback:
DeviceWorkstation.st
--- a/DeviceWorkstation.st	Sat Feb 09 16:56:49 2019 +0100
+++ b/DeviceWorkstation.st	Tue Feb 12 20:50:10 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -6690,7 +6692,7 @@
      Show aCursor while waiting. Pressing shift or ctrl cancels the operation,
      and aborts"
 
-    |p prevGrab prevKbdGrab delay|
+    |prevGrab prevKbdGrab delay|
 
     prevGrab := activePointerGrab.
     prevKbdGrab := activeKeyboardGrab.
@@ -6703,42 +6705,41 @@
      wait for no leftButton...
     "
     [self leftButtonPressed] whileTrue:[
-	delay wait.
-    ].
-
-    [
-	self grabKeyboardInView:(self rootView).
-
-	"
-	 wait for leftButton...
-	 ctrl, shift or escape terminate that operation
-	"
-	[self leftButtonPressed] whileFalse:[
-	    (self ctrlDown or:[self shiftDown or:[activePointerGrab == nil]]) ifTrue:[
-		AbortOperationRequest raise.
-		^ nil
-	    ].
-	    feedbackBlockOrNil notNil ifTrue:[
-		feedbackBlockOrNil value:(self pointerPosition)
-	    ].
-	    delay wait.
-	].
-
-	p := self pointerPosition.
+        delay wait.
+    ].
+
+    ^ [
+        self grabKeyboardInView:(self rootView).
+
+        "
+         wait for leftButton...
+         ctrl, shift or escape terminate that operation
+        "
+        [self leftButtonPressed] whileFalse:[
+            (self ctrlDown or:[self shiftDown or:[activePointerGrab == nil]]) ifTrue:[
+                AbortOperationRequest raise.
+                ^ nil
+            ].
+            feedbackBlockOrNil notNil ifTrue:[
+                feedbackBlockOrNil value:(self pointerPosition)
+            ].
+            delay wait.
+        ].
+
+        self pointerPosition.
     ] ensure:[
-	self ungrabKeyboard.
-	prevKbdGrab notNil ifTrue:[
-	    self grabKeyboardInView:prevKbdGrab
-	].
-	self ungrabPointer.
-	prevGrab notNil ifTrue:[
-	    self grabPointerInView:prevGrab
-	].
-	"flush all events pending on myself"
-	self disposeButtonEventsFor:nil.
-    ].
-
-    ^ p
+        self ungrabKeyboard.
+        prevKbdGrab notNil ifTrue:[
+            self grabKeyboardInView:prevKbdGrab
+        ].
+        self ungrabPointer.
+        prevGrab notNil ifTrue:[
+            self grabPointerInView:prevGrab
+        ].
+        "flush all events pending on myself"
+        self disposeButtonEventsFor:nil.
+    ].
+
 
     "
      Display pointFromUserShowing:(Cursor stop)
@@ -6749,6 +6750,7 @@
 
     "Modified: / 08-02-2011 / 21:48:08 / cg"
     "Modified: / 23-02-2017 / 13:28:33 / stefan"
+    "Modified: / 12-02-2019 / 20:06:39 / Stefan Vogel"
 !
 
 rectangleFromUser