Rectangle getBoundsInPixels () { return DPIUtil.autoScaleUp(getBounds()); }
Rectangle getBoundsInPixels () { return DPIUtil.autoScaleUp(getBounds()); }
Rectangle getBoundsInPixels () { return DPIUtil.autoScaleUp(getBounds()); }
Rectangle getBoundsInPixels () { return DPIUtil.autoScaleUp(getBounds()); }
sendSelectionEvent (SWT.Selection, event, true); if (isDisposed ()) return 0; Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); if (event.doit) { lastX = rect.x;
private void markFocusedCell(Event event, ViewerCell cell) { Color background = (cell.getControl().isFocusControl()) ? getSelectedCellBackgroundColor(cell) : getSelectedCellBackgroundColorNoFocus(cell); Color foreground = (cell.getControl().isFocusControl()) ? getSelectedCellForegroundColor(cell) : getSelectedCellForegroundColorNoFocus(cell); if (foreground != null || background != null || onlyTextHighlighting(cell)) { GC gc = event.gc; if (background == null) { background = cell.getItem().getDisplay().getSystemColor( SWT.COLOR_LIST_SELECTION); } if (foreground == null) { foreground = cell.getItem().getDisplay().getSystemColor( SWT.COLOR_LIST_SELECTION_TEXT); } gc.setBackground(background); gc.setForeground(foreground); if (onlyTextHighlighting(cell)) { Rectangle area = event.getBounds(); Rectangle rect = cell.getTextBounds(); if( rect != null ) { area.x = rect.x; } gc.fillRectangle(area); } else { gc.fillRectangle(event.getBounds()); } event.detail &= ~SWT.SELECTED; } }
private void markFocusedCell(Event event, ViewerCell cell) { Color background = (cell.getControl().isFocusControl()) ? getSelectedCellBackgroundColor(cell) : getSelectedCellBackgroundColorNoFocus(cell); Color foreground = (cell.getControl().isFocusControl()) ? getSelectedCellForegroundColor(cell) : getSelectedCellForegroundColorNoFocus(cell); if (foreground != null || background != null || onlyTextHighlighting(cell)) { GC gc = event.gc; if (background == null) { background = cell.getItem().getDisplay().getSystemColor( SWT.COLOR_LIST_SELECTION); } if (foreground == null) { foreground = cell.getItem().getDisplay().getSystemColor( SWT.COLOR_LIST_SELECTION_TEXT); } gc.setBackground(background); gc.setForeground(foreground); if (onlyTextHighlighting(cell)) { Rectangle area = event.getBounds(); Rectangle rect = cell.getTextBounds(); if( rect != null ) { area.x = rect.x; } gc.fillRectangle(area); } else { gc.fillRectangle(event.getBounds()); } event.detail &= ~SWT.SELECTED; } }
Rectangle bounds = event.getBounds(); if ((event.detail & SWT.SELECTED) != 0) {
Rectangle bounds = event.getBounds(); if ((event.detail & SWT.SELECTED) != 0) {
boolean showMenu (int x, int y, int detail) { Event event = new Event (); Rectangle eventRect = new Rectangle (x, y, 0, 0); event.setBounds (DPIUtil.autoScaleDown (eventRect)); event.detail = detail; sendEvent (SWT.MenuDetect, event); //widget could be disposed at this point if (isDisposed ()) return false; if (event.doit) { if (menu != null && !menu.isDisposed ()) { boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp); menu.createIMMenu (hooksKeys ? imHandle() : 0); Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); if (rect.x != x || rect.y != y) { menu.setLocationInPixels (rect.x, rect.y); } menu.setVisible (true); return true; } } return false; }
boolean showMenu (int x, int y, int detail) { Event event = new Event (); Rectangle eventRect = new Rectangle (x, y, 0, 0); event.setBounds (DPIUtil.autoScaleDown (eventRect)); event.detail = detail; sendEvent (SWT.MenuDetect, event); //widget could be disposed at this point if (isDisposed ()) return false; if (event.doit) { if (menu != null && !menu.isDisposed ()) { boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp); menu.createIMMenu (hooksKeys ? imHandle() : 0); Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); if (rect.x != x || rect.y != y) { menu.setLocationInPixels (rect.x, rect.y); } menu.setVisible (true); return true; } } return false; }
boolean showMenu (int x, int y, int detail) { Event event = new Event (); Rectangle eventRect = new Rectangle (x, y, 0, 0); event.setBounds (DPIUtil.autoScaleDown (eventRect)); event.detail = detail; sendEvent (SWT.MenuDetect, event); //widget could be disposed at this point if (isDisposed ()) return false; if (event.doit) { if (menu != null && !menu.isDisposed ()) { boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp); menu.createIMMenu (hooksKeys ? imHandle() : 0); Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); if (rect.x != x || rect.y != y) { menu.setLocationInPixels (rect.x, rect.y); } menu.setVisible (true); return true; } } return false; }
public void handleEvent(Event event) { if (shouldApplyGradient(event)) { Scrollable scrollable = (Scrollable) event.widget; GC gc = event.gc; Rectangle area = scrollable.getClientArea(); Rectangle rect = event.getBounds(); /* Paint the selection beyond the end of last column */ expandRegion(event, scrollable, gc, area); /* Draw Gradient Rectangle */ Color oldForeground = gc.getForeground(); Color oldBackground = gc.getBackground(); gc.setForeground(categoryGradientEnd); gc.drawLine(0, rect.y, area.width, rect.y); gc.setForeground(categoryGradientStart); gc.setBackground(categoryGradientEnd); // gc.setForeground(categoryGradientStart); // gc.setBackground(categoryGradientEnd); // gc.setForeground(new Clr(Display.getCurrent(), 255, 0, 0)); gc.fillGradientRectangle(0, rect.y + 1, area.width, rect.height, true); /* Bottom Line */ // gc.setForeground(); gc.setForeground(categoryGradientEnd); gc.drawLine(0, rect.y + rect.height - 1, area.width, rect.y + rect.height - 1); gc.setForeground(oldForeground); gc.setBackground(oldBackground); /* Mark as Background being handled */ event.detail &= ~SWT.BACKGROUND; } }
if (event.doit) { if ((style & SWT.SMOOTH) != 0) { Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); setBoundsInPixels (rect.x, rect.y, width, height);
if (event.doit) { if ((style & SWT.SMOOTH) != 0) { Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); setBoundsInPixels (rect.x, rect.y, width, height);
if (event.doit) { if ((style & SWT.SMOOTH) != 0) { Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); setBoundsInPixels (rect.x, rect.y, width, height);
if (event.doit) { dragging = true; Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); lastX = rect.x; lastY = rect.y;
if (event.doit) { dragging = true; Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); lastX = rect.x; lastY = rect.y;
if (event.doit) { dragging = true; Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); lastX = rect.x; lastY = rect.y;
sendEvent (SWT.MeasureItem, event); gc.dispose (); Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ()); contentWidth [0] = rect.width - imageWidth; if (contentHeight [0] < rect.height) contentHeight [0] = rect.height;