ThumbWheel.st
changeset 5429 d722dd969628
parent 5259 972f06c48edb
child 5773 96d70d18af18
equal deleted inserted replaced
5428:31afef66bfb5 5429:d722dd969628
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
     2  COPYRIGHT (c) 1996 by eXept Software AG / Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   454     y0 := 4.
   452     y0 := 4.
   455     y1 := height - 4.
   453     y1 := height - 4.
   456     x0 := 4.
   454     x0 := 4.
   457     x1 := width - 4.
   455     x1 := width - 4.
   458 
   456 
   459     self paint:viewBackground. "/ View defaultViewBackgroundColor.
   457     gc paint:viewBackground. "/ View defaultViewBackgroundColor.
   460     self fillRectangleX:x y:y width:w height:h.
   458     gc fillRectangleX:x y:y width:w height:h.
   461 
   459 
   462     thumbColor := View defaultViewBackgroundColor.
   460     thumbColor := View defaultViewBackgroundColor.
   463     thumbColor ~= viewBackground ifTrue:[
   461     thumbColor ~= viewBackground ifTrue:[
   464         self paint:thumbColor.
   462         gc paint:thumbColor.
   465         orientation == #vertical ifTrue:[
   463         orientation == #vertical ifTrue:[
   466             self fillRectangleX:3 y:y0 width:width-6 height:height-8.
   464             gc fillRectangleX:3 y:y0 width:width-6 height:height-8.
   467         ] ifFalse:[
   465         ] ifFalse:[
   468             self fillRectangleX:x0 y:3 width:width-8 height:height-6.
   466             gc fillRectangleX:x0 y:3 width:width-8 height:height-6.
   469         ]
   467         ]
   470     ].
   468     ].
   471 
   469 
   472     ((thumbPosition truncateTo:tallyAngle))
   470     ((thumbPosition truncateTo:tallyAngle))
   473     to:((thumbPosition + angleRange truncateTo:tallyAngle)+tallyAngle) by:tallyAngle do:[:a |
   471     to:((thumbPosition + angleRange truncateTo:tallyAngle)+tallyAngle) by:tallyAngle do:[:a |
   480 
   478 
   481         xT := xT min:x1.
   479         xT := xT min:x1.
   482         yT := yT min:y1.
   480         yT := yT min:y1.
   483 
   481 
   484         (pA > (angleRange * 7 // 8)) ifTrue:[
   482         (pA > (angleRange * 7 // 8)) ifTrue:[
   485             self paint:shadowColor
   483             gc paint:shadowColor
   486         ] ifFalse:[
   484         ] ifFalse:[
   487             self paint:self blackColor.
   485             gc paint:self blackColor.
   488         ].
   486         ].
   489 
   487 
   490         orientation == #vertical ifTrue:[
   488         orientation == #vertical ifTrue:[
   491             self displayLineFromX:3 y:yT toX:width-4 y:yT.
   489             gc displayLineFromX:3 y:yT toX:width-4 y:yT.
   492         ] ifFalse:[
   490         ] ifFalse:[
   493             self displayLineFromX:xT y:3 toX:xT y:height-4.
   491             gc displayLineFromX:xT y:3 toX:xT y:height-4.
   494         ].
   492         ].
   495 
   493 
   496         (pA between:(angleRange * 4 // 8) and:(angleRange * 7 // 8)) ifTrue:[
   494         (pA between:(angleRange * 4 // 8) and:(angleRange * 7 // 8)) ifTrue:[
   497             self paint:self whiteColor.
   495             gc paint:self whiteColor.
   498             orientation == #vertical ifTrue:[
   496             orientation == #vertical ifTrue:[
   499                 self displayLineFromX:3 y:yT-1 toX:width-5 y:yT-1.
   497                 gc displayLineFromX:3 y:yT-1 toX:width-5 y:yT-1.
   500             ] ifFalse:[
   498             ] ifFalse:[
   501                 self displayLineFromX:xT-1 y:3 toX:xT-1 y:height-5.
   499                 gc displayLineFromX:xT-1 y:3 toX:xT-1 y:height-5.
   502             ].
   500             ].
   503 
   501 
   504             (pA between:(angleRange * 4 // 8) and:(angleRange * 6 // 8)) ifTrue:[
   502             (pA between:(angleRange * 4 // 8) and:(angleRange * 6 // 8)) ifTrue:[
   505                 self paint:self whiteColor.
   503                 gc paint:self whiteColor.
   506                 orientation == #vertical ifTrue:[
   504                 orientation == #vertical ifTrue:[
   507                     self displayLineFromX:3 y:yT-2 toX:width-5 y:yT-2.
   505                     gc displayLineFromX:3 y:yT-2 toX:width-5 y:yT-2.
   508                 ] ifFalse:[
   506                 ] ifFalse:[
   509                     self displayLineFromX:xT-2 y:3 toX:xT-2 y:height-5.
   507                     gc displayLineFromX:xT-2 y:3 toX:xT-2 y:height-5.
   510                 ]
   508                 ]
   511             ]
   509             ]
   512         ]
   510         ]
   513     ].
   511     ].
   514 
   512 
   515     self paint:self whiteColor. "/lightColor.
   513     gc paint:self whiteColor. "/lightColor.
   516     orientation == #vertical ifTrue:[
   514     orientation == #vertical ifTrue:[
   517         self displayLineFromX:2 y:y0 toX:2 y:y1.
   515         gc displayLineFromX:2 y:y0 toX:2 y:y1.
   518     ] ifFalse:[
   516     ] ifFalse:[
   519         self displayLineFromX:x0 y:2 toX:x1 y:2.
   517         gc displayLineFromX:x0 y:2 toX:x1 y:2.
   520     ].
   518     ].
   521 
   519 
   522     self paint:shadowColor.
   520     gc paint:shadowColor.
   523     orientation == #vertical ifTrue:[
   521     orientation == #vertical ifTrue:[
   524         self displayLineFromX:width-4 y:y0 toX:width-4 y:y1.
   522         gc displayLineFromX:width-4 y:y0 toX:width-4 y:y1.
   525     ] ifFalse:[
   523     ] ifFalse:[
   526         self displayLineFromX:x0 y:height-4 toX:x1 y:height-4.
   524         gc displayLineFromX:x0 y:height-4 toX:x1 y:height-4.
   527     ].
   525     ].
   528     self displayLineFromX:width-4 y:y0-1 toX:width-4 y:y1+1.
   526     gc displayLineFromX:width-4 y:y0-1 toX:width-4 y:y1+1.
   529 
   527 
   530     orientation == #vertical ifTrue:[
   528     orientation == #vertical ifTrue:[
   531         self displayLineFromX:width-4 y:y0 toX:width-4 y:y1.
   529         gc displayLineFromX:width-4 y:y0 toX:width-4 y:y1.
   532     ] ifFalse:[
   530     ] ifFalse:[
   533         self displayLineFromX:x0 y:height-4 toX:x1 y:height-4.
   531         gc displayLineFromX:x0 y:height-4 toX:x1 y:height-4.
   534     ].
   532     ].
   535 
   533 
   536     "Created: / 27.9.1996 / 16:04:49 / cg"
   534     "Created: / 27.9.1996 / 16:04:49 / cg"
   537     "Modified: / 6.6.1998 / 23:30:38 / cg"
   535     "Modified: / 6.6.1998 / 23:30:38 / cg"
   538 ! !
   536 ! !