static void scrollPage(ScrolledComposite scomp, boolean up) { Rectangle clientArea = scomp.getClientArea(); int increment = up ? -clientArea.height : clientArea.height; scroll(scomp, 0, increment); }
static void scrollPage(ScrolledComposite scomp, boolean up) { Rectangle clientArea = scomp.getClientArea(); int increment = up ? -clientArea.height : clientArea.height; scroll(scomp, 0, increment); }
@Override public void controlResized(ControlEvent e) { Rectangle r = sc.getClientArea(); Point size = cMainComposite.computeSize(r.width, SWT.DEFAULT); sc.setMinSize(size); } });
@Override public void handleEvent(Event event) { int width = sc.getClientArea().width; Point size = parent.computeSize( width, SWT.DEFAULT ); sc.setMinSize( size ); } } );
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(main.computeSize(r.width, SWT.DEFAULT )); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(scrollChild.computeSize(SWT.DEFAULT, SWT.DEFAULT)); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = sc.getClientArea(); Point size = cMainComposite.computeSize(r.width, SWT.DEFAULT); sc.setMinSize(size); } });
@Override public void controlResized(ControlEvent e) { Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(scrollChild.computeSize(r.width, SWT.DEFAULT)); } });
private Point calculateVerticalSize( boolean changed ) { Point resultSize = super.computeSize( SWT.DEFAULT, SWT.DEFAULT, changed ); int clientAreaWidth = scrolledComposite.getClientArea().width; Point widthSize = super.computeSize( clientAreaWidth, SWT.DEFAULT, changed ); if( widthSize.y > resultSize.y ) { resultSize = widthSize; } return resultSize; }
@Override public void controlResized(final ControlEvent e) { Rectangle r = scrolledComposite.getClientArea(); scrolledComposite.setMinSize(imageComposite.computeSize(r.width, SWT.DEFAULT)); } });
private Point calculateHorizontalSize( boolean changed ) { Point resultSize = super.computeSize( SWT.DEFAULT, SWT.DEFAULT, changed ); int clientAreaHeight = scrolledComposite.getClientArea().height; Point heightSize = super.computeSize( SWT.DEFAULT, clientAreaHeight, changed ); if( heightSize.x > resultSize.x ) { resultSize = heightSize; } return resultSize; }
@Override public void controlResized(ControlEvent event) { IconSelector is = (IconSelector) event.widget.getData(DATA_ICONSELECTOR); ScrolledComposite parent = (ScrolledComposite) event.widget; is.initColumns(parent.getClientArea().width - 20); //is.initColumns(parent.getClientArea().width); }
public static void updatePageIncrement(ScrolledComposite scomp) { ScrollBar vbar = scomp.getVerticalBar(); if (vbar != null) { Rectangle clientArea = scomp.getClientArea(); int increment = clientArea.height - 5; vbar.setPageIncrement(increment); } ScrollBar hbar = scomp.getHorizontalBar(); if (hbar != null) { Rectangle clientArea = scomp.getClientArea(); int increment = clientArea.width - 5; hbar.setPageIncrement(increment); } }
public static void updatePageIncrement(ScrolledComposite scomp) { ScrollBar vbar = scomp.getVerticalBar(); if (vbar != null) { Rectangle clientArea = scomp.getClientArea(); int increment = clientArea.height - 5; vbar.setPageIncrement(increment); } ScrollBar hbar = scomp.getHorizontalBar(); if (hbar != null) { Rectangle clientArea = scomp.getClientArea(); int increment = clientArea.width - 5; hbar.setPageIncrement(increment); } }
public static void updateScrolledComposite(ScrolledComposite sc) { Control content = sc.getContent(); if (content != null && !content.isDisposed()) { Rectangle r = sc.getClientArea(); sc.setMinSize(content.computeSize(r.width, SWT.DEFAULT )); } }
public static void setViewRequiresOneDownload(Composite genComposite) { if (genComposite == null || genComposite.isDisposed()) { return; } Utils.disposeComposite(genComposite, false); Label lab = new Label(genComposite, SWT.NULL); GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true); gridData.verticalIndent = 10; lab.setLayoutData(gridData); Messages.setLanguageText(lab, "view.one.download.only"); genComposite.layout(true); Composite parent = genComposite.getParent(); if (parent instanceof ScrolledComposite) { ScrolledComposite scrolled_comp = (ScrolledComposite) parent; Rectangle r = scrolled_comp.getClientArea(); scrolled_comp.setMinSize(genComposite.computeSize(r.width, SWT.DEFAULT )); } }
/** * <p> * Checks if a control is visible within the visible area. The control needs * to be completely visible for a <code>true</code> result. * </p> * * @param control the control to check the visibility. Must not be <code>null</code>. * * @throws IllegalArgumentException when the defined control is <code>null</code> or not a * children of this Composite. */ public boolean isRevealed( Control control ) { checkRevealState( control ); Point origin = scrolledComposite.getOrigin(); Rectangle clientArea = scrolledComposite.getClientArea(); Rectangle controlBounds = control.getBounds(); return ScrollingCompositeUtil.isRevealed( origin, clientArea, controlBounds ); }
private void setupSC(ScrolledComposite sc) { if (sc == null) { return; } Composite c = (Composite) sc.getContent(); if (c != null) { Point size1 = c.computeSize(sc.getClientArea().width, SWT.DEFAULT); Point size = c.computeSize(SWT.DEFAULT, size1.y); sc.setMinSize(size); } ScrollBar verticalBar = sc.getVerticalBar(); if (verticalBar != null) { verticalBar.setPageIncrement(sc.getSize().y); } }
public void controlResized(ControlEvent e) { Rectangle clientArea = fScrolledComposite.getClientArea(); ScrollBar verticalBar= fScrolledComposite.getVerticalBar(); verticalBar.setIncrement(VERTICAL_SCROLL_INCREMENT); verticalBar.setPageIncrement(clientArea.height - verticalBar.getIncrement()); ScrollBar horizontalBar= fScrolledComposite.getHorizontalBar(); horizontalBar.setIncrement(HORIZONTAL_SCROLL_INCREMENT); horizontalBar.setPageIncrement(clientArea.width - horizontalBar.getIncrement()); } });
@Override public Point computeSize( int wHint, int hHint, boolean changed ) { Point resultSize = super.computeSize( SWT.DEFAULT, SWT.DEFAULT, changed ); if( hasStyle( SWT.V_SCROLL ) && hasStyle( SWT.H_SCROLL ) ) { setMinSize( resultSize.x, resultSize.y ); } else if( hasStyle( SWT.H_SCROLL ) ) { resultSize = calculateHorizontalSize( changed ); setMinSize( resultSize.x, SWT.DEFAULT ); } else if( hasStyle( SWT.V_SCROLL ) ) { resultSize = calculateVerticalSize( changed ); setMinSize( scrolledComposite.getClientArea().width, resultSize.y ); } return resultSize; }