Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet251.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 |
---|---|
53 open.addSelectionListener (new class() SelectionAdapter{ | 53 open.addSelectionListener (new class() SelectionAdapter{ |
54 public void widgetSelected (SelectionEvent e) { | 54 public void widgetSelected (SelectionEvent e) { |
55 dialog = new Shell (shell, SWT.DIALOG_TRIM); | 55 dialog = new Shell (shell, SWT.DIALOG_TRIM); |
56 dialog.setLayout (new GridLayout (3, false)); | 56 dialog.setLayout (new GridLayout (3, false)); |
57 | 57 |
58 calendar = new DateTime (dialog, SWT.CALENDAR | DWT.BORDER); | 58 calendar = new DateTime (dialog, SWT.CALENDAR | SWT.BORDER); |
59 date = new DateTime (dialog, SWT.DATE | DWT.SHORT); | 59 date = new DateTime (dialog, SWT.DATE | SWT.SHORT); |
60 time = new DateTime (dialog, SWT.TIME | DWT.SHORT); | 60 time = new DateTime (dialog, SWT.TIME | SWT.SHORT); |
61 | 61 |
62 new Label (dialog, SWT.NONE); | 62 new Label (dialog, SWT.NONE); |
63 new Label (dialog, SWT.NONE); | 63 new Label (dialog, SWT.NONE); |
64 Button ok = new Button (dialog, SWT.PUSH); | 64 Button ok = new Button (dialog, SWT.PUSH); |
65 ok.setText ("OK"); | 65 ok.setText ("OK"); |
66 ok.setLayoutData(new GridData (SWT.FILL, DWT.CENTER, false, false)); | 66 ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false)); |
67 ok.addSelectionListener (new class() SelectionAdapter{ | 67 ok.addSelectionListener (new class() SelectionAdapter{ |
68 void widgetSelected (SelectionEvent e) { | 68 void widgetSelected (SelectionEvent e) { |
69 Stdout.formatln("Calendar date selected (MM/DD/YYYY) = {:d02}/{:d02}/{:d04}", | 69 Stdout.formatln("Calendar date selected (MM/DD/YYYY) = {:d02}/{:d02}/{:d04}", |
70 (calendar.getMonth () + 1),calendar.getDay (),calendar.getYear ()); | 70 (calendar.getMonth () + 1),calendar.getDay (),calendar.getYear ()); |
71 Stdout.formatln("Date selected (MM/YYYY)= {:d02}/{:d04}", | 71 Stdout.formatln("Date selected (MM/YYYY)= {:d02}/{:d04}", |