带滚动条的 GXT LayoutContainer 报告客户端高度值,其中包括滚动条下方的区域

发布于 2024-08-25 19:10:40 字数 1397 浏览 3 评论 0原文

我有这段代码,它设置了一个“主”容器,应用程序的其他模块将进入该容器。

    LayoutContainer c = new LayoutContainer();
    c.setScrollMode(Scroll.ALWAYS);
    parentContainer.add(c, <...>);

然后,我将以下内容作为事件处理程序。

    pContainer = c; // pContainer is actually a parameter, but it has c's value

    pContainer.removeAll();
    pContainer.setLayout(new FitLayout());

    LayoutContainer wrapperContainer = new LayoutContainer();
    wrapperContainer.setLayout(new BorderLayout());
    wrapperContainer.setBorders(false);
    pContainer.add(wrapperContainer);

    LayoutContainer west = pWestContentContainer;

    BorderLayoutData westLayoutData = new BorderLayoutData(LayoutRegion.WEST);
    westLayoutData.setSize(pWidth);
    westLayoutData.setSplit(true);
    wrapperContainer.add(west, westLayoutData);

    LayoutContainer center = new LayoutContainer();
    wrapperContainer.add(center, new BorderLayoutData(LayoutRegion.CENTER));

    pCallback.withSplitContainer(center);
    pContainer.layout();

因此,实际上,此处名为“west”的容器将是显示模块 UI 的位置。然后,该模块 UI 对两个子项执行简单的行布局。底部子项具有 RowData(1, 1),因此它填满了所有可用空间。

我的问题是 c (父)容器报告高度和宽度值,其中包括滚动条下方的值。我想要的是滚动条显示除其自己的空间之外的所有空间。

这是一个屏幕截图,显示了我的意思: 替代文本 http://img265.imageshack.us/img265/9206/scrollbar.png< /a>

I have this code which sets up a "main" container into which other modules of the application will go.

    LayoutContainer c = new LayoutContainer();
    c.setScrollMode(Scroll.ALWAYS);
    parentContainer.add(c, <...>);

Then later on, I have the following as an event handler

    pContainer = c; // pContainer is actually a parameter, but it has c's value

    pContainer.removeAll();
    pContainer.setLayout(new FitLayout());

    LayoutContainer wrapperContainer = new LayoutContainer();
    wrapperContainer.setLayout(new BorderLayout());
    wrapperContainer.setBorders(false);
    pContainer.add(wrapperContainer);

    LayoutContainer west = pWestContentContainer;

    BorderLayoutData westLayoutData = new BorderLayoutData(LayoutRegion.WEST);
    westLayoutData.setSize(pWidth);
    westLayoutData.setSplit(true);
    wrapperContainer.add(west, westLayoutData);

    LayoutContainer center = new LayoutContainer();
    wrapperContainer.add(center, new BorderLayoutData(LayoutRegion.CENTER));

    pCallback.withSplitContainer(center);
    pContainer.layout();

So in effect, the container called 'west' here will be where the module's UI gets displayed. That module UI then does a simple rowlayout with two children. The botton child has RowData(1, 1) so it fills up all the available space.

My problem is that the c (parent) container reports a height and width value which includes the value underneath the scrollbars. What I would like is that the scrollbars show all the space excluding their own space.

This is a screenshot showing what I mean:
alt text http://img265.imageshack.us/img265/9206/scrollbar.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心清如水 2024-09-01 19:10:40

尝试添加相当于滚动条大小 14px 的内边距?在应用 Scroll.Always 的容器上

Try adding padding equivalent to the scroll bars size 14px? on the container where the Scroll.Always is being applied

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文