1

I have a ScrolledComposite which is a bit like an spreadsheet. It works mostly without problems, but I sometimes have a large field that fills almost an entire row (the rightmost part).

When focus is on this field, and setShowFocusedControl(true) has been called, swt insists on showing the rightmost part of the field, which has the same effect as scrolling all the way to the right on a big spreadsheet - it is very annoying for the user, as the field rarely has very much text in it.

So the strategy chosen in the code is to setShowFocusedControl on and off all the time, which is very bug-prone.

Can someone suggest a better strategy? Can I make swt show the leftmost part of the focussed field?

4

1 回答 1

1

you can use setOrigin(Point) or setOrigin(int, int) on the ScrolledComposite to set the origin of the scrolled content at the top left.

于 2009-05-07T13:16:03.050 回答