#REFACTORING by stefan
class: DeviceWorkstation
changed: #pointFromUserShowing:positionFeedback:
--- 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