取消布局管理器中的滚动
我找不到以下问题的解决方案。我有自定义列表字段,它与布局管理器的边界重叠。列表字段使用来自管理器的导航事件,以使用特殊颜色突出显示当前选定的行。布局管理器配置为支持滚动。当我向下滚动拨轮时,布局管理器会调用滚动,然后将导航事件传递给其子项(列表字段)。它会导致不正确的滚动,因为管理器将整个列表向下滚动到其底部,隐藏顶部的列表行,包括所选行。
我想要的是在当前选定的列表行仍然可见时忽略滚动,否则使用它。
我正在使用 JDE 4.2.1
I can't find solution for the following problem. I have custom list field, which overlaps the boundaries of its layout manager. List field consumes navigation events from manager to highlight currently selected row with special color. Layout manager is configured to support scrolling. When I scroll trackwheel down, layout manager invokes scrolling and then passes navigation event to its child, the list field. It results in inproper scrolling, because manager scrolls the whole list down to its bottom hiding list rows on the top including the selected row.
What I want is to ignore scrolling while currently selected list row is still visible and employ it otherwise.
I'm using JDE 4.2.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设我们有 ListField 实现:
如果我们想以这种方式在上下字段中对齐此列表:
带滚动的ListField http://img6.imageshack.us/img6/7025/8800j.png
我们可以使用自定义管理器限制它的高度:
现在我们可以使用它:
在 eJDE 4.2.1.17 8800 上测试
Let's say we have ListField implementation:
If we want to align this list within upper and lower fields this way:
ListField with scroll http://img6.imageshack.us/img6/7025/8800j.png
we can limit it's height using custom manager:
Now we can use it:
Tested on eJDE 4.2.1.17 8800
这就是对我有帮助的解决方案。通过以这种特定方式覆盖 moveFocus,我设法修改布局管理器中滚动的默认行为 - 它跳过列表字段的第一项,使它们保持在顶部。
all here's the solution that helped me. By overriding moveFocus in such specific way I managed to modify default behavior of scrolling in layout manager - it skips first items of list field allowing them to stay on top.