comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet48.d @ 29:4e5843b771cc

First snippets buildable on windows
author Frank Benoit <benoit@tionex.de>
date Sun, 22 Mar 2009 19:55:00 +0100
parents 69b1fa94a4a8
children 9f4c18c268b2
comparison
equal deleted inserted replaced
28:69b1fa94a4a8 29:4e5843b771cc
58 gc.dispose (); 58 gc.dispose ();
59 } 59 }
60 final Image image = originalImage; 60 final Image image = originalImage;
61 final Point origin = new Point (0, 0); 61 final Point origin = new Point (0, 0);
62 final Canvas canvas = new Canvas (shell, SWT.NO_BACKGROUND | 62 final Canvas canvas = new Canvas (shell, SWT.NO_BACKGROUND |
63 SWT.NO_REDRAW_RESIZE | DWT.V_SCROLL | DWT.H_SCROLL); 63 SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL);
64 final ScrollBar hBar = canvas.getHorizontalBar (); 64 final ScrollBar hBar = canvas.getHorizontalBar ();
65 void onHBarSelection (Event e) { 65 void onHBarSelection (Event e) {
66 int hSelection = hBar.getSelection (); 66 int hSelection = hBar.getSelection ();
67 int destX = -hSelection - origin.x; 67 int destX = -hSelection - origin.x;
68 Rectangle rect = image.getBounds (); 68 Rectangle rect = image.getBounds ();