device access
authorClaus Gittinger <cg@exept.de>
Sat, 02 Apr 2016 17:07:48 +0200
changeset 7264 84b62bae4dc0
parent 7263 9036d75c2799
child 7265 dab1ddde607d
device access
ModalBox.st
--- a/ModalBox.st	Sat Apr 02 17:07:41 2016 +0200
+++ b/ModalBox.st	Sat Apr 02 17:07:48 2016 +0200
@@ -311,8 +311,8 @@
 "/    label := 'Popup'.
 
     UseTransientViews ifFalse:[
-        (PopUpView shadowsOnDevice:self graphicsDevice) ifTrue:[
-            shadowView := (ShadowView onDevice:self graphicsDevice) for:self
+        (PopUpView shadowsOnDevice:device) ifTrue:[
+            shadowView := (ShadowView onDevice:device) for:self
         ].
 
         form := Form width:8 height:8
@@ -325,7 +325,7 @@
                                  2r00001111
                                  2r00011111
                                 ]
-                     onDevice:self graphicsDevice.
+                     onDevice:device.
         resizeButton := Button label:form in:self.
         resizeButton origin:1.0 @ 1.0 corner:1.0@1.0.
         resizeButton activeForegroundColor:(resizeButton foregroundColor).
@@ -348,7 +348,7 @@
                                  2r00000000
                                  2r00000000
                                 ]
-                     onDevice:self graphicsDevice.
+                     onDevice:device.
         moveButton := Button label:form in:self.
         moveButton origin:0.0 @ 0.0 corner:0.0@0.0.
         moveButton activeForegroundColor:(moveButton foregroundColor).
@@ -403,7 +403,7 @@
     |newExtent maxExtent|
 
     newExtent := self preferredExtent.
-    newExtent := newExtent min:(self graphicsDevice extent).
+    newExtent := newExtent min:(device extent).
 
     maxExtent := self maxExtent.
     maxExtent notNil ifTrue:[
@@ -437,12 +437,12 @@
     shown ifTrue:[
         delta := width - newExtent x.
         newLeft := left + delta.
-        (((newLeft @ top) extent:newExtent) containsPoint:self graphicsDevice pointerPosition
+        (((newLeft @ top) extent:newExtent) containsPoint:device pointerPosition
         ) ifFalse:[
             newLeft := left
         ].
         newLeft < 0 ifTrue:[newLeft := 0].
-        screenWidth := self graphicsDevice usableWidth.
+        screenWidth := device usableWidth.
         newLeft + newExtent x > screenWidth ifTrue:[
             newLeft := screenWidth - newExtent x
         ].
@@ -471,7 +471,7 @@
 
     |r|
 
-    r := self graphicsDevice rectangleFromUser:(self origin corner:self corner) keepExtent:true.
+    r := device rectangleFromUser:(self origin corner:self corner) keepExtent:true.
     shadowView notNil ifTrue:[
         shadowView unmap
     ].
@@ -492,7 +492,7 @@
 
     |r|
 
-    r := self graphicsDevice rectangleFromUser:(self origin corner:self corner).
+    r := device rectangleFromUser:(self origin corner:self corner).
     shadowView notNil ifTrue:[
         shadowView unmap
     ].
@@ -596,7 +596,7 @@
          We need a short delay here, since at this time, the expose event has
          not yet arrived.
         "
-        self graphicsDevice sync.     "/ thats a round trip, to ensure that all expose events are present..."
+        device sync.     "/ thats a round trip, to ensure that all expose events are present..."
         Delay waitForSeconds:0.05.
         masterGroup processExposeEvents
     ].
@@ -764,7 +764,7 @@
 showAtCenter
     "make myself visible at the screen center."
 
-    self showAt:(self graphicsDevice centerOfMonitorHavingPointer) center:true
+    self showAt:(device centerOfMonitorHavingPointer) center:true
 
     "
      |b|
@@ -783,14 +783,14 @@
     |first pointerPosition positionOffset pos monitorBounds alignedPos|
 
     "/ ****** MULTI SCREEN
-    pointerPosition := self graphicsDevice pointerPosition.
+    pointerPosition := device pointerPosition.
 
     self fixSize.
     positionOffset := self positionOffset.
     pos := alignedPos := pointerPosition - positionOffset.
 
     UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
-        monitorBounds := self graphicsDevice monitorBoundsAt:pointerPosition.
+        monitorBounds := device monitorBoundsAt:pointerPosition.
         alignedPos := (pos x max:monitorBounds left) @ (pos y max:monitorBounds top).
     ].
 
@@ -821,7 +821,7 @@
     ].
 
     "/ cannot use:
-    "/    self showAt:(self graphicsDevice pointerPosition - self positionOffset).
+    "/    self showAt:(device pointerPosition - self positionOffset).
     "/ because the resizing must be done before the
     "/ positionOffset is grabbed (it may change due to the resize)
 
@@ -843,7 +843,7 @@
 
     |pos newX|
 
-    pos := self graphicsDevice pointerPosition - self positionOffset.
+    pos := device pointerPosition - self positionOffset.
 
     ((Rectangle origin:pos extent:self extent)
         intersects: (aView origin corner: aView corner))
@@ -852,8 +852,8 @@
          try to the right of the untouchable view
         "
         newX := (aView origin x + aView width).
-        newX + width > self graphicsDevice usableWidth ifTrue:[
-            newX := self graphicsDevice usableWidth - width
+        newX + width > device usableWidth ifTrue:[
+            newX := device usableWidth - width
         ].
         pos x:newX.