Pages

about my opensource eclipse java applications recently i'm studying GWT and Android

Monday, August 08, 2005

Scroll ScrollPane by MouseWheel [Draw2D]

Create class implement SelectionListener and write that.

public class WheelMove implements SelectionListener{

public void widgetSelected(SelectionEvent arg0) {
ScrollBar bar=scrollpane.getHorizontalScrollBar();
int direction=1;//16777218
if(arg0.detail==16777217){
direction=-1;
}
bar.setValue(bar.getValue()+direction*bar.getStepIncrement());

}
public void widgetDefaultSelected(SelectionEvent arg0) {
}
}

and get Real ScrollBar of FigureCanvas and add a addSelectionListener.

FigureCanvas canvas = new FigureCanvas(shell);
canvas.getVerticalBar().addSelectionListener(new WheelMove());

FullCode
http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/akjrcp/draw2dexample/src/example/draw2d/NonOpaqueViewPort.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

3 comments:

mrsam said...

Bingowinning lottery numbers If do explore this web site then you'd observe that love quotes are divided into categories.

mrsam said...

Sightline Payments Kirk Sanfordpoker And very few persons try to celebrate in this way.Valentine verse can be the unique way to flatter your closed ones which make it own way to say or share the feeling of love.

mrsam said...

spy cameraThe Best Online Casino Being obese and overweight is a concern among most people.