Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.textExtent()


      for (int i = 0; i < months.length; i++) {
        width = Math.max(width, gc.textExtent(months[i]).x);
      }
      width += prevMonth.computeSize(SWT.DEFAULT, SWT.DEFAULT, changed).x * 2
       + HEADER_SPACING * 4 + gc.textExtent(" 9999").x; //$NON-NLS-1$
      width = Math.max(width, (gc.textExtent("99").x + theme.cellPadding * 2)
                               * colCount + linesCount); //$NON-NLS-1$
      int cw = (width - linesCount) / colCount + 1;
      width = cw * colCount + linesCount;
      ((GridData) monthHeader.getLayoutData()).widthHint = width;
      ((GridData) footer.getLayoutData()).widthHint = width;
View Full Code Here


   * @deprecated use <code>getWidthInPixels(int, int)</code> instead
   */
  final protected int getWidthInPixels(String text) {
    GC gc= new GC(fTextWidget);
    gc.setFont(fTextWidget.getFont());
    Point extent= gc.textExtent(text);
    gc.dispose();
    return extent.x;
  }

  /**
 
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  private void setWidthForSampleText(Text control, String sampleText)
  {
    GC gc = new GC (control);
    try {
      Point sampleSize = gc.textExtent (sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    }
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
View Full Code Here

  }

  private void setWidthForSampleText(Text control, String sampleText) {
    GC gc = new GC(control);
    try {
      Point sampleSize = gc.textExtent(sampleText);
      Point currentSize = control.getSize();
      sampleSize.y = currentSize.y;
      control.setSize(sampleSize);
      return;
    } finally {
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.