Changeset 17:7b7a54b047e1
- Timestamp:
- 02/27/08 19:24:17
(9 months ago)
- Author:
- Jesse Phillips <Jesse.K.Phillips+D@gmail.com>
- branch:
- default
- Message:
Added unfinished but usable ClipboardExample? and Snippet293. Updated other snippets to use the auto keyword. Made the opengl example windows only until it is added to the linux version.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r16 |
r17 |
|
| 17 | 17 | |
|---|
| 18 | 18 | [dwtexamples/simple.d] |
|---|
| | 19 | [dwtexamples/clipboard/ClipboardExample.d] |
|---|
| 19 | 20 | [dwtexamples/helloworld/HelloWorld1.d] |
|---|
| 20 | 21 | [dwtexamples/helloworld/HelloWorld2.d] |
|---|
| … | … | |
| 23 | 24 | [dwtexamples/helloworld/HelloWorld5.d] |
|---|
| 24 | 25 | |
|---|
| | 26 | [dwtsnippets/button/Snippet293.d] |
|---|
| 25 | 27 | [dwtsnippets/styledtext/Snippet163.d] |
|---|
| 26 | 28 | [dwtsnippets/styledtext/Snippet189.d] |
|---|
| … | … | |
| 31 | 33 | [user/torhu_synctest.d] |
|---|
| 32 | 34 | |
|---|
| 33 | | [snippets/opengl_test1.d] |
|---|
| | 35 | #Until linux has the opengl stuff |
|---|
| | 36 | version(Windows) { |
|---|
| | 37 | [snippets/opengl_test1.d] |
|---|
| | 38 | } |
|---|
| 34 | 39 | |
|---|
| 35 | 40 | [dwtexamples/addressbook/AddressBook.d] |
|---|
| r11 |
r17 |
|
| 28 | 28 | |
|---|
| 29 | 29 | void main() { |
|---|
| 30 | | Display display = new Display(); |
|---|
| 31 | | Shell shell = new Shell(display); |
|---|
| | 30 | auto display = new Display(); |
|---|
| | 31 | auto shell = new Shell(display); |
|---|
| 32 | 32 | shell.setLayout(new FillLayout()); |
|---|
| 33 | | StyledText text = new StyledText (shell, DWT.BORDER); |
|---|
| | 33 | auto text = new StyledText (shell, DWT.BORDER); |
|---|
| 34 | 34 | text.setText("0123456789 ABCDEFGHIJKLM NOPQRSTUVWXYZ"); |
|---|
| 35 | 35 | // make 0123456789 appear bold |
|---|
| 36 | | StyleRange style1 = new StyleRange(); |
|---|
| | 36 | auto style1 = new StyleRange(); |
|---|
| 37 | 37 | style1.start = 0; |
|---|
| 38 | 38 | style1.length = 10; |
|---|
| … | … | |
| 40 | 40 | text.setStyleRange(style1); |
|---|
| 41 | 41 | // make ABCDEFGHIJKLM have a red font |
|---|
| 42 | | StyleRange style2 = new StyleRange(); |
|---|
| | 42 | auto style2 = new StyleRange(); |
|---|
| 43 | 43 | style2.start = 11; |
|---|
| 44 | 44 | style2.length = 13; |
|---|
| … | … | |
| 46 | 46 | text.setStyleRange(style2); |
|---|
| 47 | 47 | // make NOPQRSTUVWXYZ have a blue background |
|---|
| 48 | | StyleRange style3 = new StyleRange(); |
|---|
| | 48 | auto style3 = new StyleRange(); |
|---|
| 49 | 49 | style3.start = 25; |
|---|
| 50 | 50 | style3.length = 13; |
|---|
| r11 |
r17 |
|
| 31 | 31 | |
|---|
| 32 | 32 | void main () { |
|---|
| 33 | | Display display = new Display (); |
|---|
| 34 | | Shell shell = new Shell (display); |
|---|
| | 33 | auto display = new Display (); |
|---|
| | 34 | auto shell = new Shell (display); |
|---|
| 35 | 35 | shell.setText("StyledText with underline and strike through"); |
|---|
| 36 | 36 | shell.setLayout(new FillLayout()); |
|---|
| 37 | | StyledText text = new StyledText (shell, DWT.BORDER); |
|---|
| | 37 | auto text = new StyledText (shell, DWT.BORDER); |
|---|
| 38 | 38 | text.setText("0123456789 ABCDEFGHIJKLM NOPQRSTUVWXYZ"); |
|---|
| 39 | 39 | // make 0123456789 appear underlined |
|---|
| 40 | | StyleRange style1 = new StyleRange(); |
|---|
| | 40 | auto style1 = new StyleRange(); |
|---|
| 41 | 41 | style1.start = 0; |
|---|
| 42 | 42 | style1.length = 10; |
|---|
| … | … | |
| 44 | 44 | text.setStyleRange(style1); |
|---|
| 45 | 45 | // make ABCDEFGHIJKLM have a strike through |
|---|
| 46 | | StyleRange style2 = new StyleRange(); |
|---|
| | 46 | auto style2 = new StyleRange(); |
|---|
| 47 | 47 | style2.start = 11; |
|---|
| 48 | 48 | style2.length = 13; |
|---|
| … | … | |
| 50 | 50 | text.setStyleRange(style2); |
|---|
| 51 | 51 | // make NOPQRSTUVWXYZ appear underlined and have a strike through |
|---|
| 52 | | StyleRange style3 = new StyleRange(); |
|---|
| | 52 | auto style3 = new StyleRange(); |
|---|
| 53 | 53 | style3.start = 25; |
|---|
| 54 | 54 | style3.length = 13; |
|---|
| r12 |
r17 |
|
| 38 | 38 | |
|---|
| 39 | 39 | void main() { |
|---|
| 40 | | Display display = new Display(); |
|---|
| 41 | | Shell shell = new Shell(display); |
|---|
| | 40 | auto display = new Display(); |
|---|
| | 41 | auto shell = new Shell(display); |
|---|
| 42 | 42 | shell.setLayout(new GridLayout(2, false)); |
|---|
| 43 | 43 | |
|---|
| 44 | | final Text text = new Text(shell, DWT.SEARCH | DWT.CANCEL); |
|---|
| | 44 | auto text = new Text(shell, DWT.SEARCH | DWT.CANCEL); |
|---|
| 45 | 45 | Image image = null; |
|---|
| 46 | 46 | if ((text.getStyle() & DWT.CANCEL) == 0) { |
|---|
| 47 | 47 | image = new Image (display, new ImageData(new ByteArrayInputStream( cast(byte[]) import("cancel.gif" )))); |
|---|
| 48 | | ToolBar toolBar = new ToolBar (shell, DWT.FLAT); |
|---|
| 49 | | ToolItem item = new ToolItem (toolBar, DWT.PUSH); |
|---|
| | 48 | auto toolBar = new ToolBar (shell, DWT.FLAT); |
|---|
| | 49 | auto item = new ToolItem (toolBar, DWT.PUSH); |
|---|
| 50 | 50 | item.setImage (image); |
|---|
| 51 | 51 | item.addSelectionListener(new class SelectionAdapter { |
|---|
| r11 |
r17 |
|
| 29 | 29 | |
|---|
| 30 | 30 | void main () { |
|---|
| 31 | | char[] string = "This is a string\nwith a new line."; |
|---|
| 32 | | Display display = new Display (); |
|---|
| 33 | | Shell shell = new Shell (display); |
|---|
| 34 | | TabFolder folder = new TabFolder (shell, DWT.BORDER); |
|---|
| | 31 | auto string = "This is a string\nwith a new line."; |
|---|
| | 32 | auto display = new Display (); |
|---|
| | 33 | auto shell = new Shell (display); |
|---|
| | 34 | auto folder = new TabFolder (shell, DWT.BORDER); |
|---|
| 35 | 35 | |
|---|
| 36 | 36 | folder.setSize (200, 200); |
|---|
| 37 | | TabItem item0 = new TabItem (folder, 0); |
|---|
| | 37 | auto item0 = new TabItem (folder, 0); |
|---|
| 38 | 38 | item0.setToolTipText ("TabItem toolTip: " ~ string); |
|---|
| 39 | 39 | |
|---|
| 40 | | ToolBar bar = new ToolBar (shell, DWT.BORDER); |
|---|
| | 40 | auto bar = new ToolBar (shell, DWT.BORDER); |
|---|
| 41 | 41 | bar.setBounds (0, 200, 200, 64); |
|---|
| 42 | 42 | ToolItem item1 = new ToolItem (bar, 0); |
|---|