ActiveHelpView.st
changeset 3224 ce24ea76ae05
parent 3223 2f47681f1d62
child 3242 f8d10ab0f301
equal deleted inserted replaced
3223:2f47681f1d62 3224:ce24ea76ae05
   226 !ActiveHelpView methodsFor:'private'!
   226 !ActiveHelpView methodsFor:'private'!
   227 
   227 
   228 computeShape
   228 computeShape
   229     "compute the shape, based upon the size of my component view"
   229     "compute the shape, based upon the size of my component view"
   230 
   230 
   231     |extent shapeForm borderForm y1 bw h w mirrorH mirrorV
   231     |extent oldOrigin shapeForm borderForm y1 bw h w mirrorH mirrorV
   232      p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition|
   232      p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition|
   233 
   233 
   234     device supportsArbitraryShapedViews ifTrue:[
   234     device supportsArbitraryShapedViews ifTrue:[
   235         (shapeStyle == #cartoon) ifTrue:[
   235         (shapeStyle == #cartoon) ifTrue:[
   236             extent := self extent.
   236             extent := self extent.
       
   237             oldOrigin := self origin.
   237             h := extent y.
   238             h := extent y.
   238             w := extent x.
   239             w := extent x.
   239             bw := 4.
   240             bw := 4.
   240             offs := 0.
   241             offs := 0.
   241             mousePosition := device pointerPosition.
   242             mousePosition := device pointerPosition.
   242 
   243 
   243             ((mousePosition > (device width * (2/3)))
   244             ((mousePosition > (device width * (2/3)))
   244             or:[ self corner x > device usableWidth ]) ifTrue:[
   245             or:[ self corner x > device usableWidth ]) ifTrue:[
   245                 mirrorH := true.
   246                 mirrorH := true.
   246                 self origin:((self origin x - w) @ (self origin y)).
   247                 self origin:((oldOrigin x - w) @ (self origin y)).
   247                 offs := bw * 2.
   248                 offs := bw * 2.
   248             ] ifFalse:[
   249             ] ifFalse:[
   249                 mirrorH := false
   250                 mirrorH := false
   250             ].
   251             ].
   251             ((mousePosition > (device height * (2/3)))
   252             ((mousePosition > (device height * (2/3)))
   252             or:[ self corner y > device usableHeight ]) ifTrue:[
   253             or:[ self corner y > device usableHeight ]) ifTrue:[
   253                 mirrorV := true.
   254                 mirrorV := true.
   254                 self origin:(self origin x @ (self origin y - h)).
   255                 self origin:(oldOrigin x @ (self origin y - h)).
   255             ] ifFalse:[
   256             ] ifFalse:[
   256                 mirrorV := false
   257                 mirrorV := false
   257             ].
   258             ].
   258 
   259 
   259             borderForm := Form width:w height:h.
   260             borderForm := Form width:w height:h.
   268             ] ifFalse:[
   269             ] ifFalse:[
   269                 y1 := h // 4.
   270                 y1 := h // 4.
   270             ].
   271             ].
   271 
   272 
   272             borderForm fillArcX:0 y:y1 
   273             borderForm fillArcX:0 y:y1 
   273                           width:w height:hEll
   274                        width:w height:hEll
   274                            from:0 angle:360.
   275                        from:0 angle:360.
   275 
   276 
   276             myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
   277             myView origin:(width - myView width // 2) @ (y1 + ((hEll - myView height) // 2)).
   277 
   278 
   278             h2 := h // 2.
   279             h2 := h // 2.
   279             w2 := w // 2.
   280             w2 := w // 2.
   321             shapeForm paint:(Color noColor).
   322             shapeForm paint:(Color noColor).
   322             shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
   323             shapeForm displayPolygon:(Array with:p3 with:p1 with:p2).
   323 
   324 
   324             shapeForm paint:(Color colorId:1).
   325             shapeForm paint:(Color colorId:1).
   325             shapeForm fillArcX:bw y:y1 + bw 
   326             shapeForm fillArcX:bw y:y1 + bw 
   326                          width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2))
   327                       width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2))
   327                           from:0 angle:360.
   328                       from:0 angle:360.
   328         ].
   329         ].
   329         borderForm notNil ifTrue:[
   330         borderForm notNil ifTrue:[
   330             self borderShape:borderForm.
   331             self borderShape:borderForm.
   331             self viewShape:shapeForm
   332             self viewShape:shapeForm
   332         ].
   333         ].
   366 ! !
   367 ! !
   367 
   368 
   368 !ActiveHelpView class methodsFor:'documentation'!
   369 !ActiveHelpView class methodsFor:'documentation'!
   369 
   370 
   370 version
   371 version
   371     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.35 2013-08-31 17:42:49 cg Exp $'
   372     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.36 2013-08-31 17:48:25 cg Exp $'
   372 !
   373 !
   373 
   374 
   374 version_CVS
   375 version_CVS
   375     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.35 2013-08-31 17:42:49 cg Exp $'
   376     ^ '$Header: /cvs/stx/stx/libview2/ActiveHelpView.st,v 1.36 2013-08-31 17:48:25 cg Exp $'
   376 ! !
   377 ! !
   377 
   378