`
dearwolf
  • 浏览: 340245 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Dialog相关

 
阅读更多
ModalessDialog:

public class ModalessDialog extends Dialog {
 public ModalessDialog(Shell arg0) {
  super(arg0);
  setShellStyle(SWT.SHELL_TRIM | SWT.MODELESS | SWT.RESIZE | SWT.MAX);
 }
}


程序中需要双击摄像头,然后弹出的对话框中显示摄像头所捕捉的画面,原来是这样写的:

  deviceTab.getViewer().addDoubleClickListener(
    new IDoubleClickListener() {
     public void doubleClick(DoubleClickEvent event) {
      StructuredSelection selection = (StructuredSelection) event
        .getSelection();
      DeviceDataDialog dialog = new DeviceDataDialog(event
        .getViewer().getControl().getShell());
      dialog.open();
     }
    });

但是这样子出来的对话框,会始终保持在最前端显示。后来改成

DeviceDataDialog dialog = new DeviceDataDialog(null);

就可以了
也许是因为原先的程序中,对话框和主窗口使用同一个Shell所造成的吧

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics