Changeset 12:47a66440dddd
- Timestamp:
- 02/14/08 18:17:21
(10 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
made the resources for Snippet258 included at compile time
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r11 |
r12 |
|
| 1 | 1 | |
|---|
| 2 | 2 | [*] |
|---|
| 3 | | buildflags+=-g -gc -debug |
|---|
| | 3 | debugflags+=-g -gc -debug |
|---|
| | 4 | |
|---|
| | 5 | #used for dwtsnippets/text/Snippet258 |
|---|
| | 6 | buildflags+=-Jdwtsnippets/images |
|---|
| | 7 | |
|---|
| 4 | 8 | version(Windows){ |
|---|
| 5 | 9 | #buildflags+= -L/SUBSYSTEM:windows:5 |
|---|
| 6 | 10 | buildflags+= -L/SUBSYSTEM:console:5 |
|---|
| 7 | 11 | } |
|---|
| | 12 | |
|---|
| 8 | 13 | # The linker error work around |
|---|
| 9 | | buildflags+= -L-lDD-tango-util |
|---|
| | 14 | version(linux){ |
|---|
| | 15 | buildflags+= -L-lDD-tango-util |
|---|
| | 16 | } |
|---|
| 10 | 17 | |
|---|
| 11 | 18 | [dwtexamples/simple.d] |
|---|
| r11 |
r12 |
|
| 19 | 19 | * For a list of all SWT example snippets see |
|---|
| 20 | 20 | * http://www.eclipse.org/swt/snippets/ |
|---|
| 21 | | * |
|---|
| | 21 | * |
|---|
| 22 | 22 | * @since 3.3 |
|---|
| 23 | | */ |
|---|
| | 23 | */ |
|---|
| 24 | 24 | import dwt.DWT; |
|---|
| 25 | 25 | import dwt.graphics.Image; |
|---|
| … | … | |
| 33 | 33 | import dwt.events.SelectionAdapter; |
|---|
| 34 | 34 | import dwt.events.SelectionEvent; |
|---|
| 35 | | |
|---|
| | 35 | import dwt.graphics.ImageData; |
|---|
| | 36 | import dwt.dwthelper.ByteArrayInputStream; |
|---|
| 36 | 37 | import tango.io.Stdout; |
|---|
| 37 | 38 | |
|---|
| … | … | |
| 40 | 41 | Shell shell = new Shell(display); |
|---|
| 41 | 42 | shell.setLayout(new GridLayout(2, false)); |
|---|
| 42 | | |
|---|
| | 43 | |
|---|
| 43 | 44 | final Text text = new Text(shell, DWT.SEARCH | DWT.CANCEL); |
|---|
| 44 | 45 | Image image = null; |
|---|
| 45 | 46 | if ((text.getStyle() & DWT.CANCEL) == 0) { |
|---|
| 46 | | image = new Image (display, "../images/cancel.gif"); |
|---|
| | 47 | image = new Image (display, new ImageData(new ByteArrayInputStream( cast(byte[]) import("cancel.gif" )))); |
|---|
| 47 | 48 | ToolBar toolBar = new ToolBar (shell, DWT.FLAT); |
|---|
| 48 | 49 | ToolItem item = new ToolItem (toolBar, DWT.PUSH); |
|---|