取消布局管理器滚动

编程入门 行业动态 更新时间:2024-10-27 10:26:08
本文介绍了取消布局管理器滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法找到如下问题的解决方案。我有自定义列表场,重叠其布局管理器的边界。列表区域消费导航事件从管理强调当前所选行用特殊颜色。布局管理器被配置为支持滚动。当我滚动拨轮,布局管理器调用滚动,然后通过导航事件到其子,列表字段。它导致inproper滚动,因为经理滚动整个列表到顶部,包括选定行其底部隐藏列表行。

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.

我使用JDE 4.2.1

I'm using JDE 4.2.1

推荐答案

所有这里的,帮助我解决。通过在这种特殊的方式覆盖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.

public int moveFocus(int amount, int status, int time) { invalidate(getSelectedIndex()); int unused = super.moveFocus(amount, status, time); return Math.abs(unused) + 1; }

更多推荐

取消布局管理器滚动

本文发布于:2023-11-26 14:19:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634113.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:管理器   布局

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!