Tools__CodeView2.st
branchjv
changeset 16624 2315cabbf137
parent 16617 69e7de1ef22f
parent 16622 8221b93bf0ad
child 16869 2ecababdd4c0
equal deleted inserted replaced
16617:69e7de1ef22f 16624:2315cabbf137
  1090 
  1090 
  1091 updateScrollersViewBackground
  1091 updateScrollersViewBackground
  1092     "this changes the scroller's background, to show the positions of
  1092     "this changes the scroller's background, to show the positions of
  1093      warnings, for easy location of interesting spots"
  1093      warnings, for easy location of interesting spots"
  1094      
  1094      
  1095     |allAnnotations scroller newBackground bla|
  1095     |allAnnotations scroller newBackground|
  1096 
  1096 
  1097     allAnnotations := OrderedCollection new.
  1097     allAnnotations := OrderedCollection new.
  1098     services do:[:eachService |
  1098     services do:[:eachService |
  1099         allAnnotations addAll:(eachService annotations ? #())
  1099         allAnnotations addAll:(eachService annotations ? #())
  1100     ].
  1100     ].
  1101 
  1101 
  1102     scroller := textViewScroller verticalScrollBar thumb.
  1102     scroller := textViewScroller verticalScrollBar thumb.
  1103     allAnnotations isEmptyOrNil ifTrue:[
  1103     allAnnotations isEmptyOrNil ifTrue:[
  1104         "/ nothing special to show
  1104         "/ nothing special to show
  1105         newBackground := scroller backgroundColor
  1105         scroller viewBackground isColor ifTrue:[^ self].
       
  1106         scroller initStyle
  1106     ] ifFalse:[
  1107     ] ifFalse:[
  1107         "/ yep, there are some annotations
  1108         "/ yep, there are some annotations
  1108         newBackground := (AnnotationShowingScrollerBackground new annotations:allAnnotations; textView:textView; yourself )
  1109         newBackground := (AnnotationShowingScrollerBackground new annotations:allAnnotations; textView:textView; yourself ).
  1109     ].
  1110         scroller viewBackground:newBackground.
  1110     scroller viewBackground:newBackground.
  1111     ].
       
  1112     scroller invalidate.
  1111 ! !
  1113 ! !
  1112 
  1114 
  1113 !CodeView2 methodsFor:'channels'!
  1115 !CodeView2 methodsFor:'channels'!
  1114 
  1116 
  1115 modifiedChannel
  1117 modifiedChannel
  2297 ! !
  2299 ! !
  2298 
  2300 
  2299 !CodeView2::AnnotationShowingScrollerBackground methodsFor:'drawing'!
  2301 !CodeView2::AnnotationShowingScrollerBackground methodsFor:'drawing'!
  2300 
  2302 
  2301 fillRectangleX:x y:y width:w height:h in:aScroller
  2303 fillRectangleX:x y:y width:w height:h in:aScroller
       
  2304     "I am asked to draw the background of aScroller.
       
  2305      If any annotation is in that range, draw it"
       
  2306     
  2302     |overAllHeight|
  2307     |overAllHeight|
  2303 
  2308 
  2304     annotations isEmptyOrNil ifTrue:[^ self ].
  2309     annotations isEmptyOrNil ifTrue:[^ self ].
  2305 
  2310 
  2306     overAllHeight := textView numberOfLines.
  2311     overAllHeight := textView numberOfLines.
  2325                 clr1 := baseColor lightened lightened.
  2330                 clr1 := baseColor lightened lightened.
  2326                 clr2 := clr1 darkened.
  2331                 clr2 := clr1 darkened.
  2327                 aScroller paint:clr1.
  2332                 aScroller paint:clr1.
  2328                 aScroller fillRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:8.
  2333                 aScroller fillRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:8.
  2329                 aScroller paint:clr2.
  2334                 aScroller paint:clr2.
  2330                 aScroller displayRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:10.
  2335                 aScroller displayRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:9.
  2331             ].
  2336             ].
  2332         ].
  2337         ].
  2333     ]
  2338     ]
  2334 ! !
  2339 ! !
  2335 
  2340