SWT 复合材料最大尺寸
我有一个 ScrolledComposite,其内容被截断。我用 Google 搜索了一下,发现这是 Windows 上的一个已知问题。
我能找到的唯一建议的解决方法是使用 canvas.scroll 功能。
考虑到这个问题的年龄,我想知道是否有更好的解决方法?
谢谢你!
I have a ScrolledComposite, the contents of which are being truncated. I have Googled and am aware that it is a known issue on Windows.
The only suggested workaround I can find is to use the canvas.scroll functionality.
Given the age of the issue, I was wondering if there is a nicer workaround?
Thank you!
(EDIT: At the time of writing, the link was: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet48.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(您发布的链接给出了 400 错误)
不确定我的问题是否相同,但我也遇到了 ScrolledComposite 的截断问题。问题是,当我调整要滚动的 Composite 的大小并且滚动条变得可见时,控件没有考虑滚动条占用的空间。为了解决这个问题,我在滚动复合材料上的调整大小侦听器中添加了一种递归代码:
设置内容复合材料的大小后,检查滚动复合材料的滚动条(例如 getVerticalBar())是否刚刚变得可见。如果是这样,请将新的 Resize 事件发送到您的侦听器。这是我的代码的片段...
希望这有帮助!
编辑:哇,我没有注意到OP的日期。希望这最终能以任何方式帮助某人......
(the link you posted gave a 400 Error)
Not sure if my issue was the same, but I ran into a truncation issue with ScrolledComposite as well. The problem was that when I resized the Composite to be scrolled and the Scrollbar became visible, the controls didn't account for the space taken up by the scrollbar. To solve this, I added a kind-of recursive bit of code to my Resize listener on the scrolled composite:
After you have set the size of your content composite, check if the scrolledComposite's scrollbar (getVerticalBar() for example) has just become visible. If so, send a new Resize event to your listener. Here's a snippet from my code...
Hope this helps!
Edit: wow I didn't notice the date of the OP. Hope this ends up helping someone either way...