Examples of computeSize()


Examples of org.eclipse.swt.widgets.Shell.computeSize()

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
    LayoutUtils.positionShell(shell, false);
  }

View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

    Shell shell = getShell();

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    /* Bug in SWT: The preferred width of the state condition is wrong */
 
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    /* Bug in SWT: The preferred width of the state condition is wrong */
    if (Application.IS_LINUX && displaysSavedSearch())
      requiredSize.x = requiredSize.x + 100;

View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

    }

    /* Pack Shell and expect enough room to fit the Control */
    else {
      int currentWidth = shell.getSize().x;
      Point desiredSize = shell.computeSize(currentWidth, SWT.DEFAULT);
      if (desiredSize.y > shell.getSize().y)
        shell.setSize(currentWidth, desiredSize.y);
      else
        shell.layout(true, true);
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

    Shell shell = getShell();

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
    int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
    LayoutUtils.positionShell(shell);
  }
}
View Full Code Here

Examples of org.eclipse.swt.widgets.Shell.computeSize()

        Shell shell = browser.getShell();
        if (event.location != null)
          shell.setLocation(event.location);
        if (event.size != null) {
          Point size = event.size;
          shell.setSize(shell.computeSize(size.x, size.y));
        }
        shell.open();
      }
    });
    browser.addCloseWindowListener(new CloseWindowListener() {
View Full Code Here

Examples of org.eclipse.swt.widgets.Slider.computeSize()

                fgIsAvailable = true;

                final Slider sliderV = new Slider(parent, SWT.VERTICAL);
                final Slider sliderH = new Slider(parent, SWT.HORIZONTAL);
                final int width = sliderV.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
                final int height = sliderH.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
                fgScrollBarSize = new Point(width, height);
                sliderV.dispose();
                sliderH.dispose();
            } catch (final SWTError er) {
                fgIsAvailable = false;
View Full Code Here

Examples of org.eclipse.swt.widgets.Table.computeSize()

    Table table = (Table) c;
    // To avoid recursions.
    table.setLayout(null);
    // Use native layout algorithm
    Point result = table.computeSize(wHint, hHint, flush);
    table.setLayout(this);

    int width = 0;
    int size = columns.size();
    for (int i = 0; i < size; ++i) {
View Full Code Here

Examples of org.eclipse.swt.widgets.Text.computeSize()

      Text text = (Text) celleditor.getControl();
      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (getWrapLabel().isTextWrapOn()
          && getWrapLabel().getText().length() > 0) {
        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.