GWT SplitLayoutPanel拖动分割器太疯狂了

时间:2012-12-18 14:36:33

标签: gwt

喜欢Need GWT SplitLayoutPanel to have max size, dragging is very jumpy我想知道为什么右边和右边的分割器在尝试拖动以下示例中的分割器时会跳转(在IE9中进行测试;在Web和托管模式下测试):

public class SplitLayoutPanelTest implements EntryPoint {
    public void onModuleLoad() {
        final SplitLayoutPanel p = new SplitLayoutPanel(5);
        p.setSize(Window.getClientWidth()+"px", Window.getClientHeight()+"px");
        final Frame fWest = new Frame("http://bsd.org");
        fWest.setSize("400px", "200px");
        p.insertWest(fWest, 400, null);
        final Frame fEast = new Frame("http://www.linux.org");
        fEast.setSize("90px", "90px");
        p.insertEast(fEast, 100, null);
        final Frame fNorth = new Frame("http://www.w3c.org");
        fNorth.setSize("80px", "80px");
        p.insertNorth(fNorth, 100, null);
        final Frame fSouth = new Frame("http://www.sqlite.org");
        fSouth.setSize("85px", "85px");
        p.insertSouth(fSouth, 100, null);
        final Frame fCenter = new Frame("http://www.gnu.org");
        fCenter.setSize("75px", "75px");
        p.insert(fCenter, Direction.CENTER, 200, null);
        RootPanel.get().add(p);
    }
}

有什么想法吗?

2 个答案:

答案 0 :(得分:1)

中查看此答案

Need GWT SplitLayoutPanel to have max size, dragging is very jumpy

我希望这也解决了你的问题,祝你好运

答案 1 :(得分:0)

所以这是一个可能的解决方案:

public class SplitLayoutPanelTest implements EntryPoint {
    public void onModuleLoad() {
        final SplitLayoutPanel p = new SplitLayoutPanel(5);
        p.setSize(Window.getClientWidth()+"px", Window.getClientHeight()+"px");

        final Frame fWest = new Frame("http://bsd.org");
        final VerticalPanel pWest = new VerticalPanel();
        pWest.setSize("100%", "100%");
        pWest.add(fWest);
        p.insertWest(pWest, 400, null);
        fWest.setSize("400px", "200px");

        final Frame fEast = new Frame("http://www.linux.org");
        final VerticalPanel pEast = new VerticalPanel();
        pEast.setSize("100%", "100%");
        pEast.add(fEast);
        p.insertEast(pEast, 100, null);
        fEast.setSize("90px", "90px");

        final Frame fNorth = new Frame("http://www.w3c.org");
        final VerticalPanel pNorth = new VerticalPanel();
        pNorth.setSize("100%", "100%");
        pNorth.add(fNorth);
        p.insertNorth(pNorth, 100, null);
        fNorth.setSize("80px", "80px");

        final Frame fSouth = new Frame("http://www.sqlite.org");
        final VerticalPanel pSouth = new VerticalPanel();
        pSouth.setSize("100%", "100%");
        pSouth.add(fSouth);
        p.insertSouth(pSouth, 100, null);
        fSouth.setSize("85px", "85px");

        final Frame fCenter = new Frame("http://www.gnu.org");
        final VerticalPanel pCenter = new VerticalPanel();
        pCenter.setSize("100%", "100%");
        pCenter.add(fCenter);
        p.insert(pCenter, Direction.CENTER, 200, null);
        fCenter.setSize("75px", "75px");

        RootPanel.get().add(p);
    }
}