ActiveHelpView.st
changeset 3316 cbfe39899129
parent 3314 552383bb5952
child 3318 20b0c3ec22d7
--- a/ActiveHelpView.st	Wed Mar 19 11:04:20 2014 +0100
+++ b/ActiveHelpView.st	Wed Mar 19 11:05:12 2014 +0100
@@ -253,109 +253,111 @@
     "compute the shape, based upon the size of my component view"
 
     |extent oldOrigin shapeForm borderForm y1 bw h w mirrorH mirrorV
-     p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition|
+     p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition graphicsDevice|
 
-    (shapeStyle == #cartoon) ifTrue:[
-        self graphicsDevice supportsArbitraryShapedViews ifTrue:[
-            extent := self extent.
-            oldOrigin := self origin.
-            h := extent y.
-            w := extent x.
-            bw := 4.
-            offs := 0.
-            mousePosition := device pointerPosition.
+    (shapeStyle == #cartoon) ifFalse:[
+        ^ self.
+    ].
+    graphicsDevice := self graphicsDevice.
+    graphicsDevice supportsArbitraryShapedViews ifTrue:[
+        extent := self extent.
+        oldOrigin := self origin.
+        h := extent y.
+        w := extent x.
+        bw := 4.
+        offs := 0.
+        mousePosition := graphicsDevice pointerPosition.
 
-            ((mousePosition > (device width * (2/3)))
-            or:[ self corner x > device usableWidth ]) ifTrue:[
-                mirrorH := true.
-                self origin:((oldOrigin x - w) @ (self origin y)).
-                offs := bw * 2.
-            ] ifFalse:[
-                mirrorH := false
-            ].
-            ((mousePosition > (device height * (2/3)))
-            or:[ self corner y > device usableHeight ]) ifTrue:[
-                mirrorV := true.
-                self origin:(oldOrigin x @ (self origin y - h)).
-            ] ifFalse:[
-                mirrorV := false
-            ].
+        ((mousePosition > (graphicsDevice width * (2/3)))
+        or:[ self corner x > graphicsDevice usableWidth ]) ifTrue:[
+            mirrorH := true.
+            self origin:((oldOrigin x - w) @ (self origin y)).
+            offs := bw * 2.
+        ] ifFalse:[
+            mirrorH := false
+        ].
+        ((mousePosition > (graphicsDevice height * (2/3)))
+        or:[ self corner y > graphicsDevice usableHeight ]) ifTrue:[
+            mirrorV := true.
+            self origin:(oldOrigin x @ (self origin y - h)).
+        ] ifFalse:[
+            mirrorV := false
+        ].
 
-            borderForm := Form width:w height:h.
-            shapeForm := Form width:w height:h.
-            borderForm fill:(Color noColor).
-            shapeForm fill:(Color noColor).
+        borderForm := Form width:w height:h.
+        shapeForm := Form width:w height:h.
+        borderForm fill:(Color noColor).
+        shapeForm fill:(Color noColor).
 
-            hEll := (h // 3 * 2).
+        hEll := (h // 3 * 2).
 
-            mirrorV ifTrue:[
-                y1 := 0.
-            ] ifFalse:[
-                y1 := h // 4.
-            ].
+        mirrorV ifTrue:[
+            y1 := 0.
+        ] ifFalse:[
+            y1 := h // 4.
+        ].
 
-            borderForm fillArcX:0 y:y1 
-                       width:w height:hEll
-                       from:0 angle:360.
+        borderForm fillArcX:0 y:y1 
+                   width:w height:hEll
+                   from:0 angle:360.
 
-            myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
-
-            h2 := h // 2.
-            w2 := w // 2.
-            w8 := w // 8.
-            w78 := w * 7 // 8.
+        myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
 
-            mirrorH ifTrue:[
-                mirrorV ifTrue:[
-                    p1 := w @ h. 
-                    p2 := (w78 @ h2).
-                    p3 := (w2 @ h2).
-                    pB1 := (w-bw) @ (h-bw). 
-                    pB2 := ((w78 - bw) @ (h2 - bw)).
-                    pB3 := ((w2 + bw) @ (h2 - bw))
-                ] ifFalse:[
-                    p1 := w @ 0. 
-                    p2 := (w78 @ h2).
-                    p3 := (w2 @ h2).
-                    pB1 := (w-bw) @ bw. 
-                    pB2 := ((w78 - bw) @ (h2 + bw)).
-                    pB3 := ((w2 + bw) @ (h2 + bw))
-                ]
+        h2 := h // 2.
+        w2 := w // 2.
+        w8 := w // 8.
+        w78 := w * 7 // 8.
+
+        mirrorH ifTrue:[
+            mirrorV ifTrue:[
+                p1 := w @ h. 
+                p2 := (w78 @ h2).
+                p3 := (w2 @ h2).
+                pB1 := (w-bw) @ (h-bw). 
+                pB2 := ((w78 - bw) @ (h2 - bw)).
+                pB3 := ((w2 + bw) @ (h2 - bw))
             ] ifFalse:[
-                mirrorV ifTrue:[
-                    p1 := 0@h. 
-                    p2 := (w8 @ h2). 
-                    p3 := (w2 @ h2).
-                    pB1 := bw@(h-bw). 
-                    pB2 := ((w8 + bw) @ (h2 - bw)). 
-                    pB3 := ((w2 - bw) @ (h2 - bw)).
-                ] ifFalse:[
-                    p1 := 0@0. 
-                    p2 := (w8 @ h2). 
-                    p3 := (w2 @ h2).
-                    pB1 := bw@bw. 
-                    pB2 := ((w8 + bw) @ (h2 + bw)). 
-                    pB3 := ((w2 - bw) @ (h2 + bw)).
-                ]
-            ].
+                p1 := w @ 0. 
+                p2 := (w78 @ h2).
+                p3 := (w2 @ h2).
+                pB1 := (w-bw) @ bw. 
+                pB2 := ((w78 - bw) @ (h2 + bw)).
+                pB3 := ((w2 + bw) @ (h2 + bw))
+            ]
+        ] ifFalse:[
+            mirrorV ifTrue:[
+                p1 := 0@h. 
+                p2 := (w8 @ h2). 
+                p3 := (w2 @ h2).
+                pB1 := bw@(h-bw). 
+                pB2 := ((w8 + bw) @ (h2 - bw)). 
+                pB3 := ((w2 - bw) @ (h2 - bw)).
+            ] ifFalse:[
+                p1 := 0@0. 
+                p2 := (w8 @ h2). 
+                p3 := (w2 @ h2).
+                pB1 := bw@bw. 
+                pB2 := ((w8 + bw) @ (h2 + bw)). 
+                pB3 := ((w2 - bw) @ (h2 + bw)).
+            ]
+        ].
 
-            borderForm fillPolygon:(Array with:p1 with:p2 with:p3).
-            shapeForm fillPolygon:(Array with:pB1 with:pB2 with:pB3).
+        borderForm fillPolygon:(Array with:p1 with:p2 with:p3).
+        shapeForm fillPolygon:(Array with:pB1 with:pB2 with:pB3).
 
-            shapeForm lineWidth:bw.
-            shapeForm paint:(Color noColor).
-            shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
+        shapeForm lineWidth:bw.
+        shapeForm paint:(Color noColor).
+        shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
 
-            shapeForm paint:(Color colorId:1).
-            shapeForm fillArcX:bw y:y1 + bw 
-                      width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2))
-                      from:0 angle:360.
-        ].
-        borderForm notNil ifTrue:[
-            self borderShape:borderForm.
-            self viewShape:shapeForm
-        ].
-    ]
+        shapeForm paint:(Color colorId:1).
+        shapeForm fillArcX:bw y:y1 + bw 
+                  width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2))
+                  from:0 angle:360.
+    ].
+    borderForm notNil ifTrue:[
+        self borderShape:borderForm.
+        self viewShape:shapeForm
+    ].
 
     "Modified: / 5.6.1999 / 21:41:01 / cg"
     "Modified: / 27.10.1999 / 13:45:45 / stefan"
@@ -397,10 +399,10 @@
 !ActiveHelpView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.44 2014-03-18 15:14:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.45 2014-03-19 10:05:12 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.44 2014-03-18 15:14:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.45 2014-03-19 10:05:12 stefan Exp $'
 ! !