【问题标题】:SWT Section setTextClient Putting the Composite in the End of the Title BarSWT 部分 setTextClient 将组合放在标题栏的末尾
【发布时间】:2012-08-22 20:52:19
【问题描述】:

我试图在部分标题栏的末尾放置一个组合框,以便我使用 SWT 的 setTextClient(Control) 方法。 我可以在部分标题栏中看到该组件,但这是极端情况,但我不希望部分标题和 TitleBar 之间有太多空间。

用户界面-

从上图可以看出,AND和OR单选按钮在最后,Filter Title和Title Bar之间有一个空格。

下面是我用来实现相同的代码sn-p-

Composite toolbar = toolkit.createComposite(section, SWT.WRAP);
        RowLayout rlayout = new RowLayout(SWT.HORIZONTAL);
        toolbar.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_HAND));
        rlayout.marginLeft = 0;
        rlayout.marginRight = 0;
        rlayout.spacing = 0;
        rlayout.marginTop = 0;
        rlayout.marginBottom = 0;
        toolbar.setLayout(rlayout);

        Button A = new Button(toolbar, SWT.RADIO);
        A.setText("AND");

        Button r = new Button(toolbar, SWT.RADIO);
        r.setText("OR");

        section.setTextClient(toolbar);
        section.setText(type.name());
        section.setClient(client);
        section.setExpanded(true);

【问题讨论】:

    标签: eclipse eclipse-plugin swt rcp


    【解决方案1】:

    找到解决方案, 它实际上是与章节声明。

    Section section = toolkit.createSection(compositeRightDownContent,
                Section.LEFT_TEXT_CLIENT_ALIGNMENT | Section.COMPACT);
    

    成功了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多