@Override public void controlResized(ControlEvent e){ Rectangle shellSize = shell.getClientArea(); list.setSize(shellSize.width, shellSize.height); } });
@Override public void controlResized(ControlEvent e){ Rectangle shellSize = shell.getClientArea(); list.setSize(shellSize.width, shellSize.height); } });
public void controlResized(ControlEvent e){ Rectangle shellSize = shell.getClientArea(); list.setSize(shellSize.width, shellSize.height); } });
@Override public void controlResized(ControlEvent e){ Rectangle shellSize = shell.getClientArea(); list.setSize(shellSize.width, shellSize.height); } });
@Override public void controlResized(ControlEvent e){ Rectangle shellSize = shell.getClientArea(); list.setSize(shellSize.width, shellSize.height); } });
public void controlMoved(ControlEvent e) { if (HelpUIPlugin.DEBUG_INFOPOP) { System.out .println("ContextHelpDialog: shell control adapter called."); //$NON-NLS-1$ } Rectangle clientArea = shell.getClientArea(); shell.redraw(clientArea.x, clientArea.y, clientArea.width, clientArea.height, true); shell.update(); } });
public Shell open (Display display) { Shell shell = new Shell (display); Label label = new Label (shell, SWT.CENTER); label.setText (resHello.getString("Hello_world")); label.setBounds (shell.getClientArea ()); shell.open (); return shell; } }
public BrowserWindow(Shell parent, String url, double wPct, double hPct, boolean allowResize, boolean isModal) { if (parent == null) { init(parent, url, 0, 0, allowResize, isModal); } else { Rectangle clientArea = parent.getClientArea(); init(parent, url, (int) (clientArea.width * wPct), (int) (clientArea.height * hPct), allowResize, isModal); } }
public SimpleBrowserWindow(Shell parent, String url, double wPct, double hPct, boolean allowResize, boolean isModal) { if (parent == null) { init(parent, url, 0, 0, allowResize, isModal); } else { Rectangle clientArea = parent.getClientArea(); init(parent, url, (int) (clientArea.width * wPct), (int) (clientArea.height * hPct), allowResize, isModal); } }
@Override protected void layout(Composite composite, boolean flushCache) { if (root == null) return; Rectangle bounds = composite.getBounds(); if (composite instanceof Shell) bounds = ((Shell) composite).getClientArea(); else { bounds.x = 0; bounds.y = 0; } bounds.width -= (marginLeft + marginRight); bounds.height -= (marginTop + marginBottom); bounds.x += marginLeft; bounds.y += marginTop; sashes.clear(); tileSubNodes(bounds, root); }
@Override protected void layout(Composite composite, boolean flushCache) { if (root == null) return; Rectangle bounds = composite.getBounds(); if (composite instanceof Shell) bounds = ((Shell) composite).getClientArea(); else { bounds.x = 0; bounds.y = 0; } bounds.width -= (marginLeft + marginRight); bounds.height -= (marginTop + marginBottom); bounds.x += marginLeft; bounds.y += marginTop; sashes.clear(); tileSubNodes(bounds, root); }
@Override public void paintControl(PaintEvent e) { e.gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_BORDER)); Rectangle clientArea = shell.getClientArea(); e.gc.drawRectangle(0, 0, clientArea.width - 1, clientArea.height - 1); } });
public void handleEvent(Event event) { if (event.detail != SWT.DRAG) { Rectangle clientArea = shell.getClientArea(); int newWidth = clientArea.width - event.x - (sash.getSize().x + rightSeparator.getSize().x); if (newWidth != data.widthHint) { data.widthHint = newWidth; shell.layout(); } } } });
public Shell open (Display display) { final Shell shell = new Shell (display); final Label label = new Label (shell, SWT.CENTER); label.setText (resHello.getString("Hello_world")); label.pack(); shell.addControlListener(ControlListener.controlResizedAdapter(e -> label.setBounds (shell.getClientArea ()))); shell.pack(); shell.open (); return shell; } }
/** * * * @param layout * @since 4.1.0.5 */ protected void resetProfileInfoBox(boolean layout) { if (soInfoTitle != null) { soInfoTitle.setTextID("devices.choose.profile.info.title"); } if (soInfoText != null) { soInfoText.setTextID("devices.choose.profile.info.text"); if (layout) { Point computeSize = shell.computeSize(shell.getClientArea().width, SWT.DEFAULT, true); shell.setSize(computeSize); } } }
void handleResize(ControlEvent event) { Rectangle rect = shell.getClientArea(); Point cSize = coolBar.computeSize(rect.width, SWT.DEFAULT); Point sSize = statusBar.computeSize(SWT.DEFAULT, SWT.DEFAULT); int statusMargin = 2; coolBar.setBounds(rect.x, rect.y, cSize.x, cSize.y); styledText.setBounds(rect.x, rect.y + cSize.y, rect.width, rect.height - cSize.y - (sSize.y + 2 * statusMargin)); statusBar.setBounds(rect.x + statusMargin, rect.y + rect.height - sSize.y - statusMargin, rect.width - (2 * statusMargin), sSize.y); }
@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); }
public Shell open (Display display) { final Color red = new Color(display, 0xFF, 0, 0); final Shell shell = new Shell (display); shell.addPaintListener(event -> { GC gc = event.gc; gc.setForeground(red); Rectangle rect = shell.getClientArea(); gc.drawRectangle(rect.x + 10, rect.y + 10, rect.width - 20, rect.height - 20); gc.drawString(resHello.getString("Hello_world"), rect.x + 20, rect.y + 20); }); shell.addDisposeListener (e -> red.dispose()); shell.open (); return shell; } }
public Overlay(Shell shell) { baseShell = shell; Rectangle cr = baseShell.getClientArea(); Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height); offsetX = -trim.x; offsetY = -trim.y; overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP); overlayShell.setBounds(baseShell.getBounds()); overlayShell.setBackground(baseShell.getDisplay().getSystemColor( SWT.COLOR_DARK_GREEN)); overlayShell.setAlpha(128); blue = new Color(baseShell.getDisplay(), 0, 0, 128); overlayShell.addPaintListener(e -> { e.gc.setForeground(blue); e.gc.setBackground(blue); for (Adornment adornment : adornments) { adornment.drawAdornment(e.gc); } }); }
@Override public Rectangle getMetrics(int windowElement) { switch (windowElement) { case WINDOW_ELEMENT_TOOLBAR: break; case WINDOW_ELEMENT_TOPBAR: SWTSkinObject skinObject = skin.getSkinObject(SkinConstants.VIEWID_PLUGINBAR); if (skinObject != null) { return skinObject.getControl().getBounds(); } break; case WINDOW_ELEMENT_STATUSBAR: return statusBar.getBounds(); case WINDOW_CLIENT_AREA: return shell.getClientArea(); case WINDOW_CONTENT_DISPLAY_AREA: Rectangle r = getMetrics(WINDOW_CLIENT_AREA); r.height -= getMetrics(WINDOW_ELEMENT_TOPBAR).height; r.height -= getMetrics(WINDOW_ELEMENT_TOOLBAR).height; r.height -= getMetrics(WINDOW_ELEMENT_STATUSBAR).height; return r; } return new Rectangle(0, 0, 0, 0); }