Scroller.st
changeset 24 966098a893f8
parent 22 ac872628ef2d
child 38 4b9b70b2cc87
equal deleted inserted replaced
23:69f1ba57f67a 24:966098a893f8
    30 Scroller comment:'
    30 Scroller comment:'
    31 
    31 
    32 COPYRIGHT (c) 1989 by Claus Gittinger
    32 COPYRIGHT (c) 1989 by Claus Gittinger
    33               All Rights Reserved
    33               All Rights Reserved
    34 
    34 
    35 $Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.5 1994-01-08 17:29:48 claus Exp $
    35 $Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.6 1994-01-13 00:18:10 claus Exp $
    36 
    36 
    37 written spring/summer 89 by claus
    37 written spring/summer 89 by claus
    38 '!
    38 '!
    39 
    39 
    40 !Scroller class methodsFor:'documentation'!
    40 !Scroller class methodsFor:'documentation'!
   151     thumbOrigin := 0.
   151     thumbOrigin := 0.
   152     thumbHeight := 100.
   152     thumbHeight := 100.
   153 
   153 
   154     inset := 1.
   154     inset := 1.
   155 
   155 
   156     self initStyle.
       
   157     self computeThumbFrame
   156     self computeThumbFrame
   158 !
   157 !
   159 
   158 
   160 initStyle
   159 initStyle
   161     "initialize style dep. stuff"
   160     "initialize style dep. stuff"
   346 
   345 
   347                 self copyFrom:self x:left y:oldTop
   346                 self copyFrom:self x:left y:oldTop
   348                                  toX:left y:thumbTop
   347                                  toX:left y:thumbTop
   349                                width:tW height:tH.
   348                                width:tW height:tH.
   350 
   349 
       
   350                 self catchExpose.
       
   351 
   351                 oldTop > thumbTop ifTrue:[
   352                 oldTop > thumbTop ifTrue:[
   352                     delta := oldTop - thumbTop.
   353                     delta := oldTop - thumbTop.
   353                     oldTop > thumbBot ifTrue:[
   354                     oldTop > thumbBot ifTrue:[
   354                         self drawThumbBackgroundInX:left y:oldTop
   355                         self drawThumbBackgroundInX:left y:oldTop
   355                                               width:tW height:(tH + 1)
   356                                               width:tW height:(tH + 1)
   365                     ] ifFalse:[
   366                     ] ifFalse:[
   366                         self drawThumbBackgroundInX:left y:oldTop 
   367                         self drawThumbBackgroundInX:left y:oldTop 
   367                                               width:tW height:delta
   368                                               width:tW height:delta
   368                     ]
   369                     ]
   369                 ].
   370                 ].
   370                 "self is3D ifTrue:[ "
   371                 self waitForExpose
   371                     self waitForExpose
       
   372                 "] "
       
   373             ]
   372             ]
   374         ]
   373         ]
   375     ]
   374     ]
   376 !
   375 !
   377 
   376 
   672     ((thumbShadowColor colorId notNil)
   671     ((thumbShadowColor colorId notNil)
   673      and:[(thumbLightColor colorId notNil)
   672      and:[(thumbLightColor colorId notNil)
   674          and:[thumbColor colorId notNil]])
   673          and:[thumbColor colorId notNil]])
   675      ifTrue:[
   674      ifTrue:[
   676         self foreground:thumbColor background:(Color noColor) function:#xor.
   675         self foreground:thumbColor background:(Color noColor) function:#xor.
   677         self drawOpaqueForm:shadowForm x:x y:y.
   676         self displayOpaqueForm:shadowForm x:x y:y.
   678         self foreground:thumbShadowColor function:#or.
   677         self foreground:thumbShadowColor function:#or.
   679         self drawOpaqueForm:shadowForm x:x y:y.
   678         self displayOpaqueForm:shadowForm x:x y:y.
   680         self foreground:thumbColor function:#xor.
   679         self foreground:thumbColor function:#xor.
   681         self drawOpaqueForm:lightForm x:x y:y.
   680         self displayOpaqueForm:lightForm x:x y:y.
   682         self foreground:thumbLightColor function:#or.
   681         self foreground:thumbLightColor function:#or.
   683         self drawOpaqueForm:lightForm x:x y:y.
   682         self displayOpaqueForm:lightForm x:x y:y.
   684         self foreground:oldFg background:oldBg function:#copy
   683         self foreground:oldFg background:oldBg function:#copy
   685     ] ifFalse:[
   684     ] ifFalse:[
   686 false ifTrue:[
   685 false ifTrue:[
   687         "turn off shadow bits"
   686         "turn off shadow bits"
   688         self foreground:(Color noColor) background:(Color allColor) function:#and.
   687         self foreground:(Color noColor) background:(Color allColor) function:#and.
   689 
   688 
   690         self drawOpaqueForm:shadowForm x:x y:y.
   689         self displayOpaqueForm:shadowForm x:x y:y.
   691         "turn off light bits"
   690         "turn off light bits"
   692         self drawOpaqueForm:lightForm x:x y:y.
   691         self displayOpaqueForm:lightForm x:x y:y.
   693 
   692 
   694         "draw shadow bits"
   693         "draw shadow bits"
   695         self paint:shadowColor.
   694         self paint:shadowColor.
   696         self function:#or.
   695         self function:#or.
   697         self drawOpaqueForm:shadowForm x:x y:y.
   696         self displayOpaqueForm:shadowForm x:x y:y.
   698 
   697 
   699         "draw light bits"
   698         "draw light bits"
   700         self paint:lightColor.
   699         self paint:lightColor.
   701         self drawOpaqueForm:lightForm x:x y:y.
   700         self displayOpaqueForm:lightForm x:x y:y.
   702         self foreground:oldFg background:oldBg function:oldFun
   701         self foreground:oldFg background:oldBg function:oldFun
   703 ]
   702 ]
   704     ]
   703     ]
   705 !
   704 !
   706 
   705 
   730     self paint:thumbColor.
   729     self paint:thumbColor.
   731     self fillRectangleX:l y:t width:w height:h.
   730     self fillRectangleX:l y:t width:w height:h.
   732 
   731 
   733     self is3D ifFalse:[
   732     self is3D ifFalse:[
   734         self paint:thumbFrameColor.
   733         self paint:thumbFrameColor.
   735         self drawRectangle:thumbFrame.
   734         self displayRectangle:thumbFrame.
   736         ^ self
   735         ^ self
   737     ].
   736     ].
   738 
   737 
   739     "what a kludge - must be a parameter to drawEdge..."
   738     "what a kludge - must be a parameter to drawEdge..."
   740     savEdge := softEdge.
   739     savEdge := softEdge.