SWT ScrolledComposite cutting off information.

本小妞迷上赌 提交于 2019-12-01 20:26:32

I'm assuming here that you're using Windows, because there is a fairly general problem with scrollbars on Windows: the maximum value is a short int, 32,768. Therefore, if the height of the inner composite of a ScrolledComposite is greater than 32,768 pixels, the composite will be clipped.

I haven't found a robust way of fixing this, but there is a workaround: separate the scrollbar from the composite that you wish to scroll. You can't create a ScrollBar, but you can make a ScrolledComposite that is precisely as wide as a ScrollBar, then attach a ScrollListener to it and have it adjust the layout position of the scrolling composite.

Somewhere I have a snippet, but I'm not even exactly sure if this diagnosis applies to your scenario.

You might need to set the minimum and maximum values of the ScrollBar. You would use the setMinimum() and setMaximum() methods, respectively.

It's also a good idea to set the page increment. This is the number of scroll lines that the selected value changes by when the user clicks the area between the thumb and the arrow buttons, or presses the Page Up or Page Down buttons. You would use the setPageIncrement() method.

Finally, Oracle may impose a maximum number of rows you can retrieve from a table. I believe the default is 500 rows.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!