Package org.eclipse.swt.widgets

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


      Point prefSize;
      if (horizontal) {
        //prefSize = control.computeSize(majorHint, SWT.DEFAULT);
        prefSize = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      } else {
        prefSize = control.computeSize(SWT.DEFAULT, majorHint);
      }

      // Will this control fit onto the current line?
      int curTileSize = horizontal ? prefSize.x : prefSize.y;
View Full Code Here


      // Tile each line
      int tilePosMajor = horizontal ? areaBounds.x : areaBounds.y;
      for (Iterator iter = curLine.controls.iterator(); iter.hasNext();) {
        Control control = (Control) iter.next();
        TrimLayoutData td = (TrimLayoutData) control.getLayoutData();
        Point prefSize = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);

        int major = horizontal ? prefSize.x : prefSize.y;
        int minor = horizontal ? prefSize.y : prefSize.x;

        // Ensure that controls that are too wide for the area get
View Full Code Here

     *   <code>new Point(width,height)</code>
     */
    protected Point doComputeSize() {
      Control page = getControl();
        if (descriptionLabel != null && page != null) {
            Point bodySize = page.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
            GridData gd = (GridData) descriptionLabel.getLayoutData();
            gd.widthHint = bodySize.x;
        }
        return getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    }
View Full Code Here

        StatusLineLayoutData data = (StatusLineLayoutData) w
            .getLayoutData();
        if (data == null) {
          data = DEFAULT_DATA;
        }
        Point e = w.computeSize(data.widthHint, data.heightHint,
            changed);
        if (useWidth) {
          totalWidth += e.x;
          totalCnt++;
        }
View Full Code Here

        StatusLineLayoutData data = (StatusLineLayoutData) w
            .getLayoutData();
        if (data == null) {
          data = DEFAULT_DATA;
        }
        int width = w.computeSize(data.widthHint, h, flushCache).x;
        ws[i] = width;
        totalWidth += width + GAP;
      }

      int diff = rect.width - totalWidth;
View Full Code Here

    Control pageControl = page.getControl();
    if (pageControl == null) {
      // control not created yet
      return new Point(0, 0);
    }
    Point contentSize = pageControl.computeSize(SWT.DEFAULT, SWT.DEFAULT,
        true);
    Rectangle rect = pageContainerLayout.getClientArea(pageContainer);
    Point containerSize = new Point(rect.width, rect.height);
    return new Point(Math.max(0, contentSize.x - containerSize.x), Math
        .max(0, contentSize.y - containerSize.y));
View Full Code Here

    int count = children.length;
    int maxWidth = 0;
    int maxHeight = 0;
    for (int i = 0; i < count; ++i) {
      Control child = children[i];
      Point pt = child.computeSize(-1, -1, flushCache);
      maxWidth = Math.max(maxWidth, pt.x);
      maxHeight = Math.max(maxHeight, pt.y);
    }

    if (wHint != -1)
View Full Code Here

    if (fBanner != null)
      fBanner.setFont(JFaceResources.getBannerFont());

    Control control= fScrolledComposite.getContent();
    fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    fScrolledComposite.setContent(control);

    fScrolledComposite.layout(true);
    fScrolledComposite.redraw();
  }
View Full Code Here

    Control [] children = composite.getChildren ();
    int count = children.length;
    int maxWidth = 0, maxHeight = 0;
    for (int i=0; i<count; i++) {
      Control child = children [i];
      Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
      maxWidth = Math.max (maxWidth, pt.x);
      maxHeight = Math.max (maxHeight, pt.y);
    }

    if (wHint != SWT.DEFAULT)
View Full Code Here

  public void paintControl(PaintEvent e) {
    // Erst alles in ein Image malen und dann in einem Zug in das Control
    // zeichnen.
    GC egc = e.gc;
    Control widget = (Control) e.widget;
    Point size = widget.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    Image image = new Image(Display.getDefault(), size.x, size.y);
    GC gc = new GC(image);
    gc.setBackground(widget.getBackground());
    gc.fillRectangle(0, 0, size.x, size.y);
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.