@Override public Point getLocation(Point tipSize, Event event) { return messageLabel.getShell().toDisplay(messageLabel.getLocation()); } };
@Override public Point getLocation(Point tipSize, Event event) { return messageLabel.getShell().toDisplay(messageLabel.getLocation()); } };
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); shiftHorizontalLocation(p, shellBounds, displayBounds); shiftVerticalLocation(p, shellBounds, displayBounds); return p; }
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Rectangle shellBounds= shell.getBounds(); Rectangle displayBounds= shell.getDisplay().getClientArea(); shiftHorizontalLocation(p, shellBounds, displayBounds); shiftVerticalLocation(p, shellBounds, displayBounds); return p; }
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Point shellSize= shell.getSize(); Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0)); Rectangle displayBounds= monitor.getClientArea(); constrainLocation(p, shellSize, displayBounds); return p; }
protected Point getStackedLocation(Shell shell, Shell parent) { Point p= parent.getLocation(); Point size= parent.getSize(); p.x += size.x / 4; p.y += size.y; p= parent.toDisplay(p); Point shellSize= shell.getSize(); Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0)); Rectangle displayBounds= monitor.getClientArea(); constrainLocation(p, shellSize, displayBounds); return p; }
private Point getTargetLocation() { Shell shell = target.getShell(); Display display = target.getDisplay(); Point location = target.getLocation(); location = display.map(target.getParent(), shell, location); return shell.toDisplay(location); }
@Override public void widgetSelected(SelectionEvent e) { Menu menu = new Menu(shell); currentEditor.fillMenu(menu); menu.setLocation(shell.toDisplay(shell.getSize().x, shell.getClientArea().y)); menu.setVisible(true); }
private void performDocking() { if (isAlive()) { switch (anchorControlPosition.getPosition()) { case DockPosition.TOP_LEFT: dockedShell.setLocation(mainShell.toDisplay(anchorControl.getLocation())); break; case DockPosition.TOP_RIGHT: break; case DockPosition.BOTTOM_LEFT: { Point p = mainShell.toDisplay(anchorControl.getLocation()); p.x += anchorControlPosition.getOffset().xOffset; p.y += anchorControlPosition.getOffset().yOffset; p.y += anchorControl.getSize().y; dockedShell.setLocation(p); } break; case DockPosition.BOTTOM_RIGHT: { Point p = mainShell.toDisplay(anchorControl.getLocation()); p.x += anchorControlPosition.getOffset().xOffset; p.y += anchorControlPosition.getOffset().yOffset; p.x += anchorControl.getSize().x; p.y += anchorControl.getSize().y; dockedShell.setLocation(p); } break; default: break; } } }
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
/** * Show the dialog's menu. This message has no effect if the receiver was * not configured to show a menu. Clients may call this method in order to * trigger the menu via keystrokes or other gestures. Subclasses typically * do not override method. */ protected void showDialogMenu() { if (!showDialogMenu) { return; } if (menuManager == null) { menuManager = new MenuManager(); fillDialogMenu(menuManager); } // Setting this flag works around a problem that remains on X only, // whereby activating the menu deactivates our shell. listenToDeactivate = !Util.isGtk(); Menu menu = menuManager.createContextMenu(getShell()); Rectangle bounds = toolBar.getBounds(); Point topLeft = new Point(bounds.x, bounds.y + bounds.height); topLeft = getShell().toDisplay(topLeft); menu.setLocation(topLeft.x, topLeft.y); menu.setVisible(true); }
pt = control.getParent().toDisplay(location.x, location.y); else pt = ((Shell)control).toDisplay(location.x, location.y);
Point location = shell.toDisplay(0, 0); gcFullImage.drawImage(subImage, location.x - shellBounds.x, location.y - shellBounds.y);
Point ptBottomRight = shell.toDisplay(shellSize); Rectangle monitorArea = shell.getMonitor().getClientArea(); if (ptBottomRight.x > monitorArea.x + monitorArea.width) {