Hi,
I think there is a bug in ScrollingDecorator when both the horizontal
and vertical bars are displayed. To see the bug, follow these steps:
- Open a browser and switch to the Class Diagram plugin.
- Select a class like AXTypeInfoObject which has a few subclasses.
- Make the Class Diagram window narrow enough so that both scroll bars
appear.
- Try scrolling the vertical scroll bar down.
I am unable to scroll to the bottom. It looks like it scrolls down, but
then jumps back up.
A possible fix is below ... what I found is the vertical scroll does
take place, but is reversed when the complete view re-layout takes
place. I think this is caused when the layoutContext, for the complete
view re-layout, is asked for #clientExtentOf:. The position is already
present in the layout, so it asks the view for
#calcClientRectangleFromRectangle:. This uses the result from
#calcRectangleFromClientRectangle:, however the MSDN docs for
AdjustWindowRect say that it does not take into account the WS_VSCROLL
or WS_HSCROLL styles.
A possible fix is:
!ScrollingDecorator methodsFor!
calcRectangleFromClientRectangle: aRectangle
"Adjust the result for the scrollbars as per:
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/adjustwindowrect.asp?frame=true."
| unadjusted isShowingHScroll isShowingVScroll |
unadjusted := super calcRectangleFromClientRectangle: aRectangle.
"< ? .... msdn: not show if 'page size that includes the entire scroll
range' "
isShowingHScroll := (self getScrollPage: SB_HORZ) < self
horizontalRange size.
isShowingVScroll := (self getScrollPage: SB_VERT) < self verticalRange
size.
^unadjusted expandBy: (Point zero
corner: (isShowingVScroll ifTrue: [SystemMetrics current
scrollbarWidth] ifFalse: [0])
@ (isShowingHScroll ifTrue: [SystemMetrics current
nonClientMetrics iScrollHeight] ifFalse: [0])).! !
Thanks,
Steve