public int getSelection() { return scrollBar.getSelection(); }
private Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x ); p.y = Math.round( -sel.y * area.y / thumb.y ); return p; }
private Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x ); p.y = Math.round( -sel.y * area.y / thumb.y ); return p; }
@Override public void widgetSelected( SelectionEvent e ) { offsety = -sbVertical.getSelection(); widget.redraw(); } } );
@Override public void widgetSelected( SelectionEvent e ) { offsetx = -sbHorizontal.getSelection(); widget.redraw(); } } );
protected Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x / magnification ); p.y = Math.round( -sel.y * area.y / thumb.y / magnification ); return p; }
public void dispose() { props.setScreen( new WindowProperty( shell ) ); bounds = shell.getBounds(); hscroll = wFields.getHorizontalBar().getSelection(); vscroll = wFields.getVerticalBar().getSelection(); shell.dispose(); }
public void dispose() { props.setScreen( new WindowProperty( shell ) ); bounds = shell.getBounds(); hscroll = wFields.getHorizontalBar().getSelection(); vscroll = wFields.getVerticalBar().getSelection(); shell.dispose(); }
offsetx = -sbHorizontal.getSelection(); offsety = -sbVertical.getSelection(); widget.redraw();
sbHorizontal.setVisible( false ); } else { offsetx = -sbHorizontal.getSelection(); sbHorizontal.setVisible( true ); sbVertical.setVisible( false ); } else { offsety = sbVertical.getSelection(); sbVertical.setVisible( true );
private static Point getOrigin( ScrolledComposite composite ) { Point result = new Point( 0, 0 ); ScrollBar horizontalBar = composite.getHorizontalBar(); if( horizontalBar != null ) { result.x = horizontalBar.getSelection(); } ScrollBar verticalBar = composite.getVerticalBar(); if( verticalBar != null ) { result.y = verticalBar.getSelection(); } return result; }
@Override void updateScrollBarValue (ScrollBar bar) { yCurrentScroll = bar.getSelection(); layoutItems (0, false); } }
private static int getScrollLeft( Grid grid ) { int result = 0; ScrollBar horizontalBar = grid.getHorizontalBar(); if( horizontalBar != null ) { result = horizontalBar.getSelection(); } return result; }
/** * Scrolls the widget horizontally. */ void handleHorizontalScroll(Event event) { int scrollPixel = getHorizontalBar().getSelection() - horizontalScrollOffset; scrollHorizontal(scrollPixel, false); } /**
/** * Scrolls the widget vertically. */ void handleVerticalScroll(Event event) { int scrollPixel = getVerticalBar().getSelection() - getVerticalScrollOffset(); scrollVertical(scrollPixel, false); } /**
void hScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar hBar = getHorizontalBar (); int hSelection = hBar.getSelection (); content.setLocation (-hSelection, location.y); } boolean needHScroll(Rectangle contentRect, boolean vVisible) {
void hScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar hBar = getHorizontalBar (); int hSelection = hBar.getSelection (); content.setLocation (-hSelection, location.y); } boolean needHScroll(Rectangle contentRect, boolean vVisible) {
@Override public void handleEvent(org.eclipse.swt.widgets.Event e) { final int hSelection = hBar.getSelection(); final int destX = -hSelection - origin.x; canvas.scroll(destX, 0, 0, 0, timeline.getWidth(), timeline.getHeight(), false); barCanvas.scroll(destX, 0, 0, 0, timelineBar.contents.getBounds().width, timelineBar.contents.getBounds().height, false); origin.x = -hSelection; } });
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**
void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) { int inactive = 1; if (clientArea < maximum) { bar.setMaximum(maximum - margin); bar.setThumb(clientArea - margin); bar.setPageIncrement(clientArea - margin); if (!alwaysShowScroll) bar.setVisible(true); } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) { bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive); } } /**