if ( !resizedRect.equals( shellSize ) || isClippedByUnalignedMonitors( resizedRect, shell.getDisplay() ) ) { Monitor monitor = shell.getDisplay().getPrimaryMonitor(); if ( shell.getParent() != null ) {
/** * @return true if the client are changed from the last time this method * was called (and false otherwise). Has a side effect of * updating fCurrClientArea. */ private boolean clientAreaChangedFromLastCall() { Rectangle clientArea = fStyledText.getClientArea(); if (fCurrClientArea == null || !fCurrClientArea.equals(clientArea)) { fCurrClientArea = clientArea; return true; } return false; }
boolean redrawIfClientAreaChanged() { if (oldClientArea == null || !oldClientArea.equals(boxText.getClientArea())){ drawBackgroundBoxes(); return true; } return false; }
@Override protected void layout(Composite composite, boolean flushCache) { Control[] children = composite.getChildren(); if (children.length != 1) { return; } Control child = children[0]; Rectangle newBounds = composite.getClientArea(); if (!newBounds.equals(lastBounds)) { child.setBounds(newBounds); lastBounds = newBounds; } }
/** * Constrain the shell size to be no larger than the display bounds. * * @since 2.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Constrain the shell size to be no larger than the display bounds. * * @since 2.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Constrain the shell size to be no larger than the display bounds. * * @since 1.0 */ protected void constrainShellSize() { // limit the shell size to the display size Rectangle bounds = shell.getBounds(); Rectangle constrained = getConstrainedShellBounds(bounds); if (!bounds.equals(constrained)) { shell.setBounds(constrained); } }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, Rectangle value) { Rectangle oldValue = getRectangle(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, Rectangle value) { Rectangle oldValue = getRectangle(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } }
/** * Sets the current value of the preference with the given name * in the given preference store. * * @param store the preference store * @param name the name of the preference * @param value the new current value of the preference */ public static void setValue(IPreferenceStore store, String name, Rectangle value) { Rectangle oldValue = getRectangle(store, name); if (oldValue == null || !oldValue.equals(value)) { store.putValue(name, StringConverter.asString(value)); store.firePropertyChangeEvent(name, oldValue, value); } }
@Override public void setFont (Font font) { checkWidget (); Rectangle oldRect = getClientAreaInPixels (); super.setFont (font); Rectangle newRect = getClientAreaInPixels (); if (!oldRect.equals (newRect)) sendResize (); }
private void updateItemsWithResizeEvent() { Rectangle rectBefore = getClientArea(); updateItems(); Rectangle rectAfter = getClientArea(); if( !rectBefore.equals( rectAfter ) ) { notifyListeners( SWT.Resize, new Event() ); } }
private boolean updateBounds() { Rectangle bounds; if (textSearchControl == null || textSearchControl.getTextControl() == null || textSearchControl.getTextControl().isDisposed()) { bounds = new Rectangle(0, 0, 0, 0); } else { bounds = textSearchControl.getBounds(); Point absPosition = textSearchControl.toDisplay(textSearchControl.getLocation()); bounds.x = absPosition.x - bounds.x; bounds.y = absPosition.y - bounds.y; } if (trimBounds == null || !trimBounds.equals(bounds)) { this.trimBounds = bounds; return true; } return false; }
void runUpdate() { if (updateFlags == 0) return; int flags = updateFlags; updateFlags = 0; Rectangle rectBefore = getClientArea(); updateTabHeight(false); updateItems(selectedIndex); if ((flags & REDRAW) != 0) { redraw(); } else if ((flags & REDRAW_TABS) != 0) { redrawTabs(); } Rectangle rectAfter = getClientArea(); if (!rectBefore.equals(rectAfter)) { notifyListeners(SWT.Resize, new Event()); layout(); } }
void runUpdate() { if (updateFlags == 0) return; int flags = updateFlags; updateFlags = 0; Rectangle rectBefore = getClientArea(); updateTabHeight(false); updateItems(selectedIndex); if ((flags & REDRAW) != 0) { redraw(); } else if ((flags & REDRAW_TABS) != 0) { redrawTabs(); } Rectangle rectAfter = getClientArea(); if (!rectBefore.equals(rectAfter)) { notifyListeners(SWT.Resize, new Event()); layout(); } }
@Override public void setFont (Font font) { checkWidget (); Rectangle oldRect = getClientAreaInPixels (); super.setFont (font); Rectangle newRect = getClientAreaInPixels (); if (!oldRect.equals (newRect)) { sendResize (); int index = (int)/*64*/OS.SendMessage (handle, OS.TCM_GETCURSEL, 0, 0); if (index != -1) { TabItem item = items [index]; Control control = item.control; if (control != null && !control.isDisposed ()) { control.setBoundsInPixels (getClientAreaInPixels ()); } } } }
void runUpdate() { if (updateFlags == 0) return; int flags = updateFlags; updateFlags = 0; Rectangle rectBefore = getClientArea(); updateTabHeight(false); updateItems(selectedIndex); if ((flags & REDRAW) != 0) { redraw(); } else if ((flags & REDRAW_TABS) != 0) { redrawTabs(); } Rectangle rectAfter = getClientArea(); if (!rectBefore.equals(rectAfter)) { notifyListeners(SWT.Resize, new Event()); layout(); } }
void runUpdate() { if (updateFlags == 0) return; int flags = updateFlags; updateFlags = 0; Rectangle rectBefore = getClientArea(); updateTabHeight(false); updateItems(selectedIndex); if ((flags & REDRAW) != 0) { redraw(); } else if ((flags & REDRAW_TABS) != 0) { redrawTabs(); } Rectangle rectAfter = getClientArea(); if (!rectBefore.equals(rectAfter)) { notifyListeners(SWT.Resize, new Event()); layout(); } }
/** * Should be called whenever a control's contents have changed. Will * trigger a layout parent controls if necessary. * * @param changedControl */ public static void resize(Control changedControl) { Composite parent = changedControl.getParent(); Layout parentLayout = parent.getLayout(); if (parentLayout instanceof ICachingLayout) { ((ICachingLayout) parentLayout).flush(changedControl); } if (parent instanceof Shell) { parent.layout(true); } else { Rectangle currentBounds = parent.getBounds(); resize(parent); // If the parent was resized, then it has already triggered a // layout. Otherwise, we need to manually force it to layout again. if (currentBounds.equals(parent.getBounds())) { parent.layout(true); } } } }
void runUpdate() { if (updateFlags == 0) return; int flags = updateFlags; updateFlags = 0; Rectangle rectBefore = getClientArea(); updateTabHeight(false); updateItems(selectedIndex); if ((flags & REDRAW) != 0) { redraw(); } else if ((flags & REDRAW_TABS) != 0) { redrawTabs(); } Rectangle rectAfter = getClientArea(); if (!rectBefore.equals(rectAfter)) { notifyListeners(SWT.Resize, new Event()); layout(); } }