Mercurial > projects > dwt-samples
changeset 104:d0c469a93a5d
Scale snippet 45, thanks yidabu
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 20 Jun 2008 01:33:04 +0200 |
parents | 9bdff8e345d5 |
children | 84d951a90f16 |
files | snippets/dsss.conf snippets/scale/Snippet45.d |
diffstat | 2 files changed, 35 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/snippets/dsss.conf Thu Jun 05 18:56:24 2008 +0200 +++ b/snippets/dsss.conf Fri Jun 20 01:33:04 2008 +0200 @@ -44,6 +44,7 @@ [program/Snippet32.d] [sash/Snippet107.d] [sashform/Snippet109.d] +[scale/Snippet45.d] [shell/Snippet134.d] [shell/Snippet138.d] [spinner/Snippet184.d]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/snippets/scale/Snippet45.d Fri Jun 20 01:33:04 2008 +0200 @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +module snippets.scale.Snippet45; + +import dwt.DWT; +import dwt.widgets.Display; +import dwt.widgets.Shell; +import dwt.widgets.Scale; + +import dwt.dwthelper.utils; + + +public static void main (String [] args) { + Display display = new Display (); + Shell shell = new Shell (display); + Scale scale = new Scale (shell, DWT.BORDER); + scale.setSize (200, 64); + scale.setMaximum (40); + scale.setPageIncrement (5); + shell.open (); + while (!shell.isDisposed ()) { + if (!display.readAndDispatch ()) display.sleep (); + } + display.dispose (); +} +