Package org.eclipse.swt.widgets

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


            Control control= toolItem.getParent();
            Menu menu= getMenu(control);

            Rectangle bounds= toolItem.getBounds();
            Point topLeft= new Point(bounds.x, bounds.y + bounds.height);
            menu.setLocation(control.toDisplay(topLeft));
            menu.setVisible(true);
        }
    }

    /**
 
View Full Code Here


    private Rectangle getCaretRectangle(int offset) {
      Point location= fContentAssistSubjectControlAdapter.getLocationAtOffset(offset);
      Control subjectControl= fContentAssistSubjectControlAdapter.getControl();
      Point controlSize= subjectControl.getSize();
      constrainLocation(location, new Point(0, 0), new Rectangle(0, 0, controlSize.x, controlSize.y));
      location= subjectControl.toDisplay(location);
      Rectangle subjectRectangle= new Rectangle(location.x, location.y, 1, fContentAssistSubjectControlAdapter.getLineHeight());
      return subjectRectangle;
    }
   
    protected Point getStackedLocation(Shell shell, Shell parent) {
View Full Code Here

     * Returns the location of the given event, in display coordinates
     * @return
     */
    public static Point getEventLoc(Event event) {
        Control ctrl = (Control) event.widget;
        return ctrl.toDisplay(new Point(event.x, event.y));
    }

}
View Full Code Here

      fAllowMouseExit= true;

      Control subjectControl= getSubjectControl();
      // return a location that just overlaps the annotation on the bar
      if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT)
        return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2);
      else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT)
        return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2);
    }

    fAllowMouseExit= false;
View Full Code Here

      Control subjectControl= getSubjectControl();
      // return a location that just overlaps the annotation on the bar
      if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT)
        return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2);
      else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT)
        return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2);
    }

    fAllowMouseExit= false;
    return super.computeLocation(subjectArea, controlSize, anchor);
  }
View Full Code Here

    private Rectangle getCaretRectangle(int offset) {
      Point location= fContentAssistSubjectControlAdapter.getLocationAtOffset(offset);
      Control subjectControl= fContentAssistSubjectControlAdapter.getControl();
      Point controlSize= subjectControl.getSize();
      constrainLocation(location, new Point(0, 0), new Rectangle(0, 0, controlSize.x, controlSize.y));
      location= subjectControl.toDisplay(location);
      Rectangle subjectRectangle= new Rectangle(location.x, location.y, 1, fContentAssistSubjectControlAdapter.getLineHeight());
      return subjectRectangle;
    }

    protected Point getStackedLocation(Shell shell, Shell parent) {
View Full Code Here

      fAllowMouseExit= true;

      Control subjectControl= getSubjectControl();
      // return a location that just overlaps the annotation on the bar
      if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT)
        return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2);
      else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT)
        return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2);
    }

    fAllowMouseExit= false;
View Full Code Here

      Control subjectControl= getSubjectControl();
      // return a location that just overlaps the annotation on the bar
      if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT)
        return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2);
      else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT)
        return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2);
    }

    fAllowMouseExit= false;
    return super.computeLocation(subjectArea, controlSize, anchor);
  }
View Full Code Here

      Control control= toolItem.getParent();
        Menu menu= getMenu(control);
       
        Rectangle bounds= toolItem.getBounds();
        Point topLeft= new Point(bounds.x, bounds.y + bounds.height);
        menu.setLocation(control.toDisplay(topLeft));
        menu.setVisible(true);
      }
    }
   
    /* (non-Javadoc)
 
View Full Code Here

      fAllowMouseExit= true;

      Control subjectControl= getSubjectControl();
      // return a location that just overlaps the annotation on the bar
      if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT)
        return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2);
      else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT)
        return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2);
    }

    fAllowMouseExit= false;
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.